From 3f5d380f72d5ae819b2718ef9fbdfaec6b9a0e4d Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 13 Jun 2024 17:04:09 +0100 Subject: [PATCH] fix: AVM / aztec-up CircleCI issues (#7045) --- .circleci/config.yml | 52 ++++++++++++++++++++++----- avm-transpiler/src/main.rs | 4 +-- build-system/scripts/deploy_terraform | 2 ++ build_manifest.yml | 2 ++ 4 files changed, 49 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4583d493678..8c3765900aa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -231,7 +231,7 @@ jobs: command: cond_spot_run_build noir-packages 32 aztec_manifest_key: noir-packages - avm-transpiler: + avm-transpiler-x86_64: docker: - image: aztecprotocol/alpine-build-image resource_class: small @@ -243,7 +243,7 @@ jobs: command: cond_spot_run_build avm-transpiler 32 aztec_manifest_key: avm-transpiler - aztec-nargo: + avm-transpiler-arm64: docker: - image: aztecprotocol/alpine-build-image resource_class: small @@ -252,7 +252,31 @@ jobs: - *setup_env - run: name: "Build" - command: cond_spot_run_build aztec-nargo 32 + command: cond_spot_run_build avm-transpiler 32 arm64 + aztec_manifest_key: avm-transpiler + + avm-transpiler-ecr-manifest: + machine: + image: default + resource_class: medium + steps: + - *checkout + - *setup_env + - run: + name: "Create ECR manifest" + command: create_ecr_manifest avm-transpiler x86_64,arm64 + aztec_manifest_key: avm-transpiler + + aztec-nargo: + machine: + image: default + resource_class: small + steps: + - *checkout + - *setup_env + - run: + name: "Build image" + command: build aztec-nargo aztec_manifest_key: aztec-nargo l1-contracts: @@ -429,8 +453,9 @@ jobs: - run: name: "Update aztec-up" command: | - should_release || exit 0 - deploy_terraform "" aztec-up/terraform + if [ -n "$COMMIT_TAG" ]; then + deploy_terraform "" aztec-up/terraform + fi # Repeatable config for defining the workflow below. defaults: &defaults @@ -510,15 +535,24 @@ workflows: <<: *defaults # Transpiler - - avm-transpiler: + - avm-transpiler-x86_64: requires: - - noir-ecr-manifest + - noir-x86_64 + <<: *defaults + - avm-transpiler-arm64: + requires: + - noir-arm64 + <<: *defaults + - avm-transpiler-ecr-manifest: + requires: + - avm-transpiler-x86_64 + - avm-transpiler-arm64 <<: *defaults # aztec-nargo (nargo & transpiler) - aztec-nargo: requires: - - avm-transpiler + - avm-transpiler-ecr-manifest <<: *defaults # Barretenberg @@ -536,7 +570,7 @@ workflows: - noir-projects: requires: - - avm-transpiler + - avm-transpiler-ecr-manifest - noir-ecr-manifest <<: *defaults diff --git a/avm-transpiler/src/main.rs b/avm-transpiler/src/main.rs index 7a4c10f2cb5..1a858d59601 100644 --- a/avm-transpiler/src/main.rs +++ b/avm-transpiler/src/main.rs @@ -21,7 +21,7 @@ fn main() { let in_contract_artifact_path = &args[1]; let out_transpiled_artifact_path = &args[2]; - // Parse original (pre-transpile) contract + // Parse original (pre-transpile) contract. let contract_json = fs::read_to_string(Path::new(in_contract_artifact_path)).expect("Unable to read file"); let raw_json_obj: serde_json::Value = @@ -33,7 +33,7 @@ fn main() { return; } - // Backup the original file + // Backup the original file. std::fs::copy( Path::new(in_contract_artifact_path), Path::new(&(in_contract_artifact_path.clone() + ".bak")), diff --git a/build-system/scripts/deploy_terraform b/build-system/scripts/deploy_terraform index 5418073ba28..5312bdec1d7 100755 --- a/build-system/scripts/deploy_terraform +++ b/build-system/scripts/deploy_terraform @@ -36,6 +36,8 @@ export TF_VAR_CHAIN_ID=$CHAIN_ID if [ -n "$REPOSITORY" ]; then BACKEND_CONFIG=-backend-config="key=$DEPLOY_TAG/$REPOSITORY" echo "Using backend key $DEPLOY_TAG/$REPOSITORY" +else + BACKEND_CONFIG="" fi terraform init -input=false $BACKEND_CONFIG diff --git a/build_manifest.yml b/build_manifest.yml index e0f6d26397e..0824765b52b 100644 --- a/build_manifest.yml +++ b/build_manifest.yml @@ -50,6 +50,7 @@ avm-transpiler: - ^noir/ dependencies: - noir + multiarch: host aztec-nargo: buildDir: . @@ -61,6 +62,7 @@ aztec-nargo: dependencies: - avm-transpiler - noir + multiarch: buildx # Compiles all aztec noir projects using nargo and the avm-transpiler. noir-projects: