From 09ed41876847b692fa6fda3740f48084f05cb6c3 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 13:01:28 +0000 Subject: [PATCH 01/45] fixes --- scripts/run_native_testnet.sh | 2 +- yarn-project/end-to-end/src/spartan/4epochs.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/run_native_testnet.sh b/scripts/run_native_testnet.sh index c4be98de940d..4f8f6fbe1f7b 100755 --- a/scripts/run_native_testnet.sh +++ b/scripts/run_native_testnet.sh @@ -38,7 +38,7 @@ display_help() { echo echo "Options:" echo " -h Display this help message" - echo " -t Specify the test file (default: $TEST_FILE)" + echo " -t Specify the test file (default: $TEST_SCRIPT)" echo " -p Specify the prover command (default: $PROVER_SCRIPT)" echo " -val Specify the number of validators (default: $NUM_VALIDATORS)" echo " -v Set logging level to verbose" diff --git a/yarn-project/end-to-end/src/spartan/4epochs.test.ts b/yarn-project/end-to-end/src/spartan/4epochs.test.ts index c58d31211112..1dca049d5efd 100644 --- a/yarn-project/end-to-end/src/spartan/4epochs.test.ts +++ b/yarn-project/end-to-end/src/spartan/4epochs.test.ts @@ -1,5 +1,5 @@ import { EthCheatCodes, readFieldCompressedString } from '@aztec/aztec.js'; -import { AZTEC_SLOT_DURATION } from '@aztec/circuits.js'; +import { AZTEC_EPOCH_DURATION, AZTEC_SLOT_DURATION } from '@aztec/circuits.js'; import { createDebugLogger } from '@aztec/foundation/log'; import { TokenContract } from '@aztec/noir-contracts.js'; @@ -23,7 +23,7 @@ describe('token transfer test', () => { // We want plenty of minted tokens for a lot of slots that fill up multiple epochs const MINT_AMOUNT = 2000000n; const TEST_EPOCHS = 4; - const ROUNDS = BigInt(AZTEC_SLOT_DURATION * TEST_EPOCHS); + const ROUNDS = BigInt(AZTEC_EPOCH_DURATION * TEST_EPOCHS); let testWallets: TestWallets; From cabe979967559c7a568bcf52b482a9447d2d9674 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 13:09:24 +0000 Subject: [PATCH 02/45] fixes --- build-system/s3-cache-scripts/cache-download.sh | 2 +- build-system/s3-cache-scripts/cache-upload.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-system/s3-cache-scripts/cache-download.sh b/build-system/s3-cache-scripts/cache-download.sh index d1dd7e7b2b50..8d72f860460e 100755 --- a/build-system/s3-cache-scripts/cache-download.sh +++ b/build-system/s3-cache-scripts/cache-download.sh @@ -18,7 +18,7 @@ function on_exit() { trap on_exit EXIT # Attempt to download the cache file -aws ${S3_BUILD_CACHE_AWS_PARAMS:-} s3 cp "s3://aztec-ci-artifacts/build-cache/$TAR_FILE" "$TAR_FILE" --quiet --no-sign-request &>/dev/null || (echo "Cache download of $TAR_FILE failed." && exit 1) +aws ${S3_BUILD_CACHE_AWS_PARAMS:-} s3 cp "s3://aztec-ci-artifacts/build-cache/$TAR_FILE" "$TAR_FILE" --quiet --no-sign-request || (echo "Cache download of $TAR_FILE failed." && exit 1) # Extract the cache file mkdir -p "$OUT_DIR" diff --git a/build-system/s3-cache-scripts/cache-upload.sh b/build-system/s3-cache-scripts/cache-upload.sh index 3dd2397db832..5782a5c538a3 100755 --- a/build-system/s3-cache-scripts/cache-upload.sh +++ b/build-system/s3-cache-scripts/cache-upload.sh @@ -24,4 +24,4 @@ trap on_exit EXIT # Rest of args are our binary paths tar -czf "$TAR_FILE" $@ -aws ${S3_BUILD_CACHE_AWS_PARAMS:-} s3 cp "$TAR_FILE" "s3://aztec-ci-artifacts/build-cache/$NAME" +aws ${S3_BUILD_CACHE_AWS_PARAMS:-} s3 cp "$TAR_FILE" "s3://aztec-ci-artifacts/build-cache/$NAME" --quiet --no-progress From 754e438589805da0e718e62c65cefea83462eaa8 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 14:48:34 +0000 Subject: [PATCH 03/45] fix --- .github/workflows/ci.yml | 47 ++++++++++++++++++- yarn-project/Earthfile | 5 +- yarn-project/end-to-end/Earthfile | 17 +------ .../end-to-end/scripts/network_test.sh | 16 +++++-- 4 files changed, 62 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e0a50f16fc6..a91334298879 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -618,9 +618,33 @@ jobs: timeout-minutes: 40 run: earthly-ci --no-output ./yarn-project/+prover-client-test - network-test-fake-proofs: + # proving disabled + network-test: needs: [build, configure] runs-on: ${{ needs.configure.outputs.username }}-x86 + strategy: + matrix: + test: [src/spartan/transfer.test.ts, src/spartan/4epochs.test.ts] + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + - uses: ./.github/ci-setup-action + with: + concurrency_key: network-test-fake-proofs-x86 + - name: "Prover Client Tests" + timeout-minutes: 40 + working-directory: ./yarn-project + # Only allow transfer test to run on every (non-network-all) PR + if: contains(matrix.test, 'transfer.test.ts') || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all') + run: RUN NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/smoke.test.ts + + # proving disabled + kind-network-test: + needs: [build, configure] + runs-on: ${{ needs.configure.outputs.username }}-x86 + strategy: + matrix: + test: [src/spartan/transfer.test.ts, src/spartan/4epochs.test.ts] steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } @@ -629,7 +653,26 @@ jobs: concurrency_key: network-test-fake-proofs-x86 - name: "Prover Client Tests" timeout-minutes: 40 - run: earthly-ci --no-output ./yarn-project/+network-test-fake-proofs + # Only allow transfer test to run on every (non-network-all) PR + if: contains(matrix.test, 'transfer.test.ts') || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all') + run: earthly-ci --no-output ./yarn-project/+network-test-fake-proofs --test=${{ matrix.test }} + + +kind-network-smoke: + ARG values_file + LOCALLY + RUN NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/smoke.test.ts + +kind-network-transfer: + ARG values_file + LOCALLY + RUN NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/transfer.test.ts + +kind-network-4epochs: + ARG values_file + LOCALLY + RUN NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/4epochs.test.ts || true + l1-contracts-test: needs: [build, configure] diff --git a/yarn-project/Earthfile b/yarn-project/Earthfile index 0e6fa4fb698b..b49ff34606f8 100644 --- a/yarn-project/Earthfile +++ b/yarn-project/Earthfile @@ -282,6 +282,7 @@ prover-client-test: # NOTE: This is not in the end-to-end Earthfile as that is entirely LOCALLY commands that will go away sometime. # Running this inside the main builder as the point is not to run this through dockerization. network-test-fake-proofs: + ARG test=src/spartan/transfer.test.ts FROM +build WORKDIR /usr/src/ # Bare minimum git setup to run 'git rev-parse --show-toplevel' @@ -291,14 +292,14 @@ network-test-fake-proofs: # All script arguments are in the end-to-end/scripts/native-network folder ENV LOG_LEVEL=verbose RUN INTERLEAVED=true end-to-end/scripts/native_network_test.sh \ - ./test-transfer.sh \ + "$test" \ ./deploy-l1-contracts.sh \ ./deploy-l2-contracts.sh \ ./boot-node.sh \ ./ethereum.sh \ "./prover-node.sh 8078 false" \ ./pxe.sh \ - "./validator.sh 8081 40401" + "./validators.sh 3" publish-npm: FROM +build diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 039e299aba94..03cdadd987cb 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -287,19 +287,4 @@ e2e-devnet-smoke: e2e-cli-wallet: LOCALLY - RUN COMPOSE_FILE=scripts/docker-compose-wallet.yml ./scripts/e2e_compose_test.sh e2e_cli_wallet - -kind-network-smoke: - ARG values_file - LOCALLY - RUN NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/smoke.test.ts - -kind-network-transfer: - ARG values_file - LOCALLY - RUN NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/transfer.test.ts - -kind-network-4epochs: - ARG values_file - LOCALLY - RUN NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/4epochs.test.ts || true + RUN COMPOSE_FILE=scripts/docker-compose-wallet.yml ./scripts/e2e_compose_test.sh e2e_cli_wallet \ No newline at end of file diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 5c2c8d0c8abf..32a7690f8835 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -82,9 +82,19 @@ helm upgrade --install spartan "$REPO/spartan/aztec-network/" \ kubectl wait pod -l app==pxe --for=condition=Ready -n "$NAMESPACE" --timeout=10m -# tunnel in to get access directly to our PXE service in k8s -(kubectl port-forward --namespace $NAMESPACE svc/spartan-aztec-network-pxe 9082:8080 2>/dev/null >/dev/null || true) & -(kubectl port-forward --namespace $NAMESPACE svc/spartan-aztec-network-anvil 9545:8545 2>/dev/null >/dev/null || true) & +# Find two free ports between 8000 and 9000 +FREE_PORTS=$(comm -23 <(seq 8000 9000 | sort) <(ss -Htan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 2) + +# Extract the two free ports from the list +PXE_PORT=$(echo $FREE_PORTS | awk '{print $1}') +ANVIL_PORT=$(echo $FREE_PORTS | awk '{print $2}') + +# Namespace variable (assuming it's set) +NAMESPACE=${NAMESPACE:-default} + +# Start port-forwarding with dynamically allocated free ports +(kubectl port-forward --namespace $NAMESPACE svc/spartan-aztec-network-pxe $PXE_PORT:8080 2>/dev/null >/dev/null || true) & +(kubectl port-forward --namespace $NAMESPACE svc/spartan-aztec-network-anvil $ANVIL_PORT:8545 2>/dev/null >/dev/null || true) & docker run --rm --network=host \ -e PXE_URL=http://127.0.0.1:9082 \ From 8a7968b4c76c7dad1c5a79c4191238bbe4428eb2 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 11:37:24 -0400 Subject: [PATCH 04/45] Update ci.yml --- .github/workflows/ci.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a91334298879..bb9101e71e2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -657,23 +657,6 @@ jobs: if: contains(matrix.test, 'transfer.test.ts') || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all') run: earthly-ci --no-output ./yarn-project/+network-test-fake-proofs --test=${{ matrix.test }} - -kind-network-smoke: - ARG values_file - LOCALLY - RUN NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/smoke.test.ts - -kind-network-transfer: - ARG values_file - LOCALLY - RUN NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/transfer.test.ts - -kind-network-4epochs: - ARG values_file - LOCALLY - RUN NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/4epochs.test.ts || true - - l1-contracts-test: needs: [build, configure] runs-on: ${{ needs.configure.outputs.username }}-x86 From e94ed2635caf3f3e2e5be1a14940a725a9d03c56 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 15:43:30 +0000 Subject: [PATCH 05/45] fixes --- .github/workflows/ci.yml | 35 ++++++++----------------------- yarn-project/end-to-end/Earthfile | 2 +- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a91334298879..1ad4730ad033 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -624,7 +624,7 @@ jobs: runs-on: ${{ needs.configure.outputs.username }}-x86 strategy: matrix: - test: [src/spartan/transfer.test.ts, src/spartan/4epochs.test.ts] + test: [transfer.test.ts, 4epochs.test.ts] steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } @@ -633,46 +633,29 @@ jobs: concurrency_key: network-test-fake-proofs-x86 - name: "Prover Client Tests" timeout-minutes: 40 - working-directory: ./yarn-project # Only allow transfer test to run on every (non-network-all) PR - if: contains(matrix.test, 'transfer.test.ts') || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all') - run: RUN NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/smoke.test.ts + if: matrix.test == 'transfer.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') + run: earthly-ci --no-output ./yarn-project/+network-test-fake-proofs --test=${{ matrix.test }} - # proving disabled + # note: proving disabled kind-network-test: needs: [build, configure] runs-on: ${{ needs.configure.outputs.username }}-x86 strategy: matrix: - test: [src/spartan/transfer.test.ts, src/spartan/4epochs.test.ts] + test: [transfer.test.ts, 4epochs.test.ts] steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } - uses: ./.github/ci-setup-action with: concurrency_key: network-test-fake-proofs-x86 - - name: "Prover Client Tests" + - name: "KIND Network Test" timeout-minutes: 40 + working-directory: yarn-project # Only allow transfer test to run on every (non-network-all) PR - if: contains(matrix.test, 'transfer.test.ts') || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all') - run: earthly-ci --no-output ./yarn-project/+network-test-fake-proofs --test=${{ matrix.test }} - - -kind-network-smoke: - ARG values_file - LOCALLY - RUN NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/smoke.test.ts - -kind-network-transfer: - ARG values_file - LOCALLY - RUN NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/transfer.test.ts - -kind-network-4epochs: - ARG values_file - LOCALLY - RUN NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/4epochs.test.ts || true - + if: matrix.test == 'transfer.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') + run: NAMESPACE="${{ matrix.test }}" FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/${{ matrix.test }} l1-contracts-test: needs: [build, configure] diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 03cdadd987cb..acfecc5949c5 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -287,4 +287,4 @@ e2e-devnet-smoke: e2e-cli-wallet: LOCALLY - RUN COMPOSE_FILE=scripts/docker-compose-wallet.yml ./scripts/e2e_compose_test.sh e2e_cli_wallet \ No newline at end of file + RUN COMPOSE_FILE=scripts/docker-compose-wallet.yml ./scripts/e2e_compose_test.sh e2e_cli_wallet From d16ffb93cd3d1c341a88685f2c72e12f188a0f99 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 15:50:02 +0000 Subject: [PATCH 06/45] fixes --- yarn-project/end-to-end/scripts/network_test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 32a7690f8835..29dd004837d0 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -82,8 +82,8 @@ helm upgrade --install spartan "$REPO/spartan/aztec-network/" \ kubectl wait pod -l app==pxe --for=condition=Ready -n "$NAMESPACE" --timeout=10m -# Find two free ports between 8000 and 9000 -FREE_PORTS=$(comm -23 <(seq 8000 9000 | sort) <(ss -Htan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 2) +# Find two free ports between 9000 and 10000 +FREE_PORTS=$(comm -23 <(seq 9000 10000 | sort) <(ss -Htan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 2) # Extract the two free ports from the list PXE_PORT=$(echo $FREE_PORTS | awk '{print $1}') @@ -94,7 +94,7 @@ NAMESPACE=${NAMESPACE:-default} # Start port-forwarding with dynamically allocated free ports (kubectl port-forward --namespace $NAMESPACE svc/spartan-aztec-network-pxe $PXE_PORT:8080 2>/dev/null >/dev/null || true) & -(kubectl port-forward --namespace $NAMESPACE svc/spartan-aztec-network-anvil $ANVIL_PORT:8545 2>/dev/null >/dev/null || true) & +(kubectl port-forward --namespace $NAMESPACE svc/spartan-aztec-network-ethereum $ANVIL_PORT:8545 2>/dev/null >/dev/null || true) & docker run --rm --network=host \ -e PXE_URL=http://127.0.0.1:9082 \ From 69946d3f57dfc3d6a4dac9611392fb6695420dc6 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 12:01:32 -0400 Subject: [PATCH 07/45] Update ci.yml --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ad4730ad033..7c06d42dcde8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -643,7 +643,7 @@ jobs: runs-on: ${{ needs.configure.outputs.username }}-x86 strategy: matrix: - test: [transfer.test.ts, 4epochs.test.ts] + test: [smoke.test.ts, transfer.test.ts, 4epochs.test.ts] steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } @@ -654,7 +654,7 @@ jobs: timeout-minutes: 40 working-directory: yarn-project # Only allow transfer test to run on every (non-network-all) PR - if: matrix.test == 'transfer.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') + if: matrix.test == 'smoke.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') run: NAMESPACE="${{ matrix.test }}" FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/${{ matrix.test }} l1-contracts-test: @@ -885,7 +885,8 @@ jobs: - yarn-project-formatting - yarn-project-test - prover-client-test - - network-test-fake-proofs + - network-test + - kind-network-test - l1-contracts-test - docs-preview # - bb-bench # non-blocking @@ -944,7 +945,8 @@ jobs: - yarn-project-formatting - yarn-project-test - prover-client-test - - network-test-fake-proofs + - network-test + - kind-network-test - l1-contracts-test - docs-preview # - bb-bench # non-blocking From af44ffeb4b8b4dda5af655dfb6003f419a87cf08 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 12:13:30 -0400 Subject: [PATCH 08/45] Update ci.yml --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c06d42dcde8..14ea43af907e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -289,7 +289,7 @@ jobs: ref: "${{ github.event.pull_request.head.sha }}" - uses: ./.github/ci-setup-action with: - concurrency_key: build-x86 + concurrency_key: bench-summary-x86 - name: "Build and upload bench aggregate file" working-directory: ./yarn-project/scripts run: | @@ -630,7 +630,7 @@ jobs: with: { ref: "${{ env.GIT_COMMIT }}" } - uses: ./.github/ci-setup-action with: - concurrency_key: network-test-fake-proofs-x86 + concurrency_key: network-test-${{ matrix.test }} - name: "Prover Client Tests" timeout-minutes: 40 # Only allow transfer test to run on every (non-network-all) PR @@ -649,7 +649,7 @@ jobs: with: { ref: "${{ env.GIT_COMMIT }}" } - uses: ./.github/ci-setup-action with: - concurrency_key: network-test-fake-proofs-x86 + concurrency_key: kind-network-test-${{ matrix.test }} - name: "KIND Network Test" timeout-minutes: 40 working-directory: yarn-project From e72907de581734b27fa28343b4ff2c698fd2f8d2 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 16:28:09 +0000 Subject: [PATCH 09/45] fixes --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ad4730ad033..5f595ed37926 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -635,7 +635,7 @@ jobs: timeout-minutes: 40 # Only allow transfer test to run on every (non-network-all) PR if: matrix.test == 'transfer.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') - run: earthly-ci --no-output ./yarn-project/+network-test-fake-proofs --test=${{ matrix.test }} + run: earthly-ci --no-output ./yarn-project/+network-test-fake-proofs --test=src/spartan/${{ matrix.test }} # note: proving disabled kind-network-test: @@ -652,7 +652,7 @@ jobs: concurrency_key: network-test-fake-proofs-x86 - name: "KIND Network Test" timeout-minutes: 40 - working-directory: yarn-project + working-directory: yarn-project/end-to-end # Only allow transfer test to run on every (non-network-all) PR if: matrix.test == 'transfer.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') run: NAMESPACE="${{ matrix.test }}" FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/${{ matrix.test }} From 946c12b1c45c010a6fa23668f44fbeabb5cccd70 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 16:41:25 +0000 Subject: [PATCH 10/45] fix native test --- .github/workflows/ci.yml | 6 ++++-- docker-compose.provernet.yml | 10 +++++----- scripts/run_interleaved.sh | 2 +- spartan/scripts/deploy_spartan.sh | 19 +++++++++++++++++++ spartan/scripts/setup_local_k8s.sh | 2 +- yarn-project/Earthfile | 2 +- .../end-to-end/scripts/network_test.sh | 3 +-- 7 files changed, 32 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab92e6afa213..c91d02f89420 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -623,8 +623,9 @@ jobs: needs: [build, configure] runs-on: ${{ needs.configure.outputs.username }}-x86 strategy: + fail-fast: false matrix: - test: [transfer.test.ts, 4epochs.test.ts] + test: [test-transfer.sh, test-4epochs.ts] steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } @@ -635,13 +636,14 @@ jobs: timeout-minutes: 40 # Only allow transfer test to run on every (non-network-all) PR if: matrix.test == 'transfer.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') - run: earthly-ci --no-output ./yarn-project/+network-test-fake-proofs --test=src/spartan/${{ matrix.test }} + run: earthly-ci --no-output ./yarn-project/+network-test --test=${{ matrix.test }} # note: proving disabled kind-network-test: needs: [build, configure] runs-on: ${{ needs.configure.outputs.username }}-x86 strategy: + fail-fast: false matrix: test: [smoke.test.ts, transfer.test.ts, 4epochs.test.ts] steps: diff --git a/docker-compose.provernet.yml b/docker-compose.provernet.yml index 58bb54087c46..e6893c903c4d 100644 --- a/docker-compose.provernet.yml +++ b/docker-compose.provernet.yml @@ -10,13 +10,13 @@ services: command: > 'anvil --block-time 12 --host 0.0.0.0 --chain-id 31337 --port 8545 --silent' ports: - - 8545:8545 + - 10545:8545 # Single Aztec node with a sequencer for building and publishing unproven blocks to L1 aztec-node: image: "aztecprotocol/${IMAGE:-aztec:master}" ports: - - "8080:80" + - "10080:80" environment: LOG_LEVEL: info ETHEREUM_HOST: http://ethereum:8545 @@ -56,7 +56,7 @@ services: aztec-prover: image: "aztecprotocol/${IMAGE:-aztec:master}" ports: - - "8083:80" + - "10083:80" environment: LOG_LEVEL: verbose ETHEREUM_HOST: http://ethereum:8545 @@ -90,7 +90,7 @@ services: aztec-prover-agent: image: "aztecprotocol/${IMAGE:-aztec:master}" ports: - - "8090:80" + - "10090:80" environment: LOG_LEVEL: verbose ETHEREUM_HOST: http://ethereum:8545 @@ -123,7 +123,7 @@ services: aztec-bot: image: "aztecprotocol/${IMAGE:-aztec:master}" ports: - - "8082:80" + - "10082:80" environment: LOG_LEVEL: info ETHEREUM_HOST: http://ethereum:8545 diff --git a/scripts/run_interleaved.sh b/scripts/run_interleaved.sh index 8a52bc840910..a9b9040a7a17 100755 --- a/scripts/run_interleaved.sh +++ b/scripts/run_interleaved.sh @@ -33,7 +33,7 @@ shift function cleanup() { # kill everything in our process group except our process - trap - SIGTERM && kill $(pgrep -g $$ | grep -v $$) 2>/dev/null || true + trap - SIGTERM && kill $(pgrep -g $$ | grep -v $$) $(jobs -p) 2>/dev/null || true } trap cleanup SIGINT SIGTERM EXIT diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index f8249202a9c3..c9c2fe401f8c 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -10,6 +10,25 @@ if [ -z "$TAG" ]; then exit 1 fi +function cleanup() { + # kill everything in our process group except our process + trap - SIGTERM && kill $(pgrep -g $$ | grep -v $$) $(jobs -p) || true +} +trap cleanup SIGINT SIGTERM EXIT + +function show_status_until_pxe_ready() { + set +x # don't spam with our commands + sleep 15 # let helm upgrade start + for i in {1..100} ; do + if kubectl wait pod -l app==pxe --for=condition=Ready -n spartan --timeout=20s >/dev/null 2>/dev/null ; then + break # we are up, stop showing status + fi + # show startup status + kubectl get pods -n spartan + done +} +show_status_until_pxe_ready & + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" helm upgrade --install spartan $SCRIPT_DIR/../aztec-network \ diff --git a/spartan/scripts/setup_local_k8s.sh b/spartan/scripts/setup_local_k8s.sh index b23ad059134f..cddebbf5d6fe 100755 --- a/spartan/scripts/setup_local_k8s.sh +++ b/spartan/scripts/setup_local_k8s.sh @@ -33,7 +33,7 @@ fi if kind get clusters | grep -q "^kind$"; then echo "Cluster 'kind' already exists. Skipping creation." else - kind create cluster + flock kind.lock kind create cluster fi kubectl config use-context kind-kind diff --git a/yarn-project/Earthfile b/yarn-project/Earthfile index b49ff34606f8..7cb827a4ec5c 100644 --- a/yarn-project/Earthfile +++ b/yarn-project/Earthfile @@ -281,7 +281,7 @@ prover-client-test: # NOTE: This is not in the end-to-end Earthfile as that is entirely LOCALLY commands that will go away sometime. # Running this inside the main builder as the point is not to run this through dockerization. -network-test-fake-proofs: +network-test: ARG test=src/spartan/transfer.test.ts FROM +build WORKDIR /usr/src/ diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 29dd004837d0..6864fcd549ee 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -65,8 +65,7 @@ show_status_until_pxe_ready & function cleanup() { # kill everything in our process group except our process - kill $(pgrep -g $$ | grep -v $$) || true - kill $(jobs -p) || true + trap - SIGTERM && kill $(pgrep -g $$ | grep -v $$) $(jobs -p) || true } trap cleanup SIGINT SIGTERM EXIT # Install the Helm chart From 26d72088d9c93447a522cc0774586c6a87e31c90 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 16:41:41 +0000 Subject: [PATCH 11/45] fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c91d02f89420..e93c50d8af00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -625,7 +625,7 @@ jobs: strategy: fail-fast: false matrix: - test: [test-transfer.sh, test-4epochs.ts] + test: [./test-transfer.sh, ./test-4epochs.ts] steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } From 7da5cacc083f77cb4fee5e518402400df8864efa Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 16:52:24 +0000 Subject: [PATCH 12/45] use stern --- scripts/run_interleaved.sh | 2 +- spartan/scripts/deploy_spartan.sh | 9 ++++++--- spartan/scripts/setup_local_k8s.sh | 20 ++++++++++++++++++- .../end-to-end/scripts/network_test.sh | 2 +- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/scripts/run_interleaved.sh b/scripts/run_interleaved.sh index a9b9040a7a17..85449570cb49 100755 --- a/scripts/run_interleaved.sh +++ b/scripts/run_interleaved.sh @@ -33,7 +33,7 @@ shift function cleanup() { # kill everything in our process group except our process - trap - SIGTERM && kill $(pgrep -g $$ | grep -v $$) $(jobs -p) 2>/dev/null || true + trap - SIGTERM && kill $(pgrep -g $$ | grep -v $$) $(jobs -p) &>/dev/null || true } trap cleanup SIGINT SIGTERM EXIT diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index c9c2fe401f8c..b108ac0cd0a3 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -12,12 +12,11 @@ fi function cleanup() { # kill everything in our process group except our process - trap - SIGTERM && kill $(pgrep -g $$ | grep -v $$) $(jobs -p) || true + trap - SIGTERM && kill $(pgrep -g $$ | grep -v $$) $(jobs -p) &>/dev/null || true } trap cleanup SIGINT SIGTERM EXIT function show_status_until_pxe_ready() { - set +x # don't spam with our commands sleep 15 # let helm upgrade start for i in {1..100} ; do if kubectl wait pod -l app==pxe --for=condition=Ready -n spartan --timeout=20s >/dev/null 2>/dev/null ; then @@ -28,9 +27,13 @@ function show_status_until_pxe_ready() { done } show_status_until_pxe_ready & - SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +function log_stern() { + stern spartan -n spartan 2>&1 >> "$SCRIPT_DIR/spartan-deploy.log" +} +log_stern & + helm upgrade --install spartan $SCRIPT_DIR/../aztec-network \ --namespace spartan \ --create-namespace \ diff --git a/spartan/scripts/setup_local_k8s.sh b/spartan/scripts/setup_local_k8s.sh index cddebbf5d6fe..26cca38dc764 100755 --- a/spartan/scripts/setup_local_k8s.sh +++ b/spartan/scripts/setup_local_k8s.sh @@ -30,10 +30,28 @@ if ! command -v helm &> /dev/null; then rm get_helm.sh fi +if ! command -v stern &> /dev/null; then + # Download Stern + curl -Lo stern.tar.gz https://github.com/stern/stern/releases/download/v1.31.0/stern_1.31.0_linux_amd64.tar.gz + + # Extract the binary + tar -xzf stern.tar.gz + + # Move it to /usr/local/bin and set permissions + sudo mv stern /usr/local/bin/stern + sudo chmod +x /usr/local/bin/stern + + # Verify installation + stern --version + + # Clean up + rm stern.tar.gz +fi + if kind get clusters | grep -q "^kind$"; then echo "Cluster 'kind' already exists. Skipping creation." else - flock kind.lock kind create cluster + kind create cluster fi kubectl config use-context kind-kind diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 6864fcd549ee..2597fc9869a6 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -65,7 +65,7 @@ show_status_until_pxe_ready & function cleanup() { # kill everything in our process group except our process - trap - SIGTERM && kill $(pgrep -g $$ | grep -v $$) $(jobs -p) || true + trap - SIGTERM && kill $(pgrep -g $$ | grep -v $$) $(jobs -p) &>/dev/null || true } trap cleanup SIGINT SIGTERM EXIT # Install the Helm chart From 6666abf4e4ae93ce3f2ab4efcba6bafe03b0d5a2 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 17:13:11 +0000 Subject: [PATCH 13/45] pass --- spartan/scripts/deploy_spartan.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index b108ac0cd0a3..20226b34d083 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -3,6 +3,7 @@ set -eu TAG=$1 VALUES=$2 +NAMESPACE=${3:-spartan} if [ -z "$TAG" ]; then echo "Usage: $0 " @@ -18,24 +19,23 @@ trap cleanup SIGINT SIGTERM EXIT function show_status_until_pxe_ready() { sleep 15 # let helm upgrade start - for i in {1..100} ; do - if kubectl wait pod -l app==pxe --for=condition=Ready -n spartan --timeout=20s >/dev/null 2>/dev/null ; then - break # we are up, stop showing status - fi - # show startup status - kubectl get pods -n spartan + kubectl get pods -n $NAMESPACE + for i in {1..20} ; do + # Show once a minute x 20 minutes + kubectl get pods -n $NAMESPACE + sleep 60 done } show_status_until_pxe_ready & SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" function log_stern() { - stern spartan -n spartan 2>&1 >> "$SCRIPT_DIR/spartan-deploy.log" + stern $NAMESPACE -n $NAMESPACE 2>&1 >> "$SCRIPT_DIR/$NAMESPACE-deploy.log" } log_stern & -helm upgrade --install spartan $SCRIPT_DIR/../aztec-network \ - --namespace spartan \ +helm upgrade --install $NAMESPACE $SCRIPT_DIR/../aztec-network \ + --namespace $NAMESPACE \ --create-namespace \ --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml \ --set images.aztec.image="aztecprotocol/aztec:$TAG" \ From 8449ef399834b8191d532e4124100509bcd4a11f Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 17:38:57 +0000 Subject: [PATCH 14/45] fix network tests --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e93c50d8af00..4fde330a12e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -625,7 +625,7 @@ jobs: strategy: fail-fast: false matrix: - test: [./test-transfer.sh, ./test-4epochs.ts] + test: [test-transfer.sh, test-4epochs.ts] steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } @@ -636,7 +636,7 @@ jobs: timeout-minutes: 40 # Only allow transfer test to run on every (non-network-all) PR if: matrix.test == 'transfer.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') - run: earthly-ci --no-output ./yarn-project/+network-test --test=${{ matrix.test }} + run: earthly-ci --no-output ./yarn-project/+network-test --test=./${{ matrix.test }} # note: proving disabled kind-network-test: From dacf6e5425a6955f5ee77757d5b770b1b96ca9f2 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 17:40:40 +0000 Subject: [PATCH 15/45] fix --- spartan/scripts/setup_local_k8s.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spartan/scripts/setup_local_k8s.sh b/spartan/scripts/setup_local_k8s.sh index 26cca38dc764..85cea0f5e4d2 100755 --- a/spartan/scripts/setup_local_k8s.sh +++ b/spartan/scripts/setup_local_k8s.sh @@ -54,4 +54,4 @@ else kind create cluster fi -kubectl config use-context kind-kind +kubectl config use-context kind-kind || true From f1b4708ad4b980bb72814740b5523b4646005018 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 18:09:59 +0000 Subject: [PATCH 16/45] always pull --- spartan/aztec-network/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spartan/aztec-network/values.yaml b/spartan/aztec-network/values.yaml index 8905fc155eba..3378d4a9ea4d 100644 --- a/spartan/aztec-network/values.yaml +++ b/spartan/aztec-network/values.yaml @@ -12,7 +12,7 @@ telemetry: images: aztec: image: aztecprotocol/aztec - pullPolicy: IfNotPresent + pullPolicy: Always curl: image: curlimages/curl:7.81.0 pullPolicy: IfNotPresent From d81b88b67ae8c5aaaac75f2e3201dfbd4ec56342 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 18:27:52 +0000 Subject: [PATCH 17/45] try force upgrade --- spartan/scripts/deploy_spartan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index 20226b34d083..be95149cb179 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -38,7 +38,7 @@ helm upgrade --install $NAMESPACE $SCRIPT_DIR/../aztec-network \ --namespace $NAMESPACE \ --create-namespace \ --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml \ - --set images.aztec.image="aztecprotocol/aztec:$TAG" \ + --set images.aztec.image="aztecprotocol/aztec@sha256:5b6a419315169b7f9ff1d9d16b1ce208e5737067405fda3b924c5669934bac8e" \ --set network.public=true \ --wait \ --wait-for-jobs=true \ From a5777f082f0f3c11ed7b04bfab1f37cdc46a9434 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 18:34:29 +0000 Subject: [PATCH 18/45] fix install --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fde330a12e5..b776720d5ee5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -625,7 +625,7 @@ jobs: strategy: fail-fast: false matrix: - test: [test-transfer.sh, test-4epochs.ts] + test: [test-transfer.sh, test-4epochs.sh] steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } @@ -657,7 +657,7 @@ jobs: working-directory: yarn-project/end-to-end # Only allow transfer test to run on every (non-network-all) PR if: matrix.test == 'smoke.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') - run: NAMESPACE="${{ matrix.test }}" FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/${{ matrix.test }} + run: NAMESPACE="${${{ matrix.test }}%.test.ts}" FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/${{ matrix.test }} l1-contracts-test: needs: [build, configure] From 7d7d7ff5451c8f4ceec1890346e7d5a7796ea86d Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 19:57:43 +0000 Subject: [PATCH 19/45] fix --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b776720d5ee5..aea06badcb6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -655,9 +655,11 @@ jobs: - name: "KIND Network Test" timeout-minutes: 40 working-directory: yarn-project/end-to-end + env: + test: ${{ matrix.test }} # Only allow transfer test to run on every (non-network-all) PR if: matrix.test == 'smoke.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') - run: NAMESPACE="${${{ matrix.test }}%.test.ts}" FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/${{ matrix.test }} + run: NAMESPACE="${test%.test.ts}" FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/$test l1-contracts-test: needs: [build, configure] From 34ecfc9df82ce2ac71e9f975c9389046e16a744c Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 20:30:40 +0000 Subject: [PATCH 20/45] iterate on deploy spartan --- spartan/scripts/deploy_spartan.sh | 38 ++++++++++++++++++++----------- spartan/scripts/logs/.gitignore | 1 + 2 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 spartan/scripts/logs/.gitignore diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index be95149cb179..a3c2f136a673 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -1,23 +1,26 @@ #!/bin/bash -set -eu +set -eux +set -o pipefail -TAG=$1 +IMAGE=$1 VALUES=$2 NAMESPACE=${3:-spartan} -if [ -z "$TAG" ]; then +if [ -z "$IMAGE" ]; then echo "Usage: $0 " echo "Example: $0 latest 48-validators" exit 1 fi function cleanup() { + set +x # kill everything in our process group except our process trap - SIGTERM && kill $(pgrep -g $$ | grep -v $$) $(jobs -p) &>/dev/null || true } trap cleanup SIGINT SIGTERM EXIT function show_status_until_pxe_ready() { + set +x sleep 15 # let helm upgrade start kubectl get pods -n $NAMESPACE for i in {1..20} ; do @@ -30,16 +33,25 @@ show_status_until_pxe_ready & SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" function log_stern() { - stern $NAMESPACE -n $NAMESPACE 2>&1 >> "$SCRIPT_DIR/$NAMESPACE-deploy.log" + set +x + stern $NAMESPACE -n $NAMESPACE 2>&1 > "$SCRIPT_DIR/logs/$NAMESPACE-deploy.log" } log_stern & -helm upgrade --install $NAMESPACE $SCRIPT_DIR/../aztec-network \ - --namespace $NAMESPACE \ - --create-namespace \ - --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml \ - --set images.aztec.image="aztecprotocol/aztec@sha256:5b6a419315169b7f9ff1d9d16b1ce208e5737067405fda3b924c5669934bac8e" \ - --set network.public=true \ - --wait \ - --wait-for-jobs=true \ - --timeout=30m +function upgrade() { + helm upgrade --install $NAMESPACE $SCRIPT_DIR/../aztec-network \ + --namespace $NAMESPACE \ + --create-namespace \ + --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml \ + --set images.aztec.image="$IMAGE" \ + --set network.public=true \ + --wait \ + --wait-for-jobs=true \ + --timeout=30m 2>&1 +} +if ! upgrade | tee "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then + if grep 'cannot patch "'$NAMESPACE'-aztec-network-setup-l2-contracts"' "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then + kubectl delete job $NAMESPACE-aztec-network-setup-l2-contracts -n $NAMESPACE + upgrade + fi +fi \ No newline at end of file diff --git a/spartan/scripts/logs/.gitignore b/spartan/scripts/logs/.gitignore new file mode 100644 index 000000000000..bf0824e596ed --- /dev/null +++ b/spartan/scripts/logs/.gitignore @@ -0,0 +1 @@ +*.log \ No newline at end of file From 5373dc7217ae5c584948a05b36561fec80da8ee5 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 20:46:48 +0000 Subject: [PATCH 21/45] fix --- spartan/scripts/deploy_spartan.sh | 4 ++-- spartan/scripts/setup_local_k8s.sh | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index a3c2f136a673..eee1f02d6d66 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -7,8 +7,8 @@ VALUES=$2 NAMESPACE=${3:-spartan} if [ -z "$IMAGE" ]; then - echo "Usage: $0 " - echo "Example: $0 latest 48-validators" + echo "Usage: $0 " + echo "Example: $0 aztecprotocol/aztec@sha256: 48-validators" exit 1 fi diff --git a/spartan/scripts/setup_local_k8s.sh b/spartan/scripts/setup_local_k8s.sh index 85cea0f5e4d2..089aba708a7e 100755 --- a/spartan/scripts/setup_local_k8s.sh +++ b/spartan/scripts/setup_local_k8s.sh @@ -48,9 +48,12 @@ if ! command -v stern &> /dev/null; then rm stern.tar.gz fi -if kind get clusters | grep -q "^kind$"; then +if kubectl config get-clusters | grep -q "^kind-kind$"; then echo "Cluster 'kind' already exists. Skipping creation." else + # Sometimes, kubectl does not have our kind context yet kind registers it as existing + # Ensure our context exists in kubectl + kind delete cluster || true kind create cluster fi From 0db1443a3637306dd6fc251e69688088b251aa35 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 20:52:05 +0000 Subject: [PATCH 22/45] fix --- spartan/scripts/deploy_spartan.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index eee1f02d6d66..5574df0a7b8f 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -2,13 +2,13 @@ set -eux set -o pipefail -IMAGE=$1 +TAG=$1 VALUES=$2 NAMESPACE=${3:-spartan} if [ -z "$IMAGE" ]; then - echo "Usage: $0 " - echo "Example: $0 aztecprotocol/aztec@sha256: 48-validators" + echo "Usage: $0 " + echo "Example: $0 latest 48-validators" exit 1 fi @@ -39,6 +39,9 @@ function log_stern() { log_stern & function upgrade() { + # pull and resolve the image just to be absolutely sure k8s gets the latest image in the tag we want + docker pull aztecprotocol/aztec:$TAG + IMAGE=$(docker inspect --format='{{index .RepoDigests 0}}' aztecprotocol/aztec:$TAG) helm upgrade --install $NAMESPACE $SCRIPT_DIR/../aztec-network \ --namespace $NAMESPACE \ --create-namespace \ @@ -49,6 +52,7 @@ function upgrade() { --wait-for-jobs=true \ --timeout=30m 2>&1 } +# docker inspect --format='{{index .RepoDigests 0}}' aztecprotocol/aztec:master if ! upgrade | tee "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then if grep 'cannot patch "'$NAMESPACE'-aztec-network-setup-l2-contracts"' "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then kubectl delete job $NAMESPACE-aztec-network-setup-l2-contracts -n $NAMESPACE From 01bb012a9d195349703784e636e67496ca5bbc06 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 20:59:19 +0000 Subject: [PATCH 23/45] fix --- spartan/scripts/deploy_spartan.sh | 2 +- yarn-project/end-to-end/scripts/network_test.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index 5574df0a7b8f..8c8cb9354ae6 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -6,7 +6,7 @@ TAG=$1 VALUES=$2 NAMESPACE=${3:-spartan} -if [ -z "$IMAGE" ]; then +if [ -z "$TAG" ]; then echo "Usage: $0 " echo "Example: $0 latest 48-validators" exit 1 diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 2597fc9869a6..3ab0b5fdb19c 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -18,7 +18,8 @@ TEST="$1" REPO=$(git rev-parse --show-toplevel) if [ "$(uname)" = "Linux" ] && [ "$(uname -m)" = "x86_64" ]; then - "$REPO"/spartan/scripts/setup_local_k8s.sh + # Use a lock so this can be ran in parallel + flock setup_local_k8s.lock "$REPO"/spartan/scripts/setup_local_k8s.sh else echo "Not on x64 Linux, not installing k8s and helm." fi From f7586abae23f7b1cd412d10493e0c64eee48f755 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 21:50:54 +0000 Subject: [PATCH 24/45] update --- spartan/scripts/deploy_spartan.sh | 37 ++++++++++++------- .../scripts/native-network/test-4epochs.sh | 10 +++-- .../end-to-end/scripts/network_test.sh | 2 +- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index 8c8cb9354ae6..c1ed82944ca3 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -5,10 +5,11 @@ set -o pipefail TAG=$1 VALUES=$2 NAMESPACE=${3:-spartan} +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" if [ -z "$TAG" ]; then - echo "Usage: $0 " - echo "Example: $0 latest 48-validators" + echo "Usage: $0 (optional: )" + echo "Example: $0 latest 48-validators devnet" exit 1 fi @@ -30,7 +31,6 @@ function show_status_until_pxe_ready() { done } show_status_until_pxe_ready & -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" function log_stern() { set +x @@ -40,19 +40,28 @@ log_stern & function upgrade() { # pull and resolve the image just to be absolutely sure k8s gets the latest image in the tag we want - docker pull aztecprotocol/aztec:$TAG + docker pull --platform linux/amd64 aztecprotocol/aztec:$TAG IMAGE=$(docker inspect --format='{{index .RepoDigests 0}}' aztecprotocol/aztec:$TAG) - helm upgrade --install $NAMESPACE $SCRIPT_DIR/../aztec-network \ - --namespace $NAMESPACE \ - --create-namespace \ - --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml \ - --set images.aztec.image="$IMAGE" \ - --set network.public=true \ - --wait \ - --wait-for-jobs=true \ - --timeout=30m 2>&1 + if ! [ -z "${PRINT_ONLY:-}" ] ; then + helm template $NAMESPACE $SCRIPT_DIR/../aztec-network \ + --namespace $NAMESPACE \ + --create-namespace \ + --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml \ + --set images.aztec.image="$IMAGE" \ + --set network.public=true + else + helm upgrade --install $NAMESPACE $SCRIPT_DIR/../aztec-network \ + --namespace $NAMESPACE \ + --create-namespace \ + --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml \ + --set images.aztec.image="$IMAGE" \ + --set network.public=true \ + --wait \ + --wait-for-jobs=true \ + --timeout=30m 2>&1 + fi } -# docker inspect --format='{{index .RepoDigests 0}}' aztecprotocol/aztec:master + if ! upgrade | tee "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then if grep 'cannot patch "'$NAMESPACE'-aztec-network-setup-l2-contracts"' "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then kubectl delete job $NAMESPACE-aztec-network-setup-l2-contracts -n $NAMESPACE diff --git a/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh b/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh index 98393c402139..d9a253a7b830 100755 --- a/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh +++ b/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh @@ -8,17 +8,21 @@ SCRIPT_NAME=$(basename "$0" .sh) # Redirect stdout and stderr to .log while also printing to the console exec > >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log") 2> >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log" >&2) +export BOOTNODE_URL=${BOOTNODE_URL:-http://127.0.0.1:8079} +export PXE_URL=${PXE_URL:-http://127.0.0.1:8079} +export ETHEREUM_HOST=${ETHEREUM_HOST:-http://127.0.0.1:8545} + REPO=$(git rev-parse --show-toplevel) # Run our test assuming the port in pxe.sh # Wait for the Aztec Node to be ready echo "Waiting for Aztec Node..." -until curl -s http://127.0.0.1:8080/status >/dev/null ; do +until curl -s $BOOTNODE_URL/status >/dev/null ; do sleep 1 done echo "Waiting for PXE service..." until curl -s -X POST -H 'content-type: application/json' \ -d '{"jsonrpc":"2.0","method":"pxe_getNodeInfo","params":[],"id":67}' \ - http://127.0.0.1:8079 | grep -q '"enr:-'; do + $PXE_URL | grep -q '"enr:-'; do sleep 1 done echo "Waiting for l2 contracts to be deployed..." @@ -29,7 +33,5 @@ echo "Done waiting." export DEBUG="aztec:*" export LOG_LEVEL=${LOG_LEVEL:-"debug"} -export PXE_URL=http://localhost:8079 -export ETHEREUM_HOST=http://127.0.0.1:8545 cd $(git rev-parse --show-toplevel)/yarn-project/end-to-end yarn test src/spartan/4epochs.test.ts \ No newline at end of file diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 3ab0b5fdb19c..3746527c23a9 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -19,7 +19,7 @@ TEST="$1" REPO=$(git rev-parse --show-toplevel) if [ "$(uname)" = "Linux" ] && [ "$(uname -m)" = "x86_64" ]; then # Use a lock so this can be ran in parallel - flock setup_local_k8s.lock "$REPO"/spartan/scripts/setup_local_k8s.sh + flock ~/setup_local_k8s.lock "$REPO"/spartan/scripts/setup_local_k8s.sh else echo "Not on x64 Linux, not installing k8s and helm." fi From f34742e5155eb1872378ce1cb3653a7ffa775c93 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 22:18:17 +0000 Subject: [PATCH 25/45] allow native-network scripts to be called --- .../scripts/native-network/deploy-l2-contracts.sh | 8 +------- .../end-to-end/scripts/native-network/test-4epochs.sh | 2 +- .../end-to-end/scripts/native-network/test-transfer.sh | 10 ++++++---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/yarn-project/end-to-end/scripts/native-network/deploy-l2-contracts.sh b/yarn-project/end-to-end/scripts/native-network/deploy-l2-contracts.sh index 4c32ca456990..a38d05844793 100755 --- a/yarn-project/end-to-end/scripts/native-network/deploy-l2-contracts.sh +++ b/yarn-project/end-to-end/scripts/native-network/deploy-l2-contracts.sh @@ -29,10 +29,4 @@ node --no-warnings $(git rev-parse --show-toplevel)/yarn-project/aztec/dest/bin/ echo "Deployed L2 contracts" # Use file just as done signal echo "" > state/l2-contracts.env -echo "Wrote to state/l2-contracts.env to signal completion" - -# sleep 5 -# function close_tmux_pane() { -# tmux kill-pane -t $(tmux display -p '#{pane_id}') -# } -# close_tmux_pane 2>/dev/null || true \ No newline at end of file +echo "Wrote to state/l2-contracts.env to signal completion" \ No newline at end of file diff --git a/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh b/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh index d9a253a7b830..84a7afc4e6ef 100755 --- a/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh +++ b/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh @@ -8,7 +8,7 @@ SCRIPT_NAME=$(basename "$0" .sh) # Redirect stdout and stderr to .log while also printing to the console exec > >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log") 2> >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log" >&2) -export BOOTNODE_URL=${BOOTNODE_URL:-http://127.0.0.1:8079} +export BOOTNODE_URL=${BOOTNODE_URL:-http://127.0.0.1:8080} export PXE_URL=${PXE_URL:-http://127.0.0.1:8079} export ETHEREUM_HOST=${ETHEREUM_HOST:-http://127.0.0.1:8545} diff --git a/yarn-project/end-to-end/scripts/native-network/test-transfer.sh b/yarn-project/end-to-end/scripts/native-network/test-transfer.sh index 93e218a045e3..d430f6f94b16 100755 --- a/yarn-project/end-to-end/scripts/native-network/test-transfer.sh +++ b/yarn-project/end-to-end/scripts/native-network/test-transfer.sh @@ -8,17 +8,20 @@ SCRIPT_NAME=$(basename "$0" .sh) # Redirect stdout and stderr to .log while also printing to the console exec > >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log") 2> >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log" >&2) +export BOOTNODE_URL=${BOOTNODE_URL:-http://127.0.0.1:8080} +export PXE_URL=${PXE_URL:-http://127.0.0.1:8079} + REPO=$(git rev-parse --show-toplevel) # Run our test assuming the port in pxe.sh # Wait for the Aztec Node to be ready echo "Waiting for Aztec Node..." -until curl -s http://127.0.0.1:8080/status >/dev/null ; do +until curl -s $BOOTNODE_URL/status >/dev/null ; do sleep 1 done echo "Waiting for PXE service..." until curl -s -X POST -H 'content-type: application/json' \ -d '{"jsonrpc":"2.0","method":"pxe_getNodeInfo","params":[],"id":67}' \ - http://127.0.0.1:8079 | grep -q '"enr:-'; do + $PXE_URL | grep -q '"enr:-'; do sleep 1 done echo "Waiting for l2 contracts to be deployed..." @@ -29,6 +32,5 @@ echo "Done waiting." export DEBUG="aztec:*" export LOG_LEVEL=${LOG_LEVEL:-"debug"} -export PXE_URL=http://localhost:8079 cd $(git rev-parse --show-toplevel)/yarn-project/end-to-end -yarn test src/spartan/transfer.test.ts +yarn test src/spartan/transfer.test.ts \ No newline at end of file From 34d0d7a99a2f2b8a5481fb64f86f2cffcdd5a5d1 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 22:37:10 +0000 Subject: [PATCH 26/45] bett flock --- .github/ensure-builder/action.yml | 2 +- .github/ensure-tester-with-images/action.yml | 2 +- scripts/earthly-ci | 2 +- yarn-project/end-to-end/scripts/network_test.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ensure-builder/action.yml b/.github/ensure-builder/action.yml index ab2a9e95d39b..d354fc191376 100644 --- a/.github/ensure-builder/action.yml +++ b/.github/ensure-builder/action.yml @@ -86,7 +86,7 @@ runs: if ! scripts/run_on_builder "[ -d ~/run-$RUN_ID ]" ; then echo "Copying local repo to spot" (tar czf - .git || true) | scripts/run_on_builder \ - "flock ~/git.lock bash -c '$UNPACK'" + "flock /var/lock/git.lock bash -c '$UNPACK'" fi - name: Attach EBS Cache Disk diff --git a/.github/ensure-tester-with-images/action.yml b/.github/ensure-tester-with-images/action.yml index d623c1bca52f..b9e1ceddb89b 100644 --- a/.github/ensure-tester-with-images/action.yml +++ b/.github/ensure-tester-with-images/action.yml @@ -31,7 +31,7 @@ runs: for image in ${{ inputs.builder_images_to_copy }} ; do if ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "$image" ; then export FORCE_COLOR=1 - flock submodule.lock git submodule update --init --recursive --recommend-shallow + flock /var/lock/submodule.lock git submodule update --init --recursive --recommend-shallow ${{ inputs.builder_command }} break fi diff --git a/scripts/earthly-ci b/scripts/earthly-ci index 789b5e52e5a9..6a44a269e924 100755 --- a/scripts/earthly-ci +++ b/scripts/earthly-ci @@ -23,7 +23,7 @@ export FORCE_COLOR=1 export EARTHLY_CONFIG=$(git rev-parse --show-toplevel)/.github/earthly-ci-config.yml function wipe_non_cache_docker_state { - flock -n "$HOME/wipe_docker_state.lock" bash -c ' + flock -n "/var/lock/wipe_docker_state.lock" bash -c ' echo "Detected corrupted docker images. Wiping and trying again." # Based on https://stackoverflow.com/a/75849307 # wipe everything but volumes where we have earthly cache diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 3746527c23a9..abd7575a6621 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -19,7 +19,7 @@ TEST="$1" REPO=$(git rev-parse --show-toplevel) if [ "$(uname)" = "Linux" ] && [ "$(uname -m)" = "x86_64" ]; then # Use a lock so this can be ran in parallel - flock ~/setup_local_k8s.lock "$REPO"/spartan/scripts/setup_local_k8s.sh + flock /var/lock/setup_local_k8s.lock "$REPO"/spartan/scripts/setup_local_k8s.sh else echo "Not on x64 Linux, not installing k8s and helm." fi From 7fe087ad5f996e52360c8e59f309fc2424970307 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 22:42:50 +0000 Subject: [PATCH 27/45] revert --- docker-compose.provernet.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.provernet.yml b/docker-compose.provernet.yml index e6893c903c4d..58bb54087c46 100644 --- a/docker-compose.provernet.yml +++ b/docker-compose.provernet.yml @@ -10,13 +10,13 @@ services: command: > 'anvil --block-time 12 --host 0.0.0.0 --chain-id 31337 --port 8545 --silent' ports: - - 10545:8545 + - 8545:8545 # Single Aztec node with a sequencer for building and publishing unproven blocks to L1 aztec-node: image: "aztecprotocol/${IMAGE:-aztec:master}" ports: - - "10080:80" + - "8080:80" environment: LOG_LEVEL: info ETHEREUM_HOST: http://ethereum:8545 @@ -56,7 +56,7 @@ services: aztec-prover: image: "aztecprotocol/${IMAGE:-aztec:master}" ports: - - "10083:80" + - "8083:80" environment: LOG_LEVEL: verbose ETHEREUM_HOST: http://ethereum:8545 @@ -90,7 +90,7 @@ services: aztec-prover-agent: image: "aztecprotocol/${IMAGE:-aztec:master}" ports: - - "10090:80" + - "8090:80" environment: LOG_LEVEL: verbose ETHEREUM_HOST: http://ethereum:8545 @@ -123,7 +123,7 @@ services: aztec-bot: image: "aztecprotocol/${IMAGE:-aztec:master}" ports: - - "10082:80" + - "8082:80" environment: LOG_LEVEL: info ETHEREUM_HOST: http://ethereum:8545 From c2e22b441697f6946df9ef62d68ee54f4f085949 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 22:53:57 +0000 Subject: [PATCH 28/45] kind network e2e --- .github/workflows/ci.yml | 18 +++++++++++++++++- .../end-to-end/scripts/network_test.sh | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aea06badcb6c..a13ac738a1cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -659,7 +659,23 @@ jobs: test: ${{ matrix.test }} # Only allow transfer test to run on every (non-network-all) PR if: matrix.test == 'smoke.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') - run: NAMESPACE="${test%.test.ts}" FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/$test + run: + - name: Setup and KIND Network Test + timeout-minutes: 40 + uses: ./.github/ensure-tester-with-images + env: + USERNAME: ${{ needs.configure.outputs.username }} + with: + runner_type: 8core-tester-x86 + builder_type: builder-x86 + # these are copied to the tester and expected by the earthly command below + # if they fail to copy, it will try to build them on the tester and fail + builder_images_to_copy: aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/end-to-end:${{ env.GIT_COMMIT }} + # command to produce the images in case they don't exist + builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images + run: | + cd yarn-project/end-to-end + NAMESPACE="${test%.test.ts}" FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/$test l1-contracts-test: needs: [build, configure] diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index abd7575a6621..dc696f6d187a 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -19,7 +19,7 @@ TEST="$1" REPO=$(git rev-parse --show-toplevel) if [ "$(uname)" = "Linux" ] && [ "$(uname -m)" = "x86_64" ]; then # Use a lock so this can be ran in parallel - flock /var/lock/setup_local_k8s.lock "$REPO"/spartan/scripts/setup_local_k8s.sh + "$REPO"/spartan/scripts/setup_local_k8s.sh else echo "Not on x64 Linux, not installing k8s and helm." fi @@ -86,7 +86,7 @@ kubectl wait pod -l app==pxe --for=condition=Ready -n "$NAMESPACE" --timeout=10m FREE_PORTS=$(comm -23 <(seq 9000 10000 | sort) <(ss -Htan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 2) # Extract the two free ports from the list -PXE_PORT=$(echo $FREE_PORTS | awk '{print $1}') +PXE_PORT=$(echo $FREE_POrRTS | awk '{print $1}') ANVIL_PORT=$(echo $FREE_PORTS | awk '{print $2}') # Namespace variable (assuming it's set) From 290d9ce3cba58339045a82459c05b432d61cb39c Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 22:54:52 +0000 Subject: [PATCH 29/45] add cluster test --- spartan/scripts/test_spartan.sh | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 spartan/scripts/test_spartan.sh diff --git a/spartan/scripts/test_spartan.sh b/spartan/scripts/test_spartan.sh new file mode 100755 index 000000000000..7af315d48c2b --- /dev/null +++ b/spartan/scripts/test_spartan.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# NOTE! currently does not work with 'cannot validate constraint' on tx simulate via pxe +set -eu +set -o pipefail + +# Test a deployed cluster + +NAMESPACE=${1:-spartan} +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +if [ -z "$NAMESPACE" ]; then + echo "Usage: $0 (optional: )" + echo "Example: $0 devnet" + exit 1 +fi + +echo "Note: Repo should be bootstrapped with ./bootstrap.sh fast." + +# Fetch the service URLs based on the namespace +export BOOTNODE_URL=http://$(kubectl get svc -n $NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='$NAMESPACE-aztec-network-boot-node-lb-tcp')].status.loadBalancer.ingress[0].hostname}"):8080 +export PXE_URL=http://$(kubectl get svc -n $NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='$NAMESPACE-aztec-network-pxe-lb')].status.loadBalancer.ingress[0].hostname}"):8080 +export ETHEREUM_HOST=http://$(kubectl get svc -n $NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='$NAMESPACE-aztec-network-ethereum-lb')].status.loadBalancer.ingress[0].hostname}"):8545 + +# Validate that the URLs were fetched correctly +if [ -z "$BOOTNODE_URL" ] || [ -z "$PXE_URL" ] || [ -z "$ETHEREUM_HOST" ]; then + echo "Error: Failed to retrieve one or more URLs from Kubernetes services." + exit 1 +fi + +echo "BOOTNODE_URL: $BOOTNODE_URL" +echo "PXE_URL: $PXE_URL" +echo "ETHEREUM_HOST: $ETHEREUM_HOST" + +# hack to ensure L2 contracts are considered deployed +touch $SCRIPT_DIR/../../yarn-project/end-to-end/scripts/native-network/state/l2-contracts.env +bash -x $SCRIPT_DIR/../../yarn-project/end-to-end/scripts/native-network/test-transfer.sh \ No newline at end of file From 79a9092aab6fe48e9866a591500951ea6edd4362 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 22:55:41 +0000 Subject: [PATCH 30/45] fix syntax --- .github/workflows/ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a13ac738a1cf..b4d5027e3751 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -652,14 +652,6 @@ jobs: - uses: ./.github/ci-setup-action with: concurrency_key: kind-network-test-${{ matrix.test }} - - name: "KIND Network Test" - timeout-minutes: 40 - working-directory: yarn-project/end-to-end - env: - test: ${{ matrix.test }} - # Only allow transfer test to run on every (non-network-all) PR - if: matrix.test == 'smoke.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') - run: - name: Setup and KIND Network Test timeout-minutes: 40 uses: ./.github/ensure-tester-with-images From 967e8fc7cd408c2fe691f978d1e84b0714624cca Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 23:01:14 +0000 Subject: [PATCH 31/45] make bot log better --- yarn-project/bot/src/bot.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yarn-project/bot/src/bot.ts b/yarn-project/bot/src/bot.ts index ab2b644204e9..635950828507 100644 --- a/yarn-project/bot/src/bot.ts +++ b/yarn-project/bot/src/bot.ts @@ -21,6 +21,9 @@ const TRANSFER_AMOUNT = 1; export class Bot { private log = createDebugLogger('aztec:bot'); + private attempts: number = 0; + private successes: number = 0; + protected constructor( public readonly wallet: Wallet, public readonly token: TokenContract | EasyPrivateTokenContract, @@ -39,6 +42,7 @@ export class Bot { } public async run() { + this.attempts++; const logCtx = { runId: Date.now() * 1000 + Math.floor(Math.random() * 1000) }; const { privateTransfersPerTx, publicTransfersPerTx, feePaymentMethod, followChain, txMinedWaitSeconds } = this.config; @@ -96,7 +100,8 @@ export class Bot { provenTimeout: txMinedWaitSeconds, proven: followChain === 'PROVEN', }); - this.log.info(`Tx ${receipt.txHash} mined in block ${receipt.blockNumber}`, logCtx); + this.log.info(`Tx #${this.attempts} ${receipt.txHash} successfully mined in block ${receipt.blockNumber} (stats: ${this.successes}/${this.attempts} success)`, logCtx); + this.successes++; } public async getBalances() { From 3b01d14b9483447c1649e8b76f0d5f2def66f962 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 23:36:12 +0000 Subject: [PATCH 32/45] fix --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4d5027e3751..6eb791d7a3ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -667,6 +667,7 @@ jobs: builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images run: | cd yarn-project/end-to-end + test=${{ matrix.test }} NAMESPACE="${test%.test.ts}" FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/$test l1-contracts-test: From 6db13a7a8b0e249034d5e8f9404b2031c880bc56 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 23:41:28 +0000 Subject: [PATCH 33/45] more verbose tests --- yarn-project/end-to-end/scripts/native-network/test-4epochs.sh | 2 +- yarn-project/end-to-end/scripts/native-network/test-transfer.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh b/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh index 84a7afc4e6ef..3edbcd486372 100755 --- a/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh +++ b/yarn-project/end-to-end/scripts/native-network/test-4epochs.sh @@ -34,4 +34,4 @@ echo "Done waiting." export DEBUG="aztec:*" export LOG_LEVEL=${LOG_LEVEL:-"debug"} cd $(git rev-parse --show-toplevel)/yarn-project/end-to-end -yarn test src/spartan/4epochs.test.ts \ No newline at end of file +DEBUG=aztec:* yarn test src/spartan/4epochs.test.ts \ No newline at end of file diff --git a/yarn-project/end-to-end/scripts/native-network/test-transfer.sh b/yarn-project/end-to-end/scripts/native-network/test-transfer.sh index d430f6f94b16..fe9a8fc2004b 100755 --- a/yarn-project/end-to-end/scripts/native-network/test-transfer.sh +++ b/yarn-project/end-to-end/scripts/native-network/test-transfer.sh @@ -33,4 +33,4 @@ echo "Done waiting." export DEBUG="aztec:*" export LOG_LEVEL=${LOG_LEVEL:-"debug"} cd $(git rev-parse --show-toplevel)/yarn-project/end-to-end -yarn test src/spartan/transfer.test.ts \ No newline at end of file +DEBUG=aztec:* yarn test src/spartan/transfer.test.ts \ No newline at end of file From ecfb39b92de716cf951540b5ec0009a31f046759 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 23 Oct 2024 23:55:53 +0000 Subject: [PATCH 34/45] fix formatting --- yarn-project/bot/src/bot.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yarn-project/bot/src/bot.ts b/yarn-project/bot/src/bot.ts index 635950828507..f0eefb75daa4 100644 --- a/yarn-project/bot/src/bot.ts +++ b/yarn-project/bot/src/bot.ts @@ -100,7 +100,10 @@ export class Bot { provenTimeout: txMinedWaitSeconds, proven: followChain === 'PROVEN', }); - this.log.info(`Tx #${this.attempts} ${receipt.txHash} successfully mined in block ${receipt.blockNumber} (stats: ${this.successes}/${this.attempts} success)`, logCtx); + this.log.info( + `Tx #${this.attempts} ${receipt.txHash} successfully mined in block ${receipt.blockNumber} (stats: ${this.successes}/${this.attempts} success)`, + logCtx, + ); this.successes++; } From 58b170093ad37334c4b63cd02e38a5dd3cb00761 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 24 Oct 2024 00:14:13 +0000 Subject: [PATCH 35/45] auth pulls --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6eb791d7a3ed..2166fca4f04c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -667,6 +667,7 @@ jobs: builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images run: | cd yarn-project/end-to-end + echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin test=${{ matrix.test }} NAMESPACE="${test%.test.ts}" FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/$test From 7449ef2d0858781217c2dc139ecff95e6c88b500 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 24 Oct 2024 02:38:04 +0000 Subject: [PATCH 36/45] try fix? --- spartan/aztec-network/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spartan/aztec-network/values.yaml b/spartan/aztec-network/values.yaml index 3378d4a9ea4d..8905fc155eba 100644 --- a/spartan/aztec-network/values.yaml +++ b/spartan/aztec-network/values.yaml @@ -12,7 +12,7 @@ telemetry: images: aztec: image: aztecprotocol/aztec - pullPolicy: Always + pullPolicy: IfNotPresent curl: image: curlimages/curl:7.81.0 pullPolicy: IfNotPresent From b7f430799e2686d2fa069dca8a443a270fbaedb2 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 24 Oct 2024 03:05:05 +0000 Subject: [PATCH 37/45] fix --- yarn-project/end-to-end/scripts/network_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index dc696f6d187a..31e1a7b7c586 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -86,7 +86,7 @@ kubectl wait pod -l app==pxe --for=condition=Ready -n "$NAMESPACE" --timeout=10m FREE_PORTS=$(comm -23 <(seq 9000 10000 | sort) <(ss -Htan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 2) # Extract the two free ports from the list -PXE_PORT=$(echo $FREE_POrRTS | awk '{print $1}') +PXE_PORT=$(echo $FREE_PORTS | awk '{print $1}') ANVIL_PORT=$(echo $FREE_PORTS | awk '{print $2}') # Namespace variable (assuming it's set) From b6bcf358caebfcf2f17cb6f8655afa70acdd9117 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 24 Oct 2024 12:59:56 +0000 Subject: [PATCH 38/45] fix --- yarn-project/end-to-end/scripts/network_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 31e1a7b7c586..92179664313d 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -97,9 +97,9 @@ NAMESPACE=${NAMESPACE:-default} (kubectl port-forward --namespace $NAMESPACE svc/spartan-aztec-network-ethereum $ANVIL_PORT:8545 2>/dev/null >/dev/null || true) & docker run --rm --network=host \ - -e PXE_URL=http://127.0.0.1:9082 \ + -e PXE_URL=http://127.0.0.1:$PXE_PORT \ -e DEBUG="aztec:*" \ -e LOG_LEVEL=debug \ - -e ETHEREUM_HOST=http://127.0.0.1:9545 \ + -e ETHEREUM_HOST=http://127.0.0.1:$ANVIL_PORT \ -e LOG_JSON=1 \ aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG $TEST From 5e6a68c5d3d07429e2922aeee17584851d82f327 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 24 Oct 2024 10:38:13 -0400 Subject: [PATCH 39/45] Update Earthfile [skip ci] --- yarn-project/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/Earthfile b/yarn-project/Earthfile index 7cb827a4ec5c..61415b0c0db1 100644 --- a/yarn-project/Earthfile +++ b/yarn-project/Earthfile @@ -282,7 +282,7 @@ prover-client-test: # NOTE: This is not in the end-to-end Earthfile as that is entirely LOCALLY commands that will go away sometime. # Running this inside the main builder as the point is not to run this through dockerization. network-test: - ARG test=src/spartan/transfer.test.ts + ARG test=./test-transfer.sh FROM +build WORKDIR /usr/src/ # Bare minimum git setup to run 'git rev-parse --show-toplevel' From 0d172c3adf8c3656aafc60bd0d6b54c11ee41b2a Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 24 Oct 2024 15:47:19 +0000 Subject: [PATCH 40/45] better kind config --- .github/ensure-builder/action.yml | 4 +++- .github/workflows/ci.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/ensure-builder/action.yml b/.github/ensure-builder/action.yml index d354fc191376..8c6df0739740 100644 --- a/.github/ensure-builder/action.yml +++ b/.github/ensure-builder/action.yml @@ -11,6 +11,8 @@ inputs: run: # command to run once builder/tester available required: false + spot_strategy: + default: BestEffort runs: # define an action, runs in OS of caller using: composite @@ -21,7 +23,7 @@ runs: run: | TYPE=${{ inputs.runner_type }} # Try to use spot for every runner type for now - echo "spot_strategy=BestEffort" >> $GITHUB_OUTPUT + echo "spot_strategy=${{ inputs.spot_strategy }}" >> $GITHUB_OUTPUT echo "runner_label=$USERNAME-$runner_type" >> $GITHUB_OUTPUT if [[ $TYPE == builder-x86 ]]; then # 128-core x86 instance types, aws chooses for us based on capacity diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2166fca4f04c..aea52184115b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -653,12 +653,13 @@ jobs: with: concurrency_key: kind-network-test-${{ matrix.test }} - name: Setup and KIND Network Test - timeout-minutes: 40 + timeout-minutes: 60 uses: ./.github/ensure-tester-with-images env: USERNAME: ${{ needs.configure.outputs.username }} with: runner_type: 8core-tester-x86 + spot_strategy: None # use on-demand machines builder_type: builder-x86 # these are copied to the tester and expected by the earthly command below # if they fail to copy, it will try to build them on the tester and fail @@ -666,6 +667,7 @@ jobs: # command to produce the images in case they don't exist builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images run: | + sudo shutdown -P 60 # extend ttl cd yarn-project/end-to-end echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin test=${{ matrix.test }} From a8facaba43c8fd261824bbe18a989a9d06f044cf Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 24 Oct 2024 15:47:52 +0000 Subject: [PATCH 41/45] Update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aea52184115b..ad9e88427a38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -632,7 +632,7 @@ jobs: - uses: ./.github/ci-setup-action with: concurrency_key: network-test-${{ matrix.test }} - - name: "Prover Client Tests" + - name: "Setup and Local Network Tests" timeout-minutes: 40 # Only allow transfer test to run on every (non-network-all) PR if: matrix.test == 'transfer.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') From ad84fc33efaf5eaaa51348d9211b938fca0190aa Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 24 Oct 2024 12:34:40 -0400 Subject: [PATCH 42/45] Update test_spartan.sh --- spartan/scripts/test_spartan.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/spartan/scripts/test_spartan.sh b/spartan/scripts/test_spartan.sh index 7af315d48c2b..f6b3bbe2e9a2 100755 --- a/spartan/scripts/test_spartan.sh +++ b/spartan/scripts/test_spartan.sh @@ -1,5 +1,5 @@ #!/bin/bash -# NOTE! currently does not work with 'cannot validate constraint' on tx simulate via pxe +# Targets a running cluster and tests 5 slots worth of transfers against it. set -eu set -o pipefail @@ -16,21 +16,15 @@ fi echo "Note: Repo should be bootstrapped with ./bootstrap.sh fast." -# Fetch the service URLs based on the namespace +# Fetch the service URLs based on the namespace for injection in the test-transfer.sh export BOOTNODE_URL=http://$(kubectl get svc -n $NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='$NAMESPACE-aztec-network-boot-node-lb-tcp')].status.loadBalancer.ingress[0].hostname}"):8080 export PXE_URL=http://$(kubectl get svc -n $NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='$NAMESPACE-aztec-network-pxe-lb')].status.loadBalancer.ingress[0].hostname}"):8080 export ETHEREUM_HOST=http://$(kubectl get svc -n $NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='$NAMESPACE-aztec-network-ethereum-lb')].status.loadBalancer.ingress[0].hostname}"):8545 -# Validate that the URLs were fetched correctly -if [ -z "$BOOTNODE_URL" ] || [ -z "$PXE_URL" ] || [ -z "$ETHEREUM_HOST" ]; then - echo "Error: Failed to retrieve one or more URLs from Kubernetes services." - exit 1 -fi - echo "BOOTNODE_URL: $BOOTNODE_URL" echo "PXE_URL: $PXE_URL" echo "ETHEREUM_HOST: $ETHEREUM_HOST" # hack to ensure L2 contracts are considered deployed touch $SCRIPT_DIR/../../yarn-project/end-to-end/scripts/native-network/state/l2-contracts.env -bash -x $SCRIPT_DIR/../../yarn-project/end-to-end/scripts/native-network/test-transfer.sh \ No newline at end of file +bash -x $SCRIPT_DIR/../../yarn-project/end-to-end/scripts/native-network/test-transfer.sh From 7c291d76abf4e2f4fe1f279ea896e1c999110c18 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 24 Oct 2024 12:36:10 -0400 Subject: [PATCH 43/45] Update deploy_spartan.sh --- spartan/scripts/deploy_spartan.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index c1ed82944ca3..85d7b12e1a82 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -62,9 +62,10 @@ function upgrade() { fi } +# running the helm upgrade, but will try again if the setup l2 contracts job complains about being immutable if ! upgrade | tee "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then if grep 'cannot patch "'$NAMESPACE'-aztec-network-setup-l2-contracts"' "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then kubectl delete job $NAMESPACE-aztec-network-setup-l2-contracts -n $NAMESPACE upgrade fi -fi \ No newline at end of file +fi From cf8bc73c4cfd1d7ba2411358a2f7b28010f2c7a1 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 24 Oct 2024 12:38:17 -0400 Subject: [PATCH 44/45] Update ci.yml --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad9e88427a38..9ca8c0658d46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -635,7 +635,7 @@ jobs: - name: "Setup and Local Network Tests" timeout-minutes: 40 # Only allow transfer test to run on every (non-network-all) PR - if: matrix.test == 'transfer.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, matrix.test) || contains(github.event.pull_request.labels.*.name, 'network-all') + if: matrix.test == 'test-transfer.sh' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all') run: earthly-ci --no-output ./yarn-project/+network-test --test=./${{ matrix.test }} # note: proving disabled @@ -655,6 +655,7 @@ jobs: - name: Setup and KIND Network Test timeout-minutes: 60 uses: ./.github/ensure-tester-with-images + if: matrix.test == 'smoke.test.ts' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all') env: USERNAME: ${{ needs.configure.outputs.username }} with: From c3c3fdb43ea994b8c89560b3861bb21727b09687 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 24 Oct 2024 12:40:02 -0400 Subject: [PATCH 45/45] Update network_test.sh --- yarn-project/end-to-end/scripts/network_test.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 92179664313d..b2a83d4b8efe 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -18,7 +18,6 @@ TEST="$1" REPO=$(git rev-parse --show-toplevel) if [ "$(uname)" = "Linux" ] && [ "$(uname -m)" = "x86_64" ]; then - # Use a lock so this can be ran in parallel "$REPO"/spartan/scripts/setup_local_k8s.sh else echo "Not on x64 Linux, not installing k8s and helm."