Skip to content

Commit 337d39f

Browse files
authored
add aarch64 container image builds for R9 (#1322)
Change-Id: Ifcd61399a07d5cfe9fa319236ecb911bf735f33c
1 parent 88ab336 commit 337d39f

File tree

11 files changed

+223
-83
lines changed

11 files changed

+223
-83
lines changed

.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() }}

etc/kayobe/environments/ci-aio/stackhpc-ci.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ stackhpc_repo_mirror_password: !vault |
2323
2424
# Build against released Pulp repository versions.
2525
stackhpc_repo_grafana_version: "{{ stackhpc_pulp_repo_grafana_version }}"
26-
stackhpc_repo_rhel9_rabbitmq_erlang_version: "{{ stackhpc_pulp_repo_rhel9_rabbitmq_erlang_version }}"
26+
stackhpc_repo_rhel9_rabbitmq_erlang_version: "{{ stackhpc_pulp_repo_multiarch_rhel9_rabbitmq_erlang_version }}"
2727
stackhpc_repo_rhel9_rabbitmq_server_version: "{{ stackhpc_pulp_repo_rhel9_rabbitmq_server_version }}"
2828
stackhpc_repo_ubuntu_jammy_version: "{{ stackhpc_pulp_repo_ubuntu_jammy_version }}"
2929
stackhpc_repo_ubuntu_jammy_security_version: "{{ stackhpc_pulp_repo_ubuntu_jammy_security_version }}"
@@ -34,15 +34,15 @@ stackhpc_repo_ubuntu_noble_version: "{{ stackhpc_pulp_repo_ubuntu_noble_version
3434
stackhpc_repo_ubuntu_noble_security_version: "{{ stackhpc_pulp_repo_ubuntu_noble_security_version }}"
3535
stackhpc_repo_docker_ce_ubuntu_noble_version: "{{ stackhpc_pulp_repo_docker_ce_ubuntu_noble_version }}"
3636
stackhpc_repo_ceph_reef_debian_version: "{{ stackhpc_pulp_repo_ceph_reef_debian_version }}"
37-
stackhpc_repo_centos_stream_9_nfv_openvswitch_version: "{{ stackhpc_pulp_repo_centos_stream_9_nfv_openvswitch_version }}"
38-
stackhpc_repo_centos_stream_9_openstack_caracal_version: "{{ stackhpc_pulp_repo_centos_stream_9_openstack_caracal_version }}"
39-
stackhpc_repo_centos_stream_9_opstools_version: "{{ stackhpc_pulp_repo_centos_stream_9_opstools_version }}"
40-
stackhpc_repo_centos_stream_9_storage_ceph_reef_version: "{{ stackhpc_pulp_repo_centos_stream_9_storage_ceph_reef_version }}"
41-
stackhpc_repo_centos_stream_9_docker_version: "{{ stackhpc_pulp_repo_centos_stream_9_docker_version }}"
42-
stackhpc_repo_rhel_9_treasuredata_5_version: "{{ stackhpc_pulp_repo_rhel_9_treasuredata_5_version }}"
43-
stackhpc_repo_rhel_9_mariadb_10_11_version: "{{ stackhpc_pulp_repo_rhel_9_mariadb_10_11_version }}"
44-
stackhpc_repo_rhel_9_influxdb_version: "{{ stackhpc_pulp_repo_rhel_9_influxdb_version }}"
45-
stackhpc_repo_epel_9_version: "{{ stackhpc_pulp_repo_epel_9_version }}"
37+
stackhpc_repo_centos_stream_9_nfv_openvswitch_version: "{{ stackhpc_pulp_repo_multiarch_centos_stream_9_nfv_openvswitch_version }}"
38+
stackhpc_repo_centos_stream_9_openstack_caracal_version: "{{ stackhpc_pulp_repo_multiarch_centos_stream_9_openstack_caracal_version }}"
39+
stackhpc_repo_centos_stream_9_opstools_version: "{{ stackhpc_pulp_repo_multiarch_centos_stream_9_opstools_version }}"
40+
stackhpc_repo_centos_stream_9_storage_ceph_reef_version: "{{ stackhpc_pulp_repo_multiarch_centos_stream_9_storage_ceph_reef_version }}"
41+
stackhpc_repo_centos_stream_9_docker_version: "{{ stackhpc_pulp_repo_multiarch_centos_stream_9_docker_version }}"
42+
stackhpc_repo_rhel_9_treasuredata_5_version: "{{ stackhpc_pulp_repo_multiarch_rhel_9_treasuredata_5_version }}"
43+
stackhpc_repo_rhel_9_mariadb_10_11_version: "{{ stackhpc_pulp_repo_multiarch_rhel_9_mariadb_10_11_version }}"
44+
stackhpc_repo_rhel_9_influxdb_version: "{{ stackhpc_pulp_repo_multiarch_rhel_9_influxdb_version }}"
45+
stackhpc_repo_epel_9_version: "{{ stackhpc_pulp_repo_multiarch_epel_9_version }}"
4646
stackhpc_repo_opensearch_2_x_version: "{{ stackhpc_pulp_repo_opensearch_2_x_version }}"
4747
stackhpc_repo_opensearch_dashboards_2_x_version: "{{ stackhpc_pulp_repo_opensearch_dashboards_2_x_version }}"
4848
## Use derived vars from etc/kayobe/pulp.yml to switch between
@@ -52,9 +52,8 @@ stackhpc_repo_rocky_9_appstream_version: "{{ stackhpc_pulp_repo_rocky_9_appstrea
5252
stackhpc_repo_rocky_9_extras_version: "{{ stackhpc_pulp_repo_rocky_9_extras_version }}"
5353
stackhpc_repo_rocky_9_crb_version: "{{ stackhpc_pulp_repo_rocky_9_crb_version }}"
5454
stackhpc_repo_rocky_9_highavailability_version: "{{ stackhpc_pulp_repo_rocky_9_highavailability_version }}"
55-
stackhpc_repo_rocky_9_sig_security_common_version: "{{ stackhpc_pulp_repo_rocky_9_sig_security_common_version }}"
55+
stackhpc_repo_rocky_9_sig_security_common_version: "{{ stackhpc_pulp_repo_multiarch_rocky_9_sig_security_common_version }}"
5656
stackhpc_repo_rhel9_doca_version: "{{ stackhpc_pulp_repo_rhel9_doca_version }}"
57-
stackhpc_repo_rhel9_doca_modules_version: "{{ stackhpc_pulp_repo_rhel9_doca_modules_version }}"
5857

5958
# Rocky-and-CI-specific Pulp urls
6059
stackhpc_include_os_minor_version_in_repo_url: true

etc/kayobe/environments/ci-builder/stackhpc-ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ stackhpc_repo_mirror_password: !vault |
4949
5050
# Build against released Pulp repository versions.
5151
stackhpc_repo_grafana_version: "{{ stackhpc_pulp_repo_grafana_version }}"
52-
stackhpc_repo_rhel9_rabbitmq_erlang_version: "{{ stackhpc_pulp_repo_rhel9_rabbitmq_erlang_version }}"
52+
stackhpc_repo_rhel9_rabbitmq_erlang_version: "{{ stackhpc_pulp_repo_multiarch_rhel9_rabbitmq_erlang_version }}"
5353
stackhpc_repo_rhel9_rabbitmq_server_version: "{{ stackhpc_pulp_repo_rhel9_rabbitmq_server_version }}"
5454
stackhpc_repo_ubuntu_jammy_version: "{{ stackhpc_pulp_repo_ubuntu_jammy_version }}"
5555
stackhpc_repo_ubuntu_jammy_security_version: "{{ stackhpc_pulp_repo_ubuntu_jammy_security_version }}"
@@ -60,15 +60,15 @@ stackhpc_repo_ubuntu_noble_version: "{{ stackhpc_pulp_repo_ubuntu_noble_version
6060
stackhpc_repo_ubuntu_noble_security_version: "{{ stackhpc_pulp_repo_ubuntu_noble_security_version }}"
6161
stackhpc_repo_docker_ce_ubuntu_noble_version: "{{ stackhpc_pulp_repo_docker_ce_ubuntu_noble_version }}"
6262
stackhpc_repo_ceph_reef_debian_version: "{{ stackhpc_pulp_repo_ceph_reef_debian_version }}"
63-
stackhpc_repo_centos_stream_9_nfv_openvswitch_version: "{{ stackhpc_pulp_repo_centos_stream_9_nfv_openvswitch_version }}"
64-
stackhpc_repo_centos_stream_9_openstack_caracal_version: "{{ stackhpc_pulp_repo_centos_stream_9_openstack_caracal_version }}"
65-
stackhpc_repo_centos_stream_9_opstools_version: "{{ stackhpc_pulp_repo_centos_stream_9_opstools_version }}"
66-
stackhpc_repo_centos_stream_9_storage_ceph_reef_version: "{{ stackhpc_pulp_repo_centos_stream_9_storage_ceph_reef_version }}"
67-
stackhpc_repo_centos_stream_9_docker_version: "{{ stackhpc_pulp_repo_centos_stream_9_docker_version }}"
68-
stackhpc_repo_rhel_9_treasuredata_5_version: "{{ stackhpc_pulp_repo_rhel_9_treasuredata_5_version }}"
69-
stackhpc_repo_rhel_9_mariadb_10_11_version: "{{ stackhpc_pulp_repo_rhel_9_mariadb_10_11_version }}"
70-
stackhpc_repo_rhel_9_influxdb_version: "{{ stackhpc_pulp_repo_rhel_9_influxdb_version }}"
71-
stackhpc_repo_epel_9_version: "{{ stackhpc_pulp_repo_epel_9_version }}"
63+
stackhpc_repo_centos_stream_9_nfv_openvswitch_version: "{{ stackhpc_pulp_repo_multiarch_centos_stream_9_nfv_openvswitch_version }}"
64+
stackhpc_repo_centos_stream_9_openstack_caracal_version: "{{ stackhpc_pulp_repo_multiarch_centos_stream_9_openstack_caracal_version }}"
65+
stackhpc_repo_centos_stream_9_opstools_version: "{{ stackhpc_pulp_repo_multiarch_centos_stream_9_opstools_version }}"
66+
stackhpc_repo_centos_stream_9_storage_ceph_reef_version: "{{ stackhpc_pulp_repo_multiarch_centos_stream_9_storage_ceph_reef_version }}"
67+
stackhpc_repo_centos_stream_9_docker_version: "{{ stackhpc_pulp_repo_multiarch_centos_stream_9_docker_version }}"
68+
stackhpc_repo_rhel_9_treasuredata_5_version: "{{ stackhpc_pulp_repo_multiarch_rhel_9_treasuredata_5_version }}"
69+
stackhpc_repo_rhel_9_mariadb_10_11_version: "{{ stackhpc_pulp_repo_multiarch_rhel_9_mariadb_10_11_version }}"
70+
stackhpc_repo_rhel_9_influxdb_version: "{{ stackhpc_pulp_repo_multiarch_rhel_9_influxdb_version }}"
71+
stackhpc_repo_epel_9_version: "{{ stackhpc_pulp_repo_multiarch_epel_9_version }}"
7272
stackhpc_repo_opensearch_2_x_version: "{{ stackhpc_pulp_repo_opensearch_2_x_version }}"
7373
stackhpc_repo_opensearch_dashboards_2_x_version: "{{ stackhpc_pulp_repo_opensearch_dashboards_2_x_version }}"
7474
## Use derived vars from etc/kayobe/pulp.yml to switch between
@@ -78,7 +78,7 @@ stackhpc_repo_rocky_9_appstream_version: "{{ stackhpc_pulp_repo_rocky_9_appstrea
7878
stackhpc_repo_rocky_9_extras_version: "{{ stackhpc_pulp_repo_rocky_9_extras_version }}"
7979
stackhpc_repo_rocky_9_crb_version: "{{ stackhpc_pulp_repo_rocky_9_crb_version }}"
8080
stackhpc_repo_rocky_9_highavailability_version: "{{ stackhpc_pulp_repo_rocky_9_highavailability_version }}"
81-
stackhpc_repo_rocky_9_sig_security_common_version: "{{ stackhpc_pulp_repo_rocky_9_sig_security_common_version }}"
81+
stackhpc_repo_rocky_9_sig_security_common_version: "{{ stackhpc_pulp_repo_multiarch_rocky_9_sig_security_common_version }}"
8282
stackhpc_repo_rhel9_doca_version: "{{ stackhpc_pulp_repo_rhel9_doca_version }}"
8383

8484
# Rocky-and-CI-specific Pulp urls

0 commit comments

Comments
 (0)