@@ -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 &&
@@ -320,6 +317,96 @@ 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
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 : Download artifacts
363
+ uses : actions/download-artifact@v4
364
+
365
+ - name : Combine pushed images lists
366
+ run : |
367
+ find . -name 'push-attempt-images.txt' -exec cat {} + > all-pushed-images.txt
368
+
369
+ - name : Log in to Docker registry
370
+ run : |
371
+ source venvs/kayobe/bin/activate &&
372
+ source src/kayobe-config/kayobe-env --environment ci-builder &&
373
+ kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/docker-registry-login.yml
374
+ env :
375
+ KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
376
+
377
+ - name : Create and Push Docker Manifests
378
+ run : |
379
+ set -ex
380
+ mkdir -p logs
381
+ images=$(cat all-pushed-images.txt | sort | uniq)
382
+ # Filter out Ubuntu images
383
+ manifest_images=$(echo "$images" | grep 'rocky' | sed -E 's/-(amd64|aarch64)$//' | sort | uniq)
384
+ for base_image in $manifest_images; do
385
+ arch_images=""
386
+ for arch in amd64 aarch64; do
387
+ arch_image="${base_image}-${arch}"
388
+ # Check if the image exists in the registry
389
+ if docker manifest inspect "$arch_image" > /dev/null 2>&1; then
390
+ arch_images="$arch_images $arch_image"
391
+ fi
392
+ done
393
+ if [ -n "$arch_images" ]; then
394
+ echo "Creating manifest for $base_image with images:$arch_images" | tee -a logs/manifest-creation.log
395
+ docker manifest create "$base_image" $arch_images | tee -a logs/manifest-creation.log
396
+ docker manifest push "$base_image" | tee -a logs/manifest-creation.log
397
+ else
398
+ echo "No images found for $base_image, skipping." | tee -a logs/manifest-creation.log
399
+ fi
400
+ done
401
+
402
+ - name : Upload manifest logs
403
+ uses : actions/upload-artifact@v4
404
+ with :
405
+ name : manifest-logs
406
+ path : |
407
+ all-pushed-images.txt
408
+ logs/manifest-creation.log
409
+
323
410
# NOTE(mgoddard): Trigger another CI workflow in the
324
411
# stackhpc-release-train repository.
325
412
- name : Trigger container image repository sync
0 commit comments