@@ -71,20 +71,21 @@ jobs:
7171 # Dynamically define job matrix.
7272 # We need a separate matrix entry for each distribution, when the relevant input is true.
7373 # https://stackoverflow.com/questions/65384420/how-do-i-make-a-github-action-matrix-element-conditional
74+ # For now include only RL9 in aarch64
7475 - name : Generate build matrix
7576 id : set-matrix
7677 run : |
77- echo -n "matrix={\"distro \": [" >> $GITHUB_OUTPUT
78+ echo -n "matrix={\"include \": [" >> $GITHUB_OUTPUT
7879 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
8182 comma=", "
83+ echo -n "$comma{\"distro\": \"rocky\", \"arch\": \"aarch64\"}" >> $GITHUB_OUTPUT
8284 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
8687 fi
87- echo "], \"arch\": [\"amd64\", \"aarch64\"] }" >> $GITHUB_OUTPUT
88+ echo "]}" >> $GITHUB_OUTPUT
8889
8990 - name : Display container datetime tag
9091 run : |
@@ -99,10 +100,6 @@ jobs:
99100 strategy :
100101 fail-fast : false
101102 matrix : ${{ fromJson(needs.generate-tag.outputs.matrix) }}
102- # Exclude ubuntu aarch64 builds for now
103- exclude :
104- - distro : ubuntu
105- arch : aarch64
106103 needs :
107104 - generate-tag
108105 steps :
@@ -192,7 +189,7 @@ jobs:
192189 args="$args -e kolla_base_arch=${{ matrix.arch }}"
193190 fi
194191 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 }}"
196193 args="$args -e stackhpc_repo_mirror_auth_proxy_enabled=true"
197194 source venvs/kayobe/bin/activate &&
198195 source src/kayobe-config/kayobe-env --environment ci-builder &&
@@ -320,6 +317,97 @@ jobs:
320317 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
321318 if : ${{ !inputs.push-dirty && !cancelled() }}
322319
320+ create-manifests :
321+ # Only for Rocky Linux for now
322+ name : Create Docker Manifests
323+ if : github.repository == 'stackhpc/stackhpc-kayobe-config'
324+ if : ${{ inputs.push }}
325+ runs-on : arc-skc-container-image-builder-runner
326+ permissions : {}
327+ needs :
328+ - container-image-build
329+ steps :
330+ - name : Install package dependencies
331+ run : |
332+ sudo apt update
333+ sudo apt install -y git unzip python3-wheel python3-pip python3-venv curl jq wget
334+
335+ - name : Install gh
336+ run : |
337+ 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
338+ sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
339+ 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
340+ sudo apt update
341+ sudo apt install gh -y
342+
343+ - name : Checkout Kayobe Config
344+ uses : actions/checkout@v4
345+ with :
346+ path : src/kayobe-config
347+
348+ - name : Install Kayobe
349+ run : |
350+ mkdir -p venvs &&
351+ pushd venvs &&
352+ python3 -m venv kayobe &&
353+ source kayobe/bin/activate &&
354+ pip install -U pip &&
355+ pip install -r ../src/kayobe-config/requirements.txt
356+
357+ # Required for Pulp auth proxy deployment and Docker registry login.
358+ # Normally installed during host configure.
359+ - name : Install Docker Python SDK
360+ run : |
361+ sudo pip install docker
362+
363+ - name : Download artifacts
364+ uses : actions/download-artifact@v4
365+
366+ - name : Combine pushed images lists
367+ run : |
368+ find . -name 'push-attempt-images.txt' -exec cat {} + > all-pushed-images.txt
369+
370+ - name : Log in to Docker registry
371+ run : |
372+ source venvs/kayobe/bin/activate &&
373+ source src/kayobe-config/kayobe-env --environment ci-builder &&
374+ kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/docker-registry-login.yml
375+ env :
376+ KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
377+
378+ - name : Create and Push Docker Manifests
379+ run : |
380+ set -ex
381+ mkdir -p logs
382+ images=$(cat all-pushed-images.txt | sort | uniq)
383+ # Filter out Ubuntu images
384+ manifest_images=$(echo "$images" | grep 'rocky' | sed -E 's/-(amd64|aarch64)$//' | sort | uniq)
385+ for base_image in $manifest_images; do
386+ arch_images=""
387+ for arch in amd64 aarch64; do
388+ arch_image="${base_image}-${arch}"
389+ # Check if the image exists in the registry
390+ if docker manifest inspect "$arch_image" > /dev/null 2>&1; then
391+ arch_images="$arch_images $arch_image"
392+ fi
393+ done
394+ if [ -n "$arch_images" ]; then
395+ echo "Creating manifest for $base_image with images:$arch_images" | tee -a logs/manifest-creation.log
396+ docker manifest create "$base_image" $arch_images | tee -a logs/manifest-creation.log
397+ docker manifest push "$base_image" | tee -a logs/manifest-creation.log
398+ else
399+ echo "No images found for $base_image, skipping." | tee -a logs/manifest-creation.log
400+ fi
401+ done
402+
403+ - name : Upload manifest logs
404+ uses : actions/upload-artifact@v4
405+ with :
406+ name : manifest-logs
407+ path : |
408+ all-pushed-images.txt
409+ logs/manifest-creation.log
410+
323411 # NOTE(mgoddard): Trigger another CI workflow in the
324412 # stackhpc-release-train repository.
325413 - name : Trigger container image repository sync
0 commit comments