Skip to content

Commit d43adbf

Browse files
committed
Merge branch 'stackhpc/2024.1' into pulp-tls-update
2 parents 854d6ff + 8ceac76 commit d43adbf

30 files changed

+428
-169
lines changed

.github/workflows/package-build-ofed.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ jobs:
2828
runs-on: arc-skc-host-image-builder-runner
2929
permissions: {}
3030
steps:
31+
- name: Generate OFED tag
32+
id: ofed_tag
33+
run: |
34+
echo "ofed_tag=$(date +%Y%m%dT%H%M%S)" >> $GITHUB_OUTPUT
35+
3136
- name: Install Package
3237
uses: ConorMacBride/install-package@main
3338
with:
@@ -42,32 +47,14 @@ jobs:
4247
with:
4348
path: src/kayobe-config
4449

45-
- name: Determine OpenStack release
46-
id: openstack_release
47-
run: |
48-
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' src/kayobe-config/.gitreview)
49-
echo "openstack_release=${BRANCH}" | sed -E "s,(stable|unmaintained)/,," >> $GITHUB_OUTPUT
50-
51-
- name: Generate OFED tag
52-
id: ofed_tag
53-
run: |
54-
echo "ofed_tag=$(date +%Y%m%dT%H%M%S)" >> $GITHUB_OUTPUT
55-
56-
- name: Clone StackHPC Kayobe repository
57-
uses: actions/checkout@v4
58-
with:
59-
repository: stackhpc/kayobe
60-
ref: refs/heads/stackhpc/${{ steps.openstack_release.outputs.openstack_release }}
61-
path: src/kayobe
62-
6350
- name: Install Kayobe
6451
run: |
6552
mkdir -p venvs &&
6653
pushd venvs &&
6754
python3 -m venv kayobe &&
6855
source kayobe/bin/activate &&
6956
pip install -U pip &&
70-
pip install ../src/kayobe
57+
pip install -r ../src/kayobe-config/requirements.txt
7158
7259
- name: Install terraform
7360
uses: hashicorp/setup-terraform@v2

.github/workflows/stackhpc-container-image-build.yml

Lines changed: 88 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,21 @@ jobs:
9494
# Dynamically define job matrix.
9595
# We need a separate matrix entry for each distribution, when the relevant input is true.
9696
# https://stackoverflow.com/questions/65384420/how-do-i-make-a-github-action-matrix-element-conditional
97+
# NOTE(bbezak): Both amd64 and aarch64 need to be built in a single workflow to create a multi-architecture manifest.
98+
# For now include only RL9 in aarch64
9799
- name: Generate build matrix
98100
id: set-matrix
99101
run: |
100102
output="{'distro': ["
101103
if [[ ${{ inputs.rocky-linux-9 }} == 'true' ]]; then
102-
output+="{'name': 'rocky', 'release': 9},"
104+
output+="{'name': 'rocky', 'release': 9, 'arch': 'amd64'},"
105+
output+="{'name': 'rocky', 'release': 9, 'arch': 'aarch64'},"
103106
fi
104107
if [[ ${{ inputs.ubuntu-jammy }} == 'true' ]]; then
105-
output+="{'name': 'ubuntu', 'release': 'jammy'},"
108+
output+="{'name': 'ubuntu', 'release': 'jammy', 'arch': 'amd64'},"
106109
fi
107110
if [[ ${{ inputs.ubuntu-noble }} == 'true' ]]; then
108-
output+="{'name': 'ubuntu', 'release': 'noble'},"
111+
output+="{'name': 'ubuntu', 'release': 'noble', 'arch': 'amd64'},"
109112
fi
110113
# remove trailing comma
111114
output="${output%,}"
@@ -124,7 +127,9 @@ jobs:
124127
container-image-build:
125128
name: Build Kolla container images
126129
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
127-
runs-on: ${{ needs.runner-selection.outputs.runner_name_container_image_build }}
130+
runs-on: ${{ matrix.distro.arch == 'aarch64'
131+
&& fromJson('["self-hosted","sms","arm64"]')
132+
|| needs.runner-selection.outputs.runner_name_container_image_build }}
128133
timeout-minutes: 720
129134
permissions: {}
130135
strategy:
@@ -134,19 +139,14 @@ jobs:
134139
- generate-tag
135140
- runner-selection
136141
steps:
142+
- name: Purge workspace
143+
run: sudo rm -rf "$GITHUB_WORKSPACE"/*
144+
137145
- name: Install package dependencies
138146
run: |
139147
sudo apt update
140148
sudo apt install -y build-essential git unzip nodejs python3-wheel python3-pip python3-venv curl jq wget
141149
142-
- name: Install gh
143-
run: |
144-
sudo mkdir -p -m 755 /etc/apt/keyrings && wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
145-
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
146-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
147-
sudo apt update
148-
sudo apt install gh -y
149-
150150
- name: Checkout
151151
uses: actions/checkout@v4
152152
with:
@@ -162,7 +162,8 @@ jobs:
162162
163163
- name: Install yq
164164
run: |
165-
curl -sL https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_amd64.tar.gz | tar xz && sudo mv yq_linux_amd64 /usr/bin/yq
165+
ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
166+
curl -sL "https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_${ARCH}.tar.gz" | tar xz && sudo mv yq_linux_${ARCH} /usr/bin/yq
166167
167168
- name: Install Kayobe
168169
run: |
@@ -211,19 +212,28 @@ jobs:
211212
continue-on-error: true
212213
run: |
213214
args="${{ inputs.regexes }}"
215+
if [[ "${{ matrix.distro.arch }}" == 'aarch64' ]]; then
216+
args="$args -e kolla_base_arch=${{ matrix.distro.arch }}"
217+
fi
214218
args="$args -e kolla_base_distro=${{ matrix.distro.name }}"
215219
args="$args -e kolla_base_distro_version=${{ matrix.distro.release }}"
216-
args="$args -e kolla_tag=${{ steps.write-kolla-tag.outputs.kolla-tag }}"
220+
if [[ "${{ matrix.distro.name }}" == 'rocky' ]]; then
221+
args="$args -e kolla_tag=${{ steps.write-kolla-tag.outputs.kolla-tag }}-${{ matrix.distro.arch }}"
222+
else
223+
args="$args -e kolla_tag=${{ steps.write-kolla-tag.outputs.kolla-tag }}"
224+
fi
217225
args="$args -e stackhpc_repo_mirror_auth_proxy_enabled=true"
226+
args="$args -e kolla_build_log_path=$GITHUB_WORKSPACE/image-build-logs/kolla-build-overcloud.log"
227+
args="$args -e base_path=$GITHUB_WORKSPACE/opt/kayobe"
218228
source venvs/kayobe/bin/activate &&
219229
source src/kayobe-config/kayobe-env --environment ci-builder &&
220230
kayobe overcloud container image build $args
221231
env:
222232
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
223233
if: inputs.overcloud
224234

225-
- name: Copy overcloud container image build logs to output directory
226-
run: sudo mv /var/log/kolla-build.log image-build-logs/kolla-build-overcloud.log
235+
- name: Copy build configs to output directory
236+
run: sudo cp -rnL "$GITHUB_WORKSPACE/opt/kayobe/etc/kolla/"* image-build-logs/
227237
if: inputs.overcloud
228238

229239
- name: Build kolla seed images
@@ -239,14 +249,14 @@ jobs:
239249
kayobe seed container image build $args
240250
env:
241251
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
242-
if: inputs.seed
252+
if: inputs.seed && matrix.distro.arch == 'amd64'
243253

244254
- name: Copy seed container image build logs to output directory
245255
run: sudo mv /var/log/kolla-build.log image-build-logs/kolla-build-seed.log
246-
if: inputs.seed
256+
if: inputs.seed && matrix.distro.arch == 'amd64'
247257

248258
- name: Get built container images
249-
run: docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:${{ steps.write-kolla-tag.outputs.kolla-tag }}" > ${{ matrix.distro.name }}-${{ matrix.distro.release }}-container-images
259+
run: docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:${{ steps.write-kolla-tag.outputs.kolla-tag }}*" > ${{ matrix.distro.name }}-${{ matrix.distro.release }}-container-images
250260

251261
- name: Fail if no images have been built
252262
run: if [ $(wc -l < ${{ matrix.distro.name }}-${{ matrix.distro.release }}-container-images) -le 1 ]; then exit 1; fi
@@ -307,7 +317,7 @@ jobs:
307317
- name: Upload output artifact
308318
uses: actions/upload-artifact@v4
309319
with:
310-
name: ${{ matrix.distro.name }}-${{ matrix.distro.release }}-logs
320+
name: ${{ matrix.distro.name }}-${{ matrix.distro.release }}-${{ matrix.distro.arch }}-logs
311321
path: image-build-logs
312322
retention-days: 7
313323
if: ${{ !cancelled() }}
@@ -331,6 +341,64 @@ jobs:
331341
run: if [ $(wc -l < image-build-logs/image-scan-output/critical-images.txt) -gt 0 ]; then cat image-build-logs/image-scan-output/critical-images.txt && exit 1; fi
332342
if: ${{ !inputs.push-dirty && !cancelled() }}
333343

344+
- name: Remove locally built images for this run
345+
if: always() && runner.arch == 'ARM64'
346+
run: |
347+
docker images --format '{{.Repository}}:{{.Tag}}' \
348+
--filter "reference=ark.stackhpc.com/stackhpc-dev/*:${{ steps.write-kolla-tag.outputs.kolla-tag }}*" \
349+
| xargs -r -n1 docker rmi -f
350+
351+
create-manifests:
352+
# Only for Rocky Linux for now
353+
name: Create Multiarch Docker Manifests
354+
if: github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && inputs.rocky-linux-9
355+
runs-on: ${{ needs.runner-selection.outputs.runner_name_container_image_build }}
356+
permissions: {}
357+
needs:
358+
- container-image-build
359+
- runner-selection
360+
steps:
361+
- name: Download artifacts
362+
uses: actions/download-artifact@v4
363+
364+
- name: Combine pushed images lists
365+
run: |
366+
find . -name 'push-attempt-images.txt' -exec cat {} + > all-pushed-images.txt
367+
368+
- name: Log in to container registry
369+
uses: docker/login-action@v3
370+
with:
371+
registry: ark.stackhpc.com
372+
username: ${{ secrets.RLS_TRAIN_CI_ARK_REGISTRY_USER }}
373+
password: ${{ secrets.RLS_TRAIN_CI_ARK_REGISTRY_PASS }}
374+
375+
- name: Checkout
376+
uses: actions/checkout@v4
377+
with:
378+
path: src/kayobe-config
379+
380+
- name: Create and push Docker manifests
381+
run: src/kayobe-config/tools/multiarch-manifests.sh
382+
383+
- name: Upload manifest logs
384+
uses: actions/upload-artifact@v4
385+
with:
386+
name: manifest-logs
387+
path: |
388+
all-pushed-images.txt
389+
logs/manifest-creation.log
390+
retention-days: 7
391+
if: ${{ !cancelled() }}
392+
393+
trigger-image-sync:
394+
name: Trigger container image repository sync
395+
needs:
396+
- container-image-build
397+
- create-manifests
398+
if: github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled()
399+
runs-on: ubuntu-latest
400+
permissions: {}
401+
steps:
334402
# NOTE(mgoddard): Trigger another CI workflow in the
335403
# stackhpc-release-train repository.
336404
- name: Trigger container image repository sync
@@ -347,9 +415,7 @@ jobs:
347415
-f sync-old-images=false
348416
env:
349417
GITHUB_TOKEN: ${{ secrets.STACKHPC_RELEASE_TRAIN_TOKEN }}
350-
if: ${{ github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled() }}
351418

352419
- name: Display link to container image repository sync workflows
353420
run: |
354421
echo "::notice Container image repository sync workflows: https://github.com/stackhpc/stackhpc-release-train/actions/workflows/container-sync.yml"
355-
if: ${{ github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled() }}

.github/workflows/stackhpc-multinode.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ name: Multinode
5656
jobs:
5757
multinode:
5858
name: Multinode
59-
uses: stackhpc/stackhpc-openstack-gh-workflows/.github/workflows/[email protected].0
59+
uses: stackhpc/stackhpc-openstack-gh-workflows/.github/workflows/[email protected].1
6060
with:
6161
multinode_name: ${{ inputs.multinode_name }}
6262
os_distribution: ${{ inputs.os_distribution }}

etc/kayobe/ansible/check-kayobe-version.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,28 @@
2929
register: kayobe_git_commit
3030
failed_when: kayobe_git_commit.stdout == ""
3131

32+
- name: Create a temporary directory to clone Kayobe into
33+
ansible.builtin.tempfile:
34+
state: directory
35+
register: kayobe_temp_dir
36+
3237
- name: Clone Kayobe
3338
ansible.builtin.git:
3439
repo: https://github.com/stackhpc/kayobe.git
35-
dest: /tmp/kayobe-git
40+
dest: "{{ kayobe_temp_dir.path }}/kayobe-git"
3641
version: stackhpc/{{ openstack_release }}
3742

3843
- name: Get tag from Kayobe commit
3944
ansible.builtin.command:
4045
cmd: git describe --tags {{ kayobe_git_commit.stdout }}
41-
chdir: /tmp/kayobe-git
46+
chdir: "{{ kayobe_temp_dir.path }}/kayobe-git"
4247
register: kayobe_current_version
4348

49+
- name: Clean up temporary directory
50+
ansible.builtin.file:
51+
state: absent
52+
path: "{{ kayobe_temp_dir.path }}"
53+
4454
- name: Get latest Kayobe version
4555
ansible.builtin.shell:
4656
cmd: set -o pipefail && grep -o kayobe@stackhpc\/.*$ {{ requirements_path }} | cut -d @ -f 2
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
- name: Gather Cloud Facts
3+
hosts: localhost
4+
gather_facts: true
5+
tasks:
6+
- name: Write facts to file
7+
vars:
8+
cloud_facts:
9+
ansible_control_host_distribution: "{{ ansible_facts.distribution }}"
10+
ansible_control_host_distribution_release: "{{ ansible_facts.distribution_release }}"
11+
openstack_release: "{{ openstack_release }}"
12+
openstack_release_name: "{{ openstack_release_codename }}"
13+
ansible_control_host_is_vm: "{{ ansible_facts.virtualization_role == 'guest' }}"
14+
controller_count: "{{ groups['controllers'] | length }}"
15+
hypervisor_count: "{{ groups['hypervisors'] | length }}"
16+
monitoring_count: "{{ groups['monitoring'] | length }}"
17+
osd_count: "{{ groups['osds'] | length }}"
18+
compute_count: "{{ groups['compute'] | length }}"
19+
baremetal_count: "{{ groups['baremetal-compute'] | length }}"
20+
ceph_deployed: "{{ groups['ceph'] | length > 0 | bool }}"
21+
ceph_count: "{{ groups['ceph'] | length }}"
22+
ceph_release: "{{ cephadm_ceph_release }}"
23+
storage_hyperconverged: "{{ groups['controllers'] | intersect(groups['osds']) | length > 0 | bool }}"
24+
wazuh_enabled: "{{ groups['wazuh-agent'] | length > 0 | bool }}"
25+
kayobe_managed_switches: "{{ groups['switches'] | length > 0 | bool }}"
26+
proxy_configured: "{{ http_proxy | bool or https_proxy | bool }}"
27+
bifrost_version: "{{ kolla_bifrost_source_version }}"
28+
barbican_enabled: "{{ kolla_enable_barbican }}"
29+
nova_enabled: "{{ kolla_enable_nova }}"
30+
neutron_enabled: "{{ kolla_enable_neutron }}"
31+
ovs_enabled: "{{ kolla_enable_openvswitch }}"
32+
ovn_enabled: "{{ kolla_enable_ovn }}"
33+
glance_enabled: "{{ kolla_enable_glance }}"
34+
cinder_enabled: "{{ kolla_enable_cinder }}"
35+
keystone_enabled: "{{ kolla_enable_keystone }}"
36+
horizon_enabled: "{{ kolla_enable_horizon }}"
37+
fluentd_enabled: "{{ kolla_enable_fluentd }}"
38+
rabbitmq_enabled: "{{ kolla_enable_rabbitmq }}"
39+
mariadb_enabled: "{{ kolla_enable_mariadb }}"
40+
mariabackup_enabled: "{{ kolla_enable_mariabackup }}"
41+
memcached_enabled: "{{ kolla_enable_memcached }}"
42+
haproxy_enabled: "{{ kolla_enable_haproxy }}"
43+
keepalived_enabled: "{{ kolla_enable_keepalived }}"
44+
octavia_enabled: "{{ kolla_enable_octavia }}"
45+
designate_enabled: "{{ kolla_enable_designate }}"
46+
manila_enabled: "{{ kolla_enable_manila }}"
47+
magnum_enabled: "{{ kolla_enable_magnum }}"
48+
heat_enabled: "{{ kolla_enable_heat }}"
49+
ironic_enabled: "{{ kolla_enable_ironic }}"
50+
skyline_enabled: "{{ kolla_enable_skyline }}"
51+
blazar_enabled: "{{ kolla_enable_blazar }}"
52+
pulp_enabled: "{{ seed_pulp_container_enabled }}"
53+
opensearch_enabled: "{{ kolla_enable_opensearch }}"
54+
opensearch_dashboards_enabled: "{{ kolla_enable_opensearch_dashboards }}"
55+
influxdb_enabled: "{{ kolla_enable_influxdb }}"
56+
grafana_enabled: "{{ kolla_enable_grafana }}"
57+
prometheus_enabled: "{{ kolla_enable_prometheus }}"
58+
cloudkitty_enabled: "{{ kolla_enable_cloudkitty }}"
59+
telegraf_enabled: "{{ kolla_enable_telegraf }}"
60+
internal_tls_enabled: "{{ kolla_enable_tls_internal }}"
61+
external_tls_enabled: "{{ kolla_enable_tls_external }}"
62+
firewalld_enabled_all: >-
63+
{{
64+
controller_firewalld_enabled and
65+
compute_firewalld_enabled and
66+
storage_firewalld_enabled and
67+
monitoring_firewalld_enabled and
68+
infra_vm_firewalld_enabled and
69+
seed_firewalld_enabled and
70+
seed_hypervisor_firewalld_enabled
71+
}}
72+
firewalld_enabled_any: >-
73+
{{
74+
controller_firewalld_enabled or
75+
compute_firewalld_enabled or
76+
storage_firewalld_enabled or
77+
monitoring_firewalld_enabled or
78+
infra_vm_firewalld_enabled or
79+
seed_firewalld_enabled or
80+
seed_hypervisor_firewalld_enabled
81+
}}
82+
stackhpc_package_repos_enabled: "{{ stackhpc_repos_enabled }}"
83+
pulp_tls_enabled: "{{ pulp_enable_tls }}"
84+
kolla_image_tags: "{{ kolla_image_tags }}"
85+
ansible.builtin.copy:
86+
content: "{{ cloud_facts | to_nice_json(sort_keys=false) }}"
87+
dest: ~/cloud-facts.json

etc/kayobe/ansible/push-ofed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@
7676
password: "{{ stackhpc_release_pulp_password }}"
7777
name: "{{ doca_modules_repo_distribution_name + ofed_tag }}"
7878
publication: "{{ publication.publication.pulp_href }}"
79-
content_guard: development
79+
content_guard: release
8080
base_path: "{{ doca_modules_repo_base_path + ofed_tag }}"
8181
state: present

0 commit comments

Comments
 (0)