@@ -71,20 +71,21 @@ jobs:
71
71
# Dynamically define job matrix.
72
72
# We need a separate matrix entry for each distribution, when the relevant input is true.
73
73
# https://stackoverflow.com/questions/65384420/how-do-i-make-a-github-action-matrix-element-conditional
74
+ # For now include only RL9 in aarch64
74
75
- name : Generate build matrix
75
76
id : set-matrix
76
77
run : |
77
- echo -n "matrix={\"distro \": [" >> $GITHUB_OUTPUT
78
+ echo -n "matrix={\"include \": [" >> $GITHUB_OUTPUT
78
79
comma=""
79
- if [[ ${{ inputs.rocky-linux-9 }} == 'true' ]]; then
80
- echo -n "$comma\" rocky\"" >> $GITHUB_OUTPUT
80
+ if [[ ' ${{ inputs.rocky-linux-9 }}' == 'true' ]]; then
81
+ echo -n "$comma{\"distro\": \" rocky\", \"arch\": \"amd64\"} " >> $GITHUB_OUTPUT
81
82
comma=", "
83
+ echo -n "$comma{\"distro\": \"rocky\", \"arch\": \"aarch64\"}" >> $GITHUB_OUTPUT
82
84
fi
83
- if [[ ${{ inputs.ubuntu-jammy }} == 'true' ]]; then
84
- echo -n "$comma\"ubuntu\"" >> $GITHUB_OUTPUT
85
- comma=", "
85
+ if [[ '${{ inputs.ubuntu-jammy }}' == 'true' ]]; then
86
+ echo -n "$comma{\"distro\": \"ubuntu\", \"arch\": \"amd64\"}" >> $GITHUB_OUTPUT
86
87
fi
87
- echo "], \"arch\": [\"amd64\", \"aarch64\"] }" >> $GITHUB_OUTPUT
88
+ echo "]}" >> $GITHUB_OUTPUT
88
89
89
90
- name : Display container datetime tag
90
91
run : |
@@ -99,10 +100,6 @@ jobs:
99
100
strategy :
100
101
fail-fast : false
101
102
matrix : ${{ fromJson(needs.generate-tag.outputs.matrix) }}
102
- # Exclude ubuntu aarch64 builds for now
103
- exclude :
104
- - distro : ubuntu
105
- arch : aarch64
106
103
needs :
107
104
- generate-tag
108
105
steps :
@@ -192,7 +189,7 @@ jobs:
192
189
args="$args -e kolla_base_arch=${{ matrix.arch }}"
193
190
fi
194
191
args="$args -e kolla_base_distro=${{ matrix.distro }}"
195
- args="$args -e kolla_tag=${{ steps.write-kolla-tag.outputs.kolla-tag }}
192
+ args="$args -e kolla_tag=${{ steps.write-kolla-tag.outputs.kolla-tag }}"
196
193
args="$args -e stackhpc_repo_mirror_auth_proxy_enabled=true"
197
194
source venvs/kayobe/bin/activate &&
198
195
source src/kayobe-config/kayobe-env --environment ci-builder &&
@@ -232,7 +229,7 @@ jobs:
232
229
233
230
- name : Copy seed container image build logs to output directory
234
231
run : sudo mv /var/log/kolla-build.log image-build-logs/kolla-build-seed.log
235
- if : inputs.seed
232
+ if : inputs.seed && matrix.arch == 'amd64'
236
233
237
234
- name : Get built container images
238
235
run : docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:${{ steps.write-kolla-tag.outputs.kolla-tag }}*" > ${{ matrix.distro }}-container-images
@@ -320,6 +317,116 @@ jobs:
320
317
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
321
318
if : ${{ !inputs.push-dirty && !cancelled() }}
322
319
320
+ create-manifests :
321
+ # Only for Rocky Linux for now
322
+ name : Create Docker Manifests
323
+ if : github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push
324
+ runs-on : arc-skc-container-image-builder-runner
325
+ permissions : {}
326
+ needs :
327
+ - container-image-build
328
+ steps :
329
+ - name : Install package dependencies
330
+ run : |
331
+ sudo apt update
332
+ sudo apt install -y git unzip python3-wheel python3-pip python3-venv curl jq wget openssh-server openssh-client
333
+
334
+ - name : Install gh
335
+ run : |
336
+ 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
337
+ sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
338
+ 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
339
+ sudo apt update
340
+ sudo apt install gh -y
341
+
342
+ - name : Checkout Kayobe Config
343
+ uses : actions/checkout@v4
344
+ with :
345
+ path : src/kayobe-config
346
+
347
+ - name : Install Kayobe
348
+ run : |
349
+ mkdir -p venvs &&
350
+ pushd venvs &&
351
+ python3 -m venv kayobe &&
352
+ source kayobe/bin/activate &&
353
+ pip install -U pip &&
354
+ pip install -r ../src/kayobe-config/requirements.txt
355
+
356
+ # Required for Pulp auth proxy deployment and Docker registry login.
357
+ # Normally installed during host configure.
358
+ - name : Install Docker Python SDK
359
+ run : |
360
+ sudo pip install docker
361
+
362
+ - name : Configure localhost as a seed
363
+ run : |
364
+ cat > src/kayobe-config/etc/kayobe/environments/ci-builder/inventory/hosts << EOF
365
+ # A 'seed' host used for building images.
366
+ # Use localhost for container image builds.
367
+ [seed]
368
+ localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python3
369
+ EOF
370
+
371
+ # See etc/kayobe/ansible/roles/pulp_auth_proxy/README.md for details.
372
+ # NOTE: We override pulp_auth_proxy_conf_path to a path shared by the
373
+ # runner and dind containers.
374
+ - name : Deploy an authenticating package repository mirror proxy
375
+ run : |
376
+ source venvs/kayobe/bin/activate &&
377
+ source src/kayobe-config/kayobe-env --environment ci-builder &&
378
+ kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/pulp-auth-proxy.yml -e pulp_auth_proxy_conf_path=/home/runner/_work/pulp_proxy
379
+ env :
380
+ KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
381
+
382
+ - name : Download artifacts
383
+ uses : actions/download-artifact@v4
384
+
385
+ - name : Combine pushed images lists
386
+ run : |
387
+ find . -name 'push-attempt-images.txt' -exec cat {} + > all-pushed-images.txt
388
+
389
+ - name : Log in to Docker registry
390
+ run : |
391
+ source venvs/kayobe/bin/activate &&
392
+ source src/kayobe-config/kayobe-env --environment ci-builder &&
393
+ kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/docker-registry-login.yml
394
+ env :
395
+ KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
396
+
397
+ - name : Create and Push Docker Manifests
398
+ run : |
399
+ set -ex
400
+ mkdir -p logs
401
+ images=$(cat all-pushed-images.txt | sort | uniq)
402
+ # Filter out Ubuntu images
403
+ manifest_images=$(echo "$images" | grep 'rocky' | sed -E 's/-(amd64|aarch64)$//' | sort | uniq)
404
+ for base_image in $manifest_images; do
405
+ arch_images=""
406
+ for arch in amd64 aarch64; do
407
+ arch_image="${base_image}-${arch}"
408
+ # Check if the image exists in the registry
409
+ if docker manifest inspect "$arch_image" > /dev/null 2>&1; then
410
+ arch_images="$arch_images $arch_image"
411
+ fi
412
+ done
413
+ if [ -n "$arch_images" ]; then
414
+ echo "Creating manifest for $base_image with images:$arch_images" | tee -a logs/manifest-creation.log
415
+ docker manifest create "$base_image" $arch_images | tee -a logs/manifest-creation.log
416
+ docker manifest push "$base_image" | tee -a logs/manifest-creation.log
417
+ else
418
+ echo "No images found for $base_image, skipping." | tee -a logs/manifest-creation.log
419
+ fi
420
+ done
421
+
422
+ - name : Upload manifest logs
423
+ uses : actions/upload-artifact@v4
424
+ with :
425
+ name : manifest-logs
426
+ path : |
427
+ all-pushed-images.txt
428
+ logs/manifest-creation.log
429
+
323
430
# NOTE(mgoddard): Trigger another CI workflow in the
324
431
# stackhpc-release-train repository.
325
432
- name : Trigger container image repository sync
0 commit comments