@@ -89,15 +89,18 @@ jobs:
8989 # Dynamically define job matrix.
9090 # We need a separate matrix entry for each distribution, when the relevant input is true.
9191 # 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
9294 - name : Generate build matrix
9395 id : set-matrix
9496 run : |
9597 output="{'distro': ["
9698 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'},"
98101 fi
99102 if [[ ${{ inputs.ubuntu-noble }} == 'true' ]]; then
100- output+="{'name': 'ubuntu', 'release': 'noble'},"
103+ output+="{'name': 'ubuntu', 'release': 'noble', 'arch': 'amd64' },"
101104 fi
102105 # remove trailing comma
103106 output="${output%,}"
@@ -116,7 +119,9 @@ jobs:
116119 container-image-build :
117120 name : Build Kolla container images
118121 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 }}
120125 timeout-minutes : 720
121126 permissions : {}
122127 strategy :
@@ -126,19 +131,14 @@ jobs:
126131 - generate-tag
127132 - runner-selection
128133 steps :
134+ - name : Purge workspace
135+ run : sudo rm -rf "$GITHUB_WORKSPACE"/*
136+
129137 - name : Install package dependencies
130138 run : |
131139 sudo apt update
132140 sudo apt install -y build-essential git unzip nodejs python3-wheel python3-pip python3-venv curl jq wget
133141
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-
142142 - name : Checkout
143143 uses : actions/checkout@v4
144144 with :
@@ -154,7 +154,8 @@ jobs:
154154
155155 - name : Install yq
156156 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
158159
159160 - name : Install Kayobe
160161 run : |
@@ -203,19 +204,28 @@ jobs:
203204 continue-on-error : true
204205 run : |
205206 args="${{ inputs.regexes }}"
207+ if [[ "${{ matrix.distro.arch }}" == 'aarch64' ]]; then
208+ args="$args -e kolla_base_arch=${{ matrix.distro.arch }}"
209+ fi
206210 args="$args -e kolla_base_distro=${{ matrix.distro.name }}"
207211 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
209217 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"
210220 source venvs/kayobe/bin/activate &&
211221 source src/kayobe-config/kayobe-env --environment ci-builder &&
212222 kayobe overcloud container image build $args
213223 env :
214224 KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
215225 if : inputs.overcloud
216226
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/
219229 if : inputs.overcloud
220230
221231 - name : Build kolla seed images
@@ -231,14 +241,14 @@ jobs:
231241 kayobe seed container image build $args
232242 env :
233243 KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
234- if : inputs.seed
244+ if : inputs.seed && matrix.distro.arch == 'amd64'
235245
236246 - name : Copy seed container image build logs to output directory
237247 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'
239249
240250 - 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
242252
243253 - name : Fail if no images have been built
244254 run : if [ $(wc -l < ${{ matrix.distro.name }}-${{ matrix.distro.release }}-container-images) -le 1 ]; then exit 1; fi
@@ -299,7 +309,7 @@ jobs:
299309 - name : Upload output artifact
300310 uses : actions/upload-artifact@v4
301311 with :
302- name : ${{ matrix.distro.name }}-${{ matrix.distro.release }}-logs
312+ name : ${{ matrix.distro.name }}-${{ matrix.distro.release }}-${{ matrix.distro.arch }}- logs
303313 path : image-build-logs
304314 retention-days : 7
305315 if : ${{ !cancelled() }}
@@ -323,6 +333,64 @@ jobs:
323333 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
324334 if : ${{ !inputs.push-dirty && !cancelled() }}
325335
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 :
326394 # NOTE(mgoddard): Trigger another CI workflow in the
327395 # stackhpc-release-train repository.
328396 - name : Trigger container image repository sync
@@ -339,9 +407,7 @@ jobs:
339407 -f sync-old-images=false
340408 env :
341409 GITHUB_TOKEN : ${{ secrets.STACKHPC_RELEASE_TRAIN_TOKEN }}
342- if : ${{ github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push && !cancelled() }}
343410
344411 - name : Display link to container image repository sync workflows
345412 run : |
346413 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