@@ -94,18 +94,21 @@ jobs:
94
94
# Dynamically define job matrix.
95
95
# We need a separate matrix entry for each distribution, when the relevant input is true.
96
96
# 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
97
99
- name : Generate build matrix
98
100
id : set-matrix
99
101
run : |
100
102
output="{'distro': ["
101
103
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'},"
103
106
fi
104
107
if [[ ${{ inputs.ubuntu-jammy }} == 'true' ]]; then
105
- output+="{'name': 'ubuntu', 'release': 'jammy'},"
108
+ output+="{'name': 'ubuntu', 'release': 'jammy', 'arch': 'amd64' },"
106
109
fi
107
110
if [[ ${{ inputs.ubuntu-noble }} == 'true' ]]; then
108
- output+="{'name': 'ubuntu', 'release': 'noble'},"
111
+ output+="{'name': 'ubuntu', 'release': 'noble', 'arch': 'amd64' },"
109
112
fi
110
113
# remove trailing comma
111
114
output="${output%,}"
@@ -124,7 +127,9 @@ jobs:
124
127
container-image-build :
125
128
name : Build Kolla container images
126
129
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 }}
128
133
timeout-minutes : 720
129
134
permissions : {}
130
135
strategy :
@@ -134,19 +139,14 @@ jobs:
134
139
- generate-tag
135
140
- runner-selection
136
141
steps :
142
+ - name : Purge workspace
143
+ run : sudo rm -rf "$GITHUB_WORKSPACE"/*
144
+
137
145
- name : Install package dependencies
138
146
run : |
139
147
sudo apt update
140
148
sudo apt install -y build-essential git unzip nodejs python3-wheel python3-pip python3-venv curl jq wget
141
149
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
-
150
150
- name : Checkout
151
151
uses : actions/checkout@v4
152
152
with :
@@ -162,7 +162,8 @@ jobs:
162
162
163
163
- name : Install yq
164
164
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
166
167
167
168
- name : Install Kayobe
168
169
run : |
@@ -211,19 +212,28 @@ jobs:
211
212
continue-on-error : true
212
213
run : |
213
214
args="${{ inputs.regexes }}"
215
+ if [[ "${{ matrix.distro.arch }}" == 'aarch64' ]]; then
216
+ args="$args -e kolla_base_arch=${{ matrix.distro.arch }}"
217
+ fi
214
218
args="$args -e kolla_base_distro=${{ matrix.distro.name }}"
215
219
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
217
225
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"
218
228
source venvs/kayobe/bin/activate &&
219
229
source src/kayobe-config/kayobe-env --environment ci-builder &&
220
230
kayobe overcloud container image build $args
221
231
env :
222
232
KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
223
233
if : inputs.overcloud
224
234
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/
227
237
if : inputs.overcloud
228
238
229
239
- name : Build kolla seed images
@@ -239,14 +249,14 @@ jobs:
239
249
kayobe seed container image build $args
240
250
env :
241
251
KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
242
- if : inputs.seed
252
+ if : inputs.seed && matrix.distro.arch == 'amd64'
243
253
244
254
- name : Copy seed container image build logs to output directory
245
255
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'
247
257
248
258
- 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
250
260
251
261
- name : Fail if no images have been built
252
262
run : if [ $(wc -l < ${{ matrix.distro.name }}-${{ matrix.distro.release }}-container-images) -le 1 ]; then exit 1; fi
@@ -307,7 +317,7 @@ jobs:
307
317
- name : Upload output artifact
308
318
uses : actions/upload-artifact@v4
309
319
with :
310
- name : ${{ matrix.distro.name }}-${{ matrix.distro.release }}-logs
320
+ name : ${{ matrix.distro.name }}-${{ matrix.distro.release }}-${{ matrix.distro.arch }}- logs
311
321
path : image-build-logs
312
322
retention-days : 7
313
323
if : ${{ !cancelled() }}
@@ -331,6 +341,64 @@ jobs:
331
341
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
332
342
if : ${{ !inputs.push-dirty && !cancelled() }}
333
343
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 :
334
402
# NOTE(mgoddard): Trigger another CI workflow in the
335
403
# stackhpc-release-train repository.
336
404
- name : Trigger container image repository sync
@@ -347,9 +415,7 @@ jobs:
347
415
-f sync-old-images=false
348
416
env :
349
417
GITHUB_TOKEN : ${{ secrets.STACKHPC_RELEASE_TRAIN_TOKEN }}
350
- if : ${{ github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled() }}
351
418
352
419
- name : Display link to container image repository sync workflows
353
420
run : |
354
421
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() }}
0 commit comments