From 73c2ab436be379d3d347db93f7febcb08db8568c Mon Sep 17 00:00:00 2001 From: spypsy Date: Tue, 7 Jan 2025 12:57:42 +0000 Subject: [PATCH 1/3] fix: optional check for architecture in bootstrap image-aztec --- bootstrap.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index e0e4a070cd21..e0aa46263987 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -201,9 +201,32 @@ 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 fi github_group "image-aztec" source $ci3/source_tmp From ff35267a0bf3fed630558ba166cb6e5030e381c2 Mon Sep 17 00:00:00 2001 From: spypsy Date: Tue, 7 Jan 2025 13:03:25 +0000 Subject: [PATCH 2/3] log when building image --- bootstrap.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index e0aa46263987..9e59b1de6f99 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -227,6 +227,8 @@ case "$cmd" in 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 From 4441a8334f3d1e45a42c07b149084a0b0582ffa7 Mon Sep 17 00:00:00 2001 From: spypsy Date: Tue, 7 Jan 2025 13:07:27 +0000 Subject: [PATCH 3/3] use --check-arch in publish CI --- .github/workflows/publish-aztec-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-aztec-packages.yml b/.github/workflows/publish-aztec-packages.yml index 0f1549677aad..1cee8c76a1b3 100644 --- a/.github/workflows/publish-aztec-packages.yml +++ b/.github/workflows/publish-aztec-packages.yml @@ -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: