@@ -89,15 +89,18 @@ jobs:
89
89
# Dynamically define job matrix.
90
90
# We need a separate matrix entry for each distribution, when the relevant input is true.
91
91
# https://stackoverflow.com/questions/65384420/how-do-i-make-a-github-action-matrix-element-conditional
92
+ # NOTE(bbezak): Both amd64 and aarch64 need to be built in a single workflow to create a multi-architecture manifest.
93
+ # For now include only RL9 in aarch64
92
94
- name : Generate build matrix
93
95
id : set-matrix
94
96
run : |
95
97
output="{'distro': ["
96
98
if [[ ${{ inputs.rocky-linux-9 }} == 'true' ]]; then
97
- output+="{'name': 'rocky', 'release': 9},"
99
+ output+="{'name': 'rocky', 'release': 9, 'arch': 'amd64'},"
100
+ output+="{'name': 'rocky', 'release': 9, 'arch': 'aarch64'},"
98
101
fi
99
102
if [[ ${{ inputs.ubuntu-noble }} == 'true' ]]; then
100
- output+="{'name': 'ubuntu', 'release': 'noble'},"
103
+ output+="{'name': 'ubuntu', 'release': 'noble', 'arch': 'amd64' },"
101
104
fi
102
105
# remove trailing comma
103
106
output="${output%,}"
@@ -116,7 +119,9 @@ jobs:
116
119
container-image-build :
117
120
name : Build Kolla container images
118
121
if : github.repository == 'stackhpc/stackhpc-kayobe-config'
119
- runs-on : ${{ needs.runner-selection.outputs.runner_name_container_image_build }}
122
+ runs-on : ${{ matrix.distro.arch == 'aarch64'
123
+ && fromJson('["self-hosted","sms","arm64"]')
124
+ || needs.runner-selection.outputs.runner_name_container_image_build }}
120
125
timeout-minutes : 720
121
126
permissions : {}
122
127
strategy :
@@ -126,19 +131,14 @@ jobs:
126
131
- generate-tag
127
132
- runner-selection
128
133
steps :
134
+ - name : Purge workspace
135
+ run : sudo rm -rf "$GITHUB_WORKSPACE"/*
136
+
129
137
- name : Install package dependencies
130
138
run : |
131
139
sudo apt update
132
140
sudo apt install -y build-essential git unzip nodejs python3-wheel python3-pip python3-venv curl jq wget
133
141
134
- - name : Install gh
135
- run : |
136
- 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
137
- sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
138
- 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
139
- sudo apt update
140
- sudo apt install gh -y
141
-
142
142
- name : Checkout
143
143
uses : actions/checkout@v4
144
144
with :
@@ -154,7 +154,8 @@ jobs:
154
154
155
155
- name : Install yq
156
156
run : |
157
- 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
157
+ ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
158
+ 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
158
159
159
160
- name : Install Kayobe
160
161
run : |
@@ -203,19 +204,28 @@ jobs:
203
204
continue-on-error : true
204
205
run : |
205
206
args="${{ inputs.regexes }}"
207
+ if [[ "${{ matrix.distro.arch }}" == 'aarch64' ]]; then
208
+ args="$args -e kolla_base_arch=${{ matrix.distro.arch }}"
209
+ fi
206
210
args="$args -e kolla_base_distro=${{ matrix.distro.name }}"
207
211
args="$args -e kolla_base_distro_version=${{ matrix.distro.release }}"
208
- args="$args -e kolla_tag=${{ steps.write-kolla-tag.outputs.kolla-tag }}"
212
+ if [[ "${{ matrix.distro.name }}" == 'rocky' ]]; then
213
+ args="$args -e kolla_tag=${{ steps.write-kolla-tag.outputs.kolla-tag }}-${{ matrix.distro.arch }}"
214
+ else
215
+ args="$args -e kolla_tag=${{ steps.write-kolla-tag.outputs.kolla-tag }}"
216
+ fi
209
217
args="$args -e stackhpc_repo_mirror_auth_proxy_enabled=true"
218
+ args="$args -e kolla_build_log_path=$GITHUB_WORKSPACE/image-build-logs/kolla-build-overcloud.log"
219
+ args="$args -e base_path=$GITHUB_WORKSPACE/opt/kayobe"
210
220
source venvs/kayobe/bin/activate &&
211
221
source src/kayobe-config/kayobe-env --environment ci-builder &&
212
222
kayobe overcloud container image build $args
213
223
env :
214
224
KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
215
225
if : inputs.overcloud
216
226
217
- - name : Copy overcloud container image build logs to output directory
218
- run : sudo mv /var/log/ kolla-build.log image-build-logs/kolla-build-overcloud.log
227
+ - name : Copy build configs to output directory
228
+ run : sudo cp -rnL "$GITHUB_WORKSPACE/opt/kayobe/etc/ kolla/"* image-build-logs/
219
229
if : inputs.overcloud
220
230
221
231
- name : Build kolla seed images
@@ -231,14 +241,14 @@ jobs:
231
241
kayobe seed container image build $args
232
242
env :
233
243
KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
234
- if : inputs.seed
244
+ if : inputs.seed && matrix.distro.arch == 'amd64'
235
245
236
246
- name : Copy seed container image build logs to output directory
237
247
run : sudo mv /var/log/kolla-build.log image-build-logs/kolla-build-seed.log
238
- if : inputs.seed
248
+ if : inputs.seed && matrix.distro.arch == 'amd64'
239
249
240
250
- name : Get built container images
241
- 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
251
+ 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
242
252
243
253
- name : Fail if no images have been built
244
254
run : if [ $(wc -l < ${{ matrix.distro.name }}-${{ matrix.distro.release }}-container-images) -le 1 ]; then exit 1; fi
@@ -299,7 +309,7 @@ jobs:
299
309
- name : Upload output artifact
300
310
uses : actions/upload-artifact@v4
301
311
with :
302
- name : ${{ matrix.distro.name }}-${{ matrix.distro.release }}-logs
312
+ name : ${{ matrix.distro.name }}-${{ matrix.distro.release }}-${{ matrix.distro.arch }}- logs
303
313
path : image-build-logs
304
314
retention-days : 7
305
315
if : ${{ !cancelled() }}
@@ -323,6 +333,64 @@ jobs:
323
333
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
324
334
if : ${{ !inputs.push-dirty && !cancelled() }}
325
335
336
+ - name : Remove locally built images for this run
337
+ if : always() && runner.arch == 'ARM64'
338
+ run : |
339
+ docker images --format '{{.Repository}}:{{.Tag}}' \
340
+ --filter "reference=ark.stackhpc.com/stackhpc-dev/*:${{ steps.write-kolla-tag.outputs.kolla-tag }}*" \
341
+ | xargs -r -n1 docker rmi -f
342
+
343
+ create-manifests :
344
+ # Only for Rocky Linux for now
345
+ name : Create Multiarch Docker Manifests
346
+ if : github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && inputs.rocky-linux-9
347
+ runs-on : ${{ needs.runner-selection.outputs.runner_name_container_image_build }}
348
+ permissions : {}
349
+ needs :
350
+ - container-image-build
351
+ - runner-selection
352
+ steps :
353
+ - name : Download artifacts
354
+ uses : actions/download-artifact@v4
355
+
356
+ - name : Combine pushed images lists
357
+ run : |
358
+ find . -name 'push-attempt-images.txt' -exec cat {} + > all-pushed-images.txt
359
+
360
+ - name : Log in to container registry
361
+ uses : docker/login-action@v3
362
+ with :
363
+ registry : ark.stackhpc.com
364
+ username : ${{ secrets.RLS_TRAIN_CI_ARK_REGISTRY_USER }}
365
+ password : ${{ secrets.RLS_TRAIN_CI_ARK_REGISTRY_PASS }}
366
+
367
+ - name : Checkout
368
+ uses : actions/checkout@v4
369
+ with :
370
+ path : src/kayobe-config
371
+
372
+ - name : Create and push Docker manifests
373
+ run : src/kayobe-config/tools/multiarch-manifests.sh
374
+
375
+ - name : Upload manifest logs
376
+ uses : actions/upload-artifact@v4
377
+ with :
378
+ name : manifest-logs
379
+ path : |
380
+ all-pushed-images.txt
381
+ logs/manifest-creation.log
382
+ retention-days : 7
383
+ if : ${{ !cancelled() }}
384
+
385
+ trigger-image-sync :
386
+ name : Trigger container image repository sync
387
+ needs :
388
+ - container-image-build
389
+ - create-manifests
390
+ if : github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled()
391
+ runs-on : ubuntu-latest
392
+ permissions : {}
393
+ steps :
326
394
# NOTE(mgoddard): Trigger another CI workflow in the
327
395
# stackhpc-release-train repository.
328
396
- name : Trigger container image repository sync
@@ -339,9 +407,7 @@ jobs:
339
407
-f sync-old-images=false
340
408
env :
341
409
GITHUB_TOKEN : ${{ secrets.STACKHPC_RELEASE_TRAIN_TOKEN }}
342
- if : ${{ github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled() }}
343
410
344
411
- name : Display link to container image repository sync workflows
345
412
run : |
346
413
echo "::notice Container image repository sync workflows: https://github.com/stackhpc/stackhpc-release-train/actions/workflows/container-sync.yml"
347
- if : ${{ github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled() }}
0 commit comments