Skip to content

Commit

Permalink
enable jobs retry & multi-arch builds of succeeding image variants
Browse files Browse the repository at this point in the history
  • Loading branch information
AyodeAwe committed Aug 4, 2024
1 parent d240fc3 commit b4072ef
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/build-test-publish-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ jobs:
py${{ matrix.PYTHON_VER }}-\
${{ matrix.ARCH }}"
build-multiarch-manifest:
if: inputs.build_type == 'branch'
if: inputs.build_type == 'branch' && needs.build.result != 'cancelled'
needs: [build, compute-matrix]
strategy:
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -263,11 +264,33 @@ jobs:
)
raft_ann_bench_cpu_tag="$(printf %s "${raft_ann_bench_cpu_tag_array[@]}" $'\n')" # Converts array to string w/o spaces
check_tag_exists() {
local tag="$1"
local exists
exists=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: JWT $HUB_TOKEN" \
"https://hub.docker.com/v2/repositories/${tag}/")
if [ "$exists" -ne 200 ]; then
echo "Error: Required image tag ${tag} does not exist."
exit 1
fi
}
# Check if all source tags exist and add to source tags array
for arch in $(echo '${{ toJSON(matrix.ARCHES) }}' | jq .[] -r); do
check_tag_exists "${base_tag}-${arch}"
base_source_tags+=("${base_tag}-${arch}")
check_tag_exists "${notebooks_tag}-${arch}"
notebooks_source_tags+=("${notebooks_tag}-${arch}")
check_tag_exists "${raft_ann_bench_tag}-${arch}"
raft_ann_bench_source_tags+=("${raft_ann_bench_tag}-${arch}")
check_tag_exists "${raft_ann_bench_datasets_tag}-${arch}"
raft_ann_bench_datasets_source_tags+=("${raft_ann_bench_datasets_tag}-${arch}")
check_tag_exists "${raft_ann_bench_cpu_tag}-${arch}"
raft_ann_bench_cpu_source_tags+=("${raft_ann_bench_cpu_tag}-${arch}")
done
Expand All @@ -282,7 +305,6 @@ jobs:
docker manifest create ${raft_ann_bench_cpu_tag} ${raft_ann_bench_cpu_source_tags[@]}
docker manifest push ${raft_ann_bench_cpu_tag}
delete-temp-images:
if: always()
needs: [compute-matrix, build, test, build-multiarch-manifest]
strategy:
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
Expand Down

0 comments on commit b4072ef

Please sign in to comment.