Skip to content

Commit

Permalink
fix: optional check for architecture in bootstrap image-aztec (#11085)
Browse files Browse the repository at this point in the history
Fixes #10957
  • Loading branch information
spypsy authored Jan 7, 2025
1 parent c92129e commit fed44a5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-aztec-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
timeout-minutes: 80
run: |
sudo shutdown -P 80
./bootstrap.sh image-aztec
./bootstrap.sh image-aztec --check-arch
docker tag aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/aztec:${{ env.GIT_COMMIT }}-arm64
docker push aztecprotocol/aztec:${{ env.GIT_COMMIT }}-arm64
build-nargo-x86:
Expand Down
27 changes: 26 additions & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,34 @@ case "$cmd" in
;;
"image-aztec")
image=aztecprotocol/aztec:$(git rev-parse HEAD)
check_arch=false

# Check for --check-arch flag in args
for arg in "$@"; do
if [ "$arg" = "--check-arch" ]; then
check_arch=true
break
fi
done

docker pull $image &>/dev/null || true
if docker_has_image $image; then
exit
if [ "$check_arch" = true ]; then
# Check we're on the correct architecture
image_arch=$(docker inspect $image --format '{{.Architecture}}')
host_arch=$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')

if [ "$image_arch" != "$host_arch" ]; then
echo "Warning: Image architecture ($image_arch) doesn't match host architecture ($host_arch)"
echo "Rebuilding image for correct architecture..."
else
echo "Image $image already exists and has been downloaded with correct architecture." && exit
fi
else
echo "Image $image already exists and has been downloaded." && exit
fi
else
echo "Image $image does not exist, building..."
fi
github_group "image-aztec"
source $ci3/source_tmp
Expand Down

0 comments on commit fed44a5

Please sign in to comment.