From adb7f37a4ad01acf1ef197189a1e78323cae8f0b Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 7 May 2024 16:12:56 -0400 Subject: [PATCH] chore(ci): fix restarts with fresh spot, acir test fixes, non-mandatory benches (#6226) Co-authored-by: Santiago Palladino --- .github/workflows/ci.yml | 36 ++- .github/workflows/setup-runner.yml | 4 +- barretenberg/acir_tests/Dockerfile.bb | 26 --- barretenberg/cpp/Earthfile | 3 + noir/.gitignore | 3 +- noir/Earthfile | 304 +++++++++++--------------- scripts/earthly-ci | 21 +- 7 files changed, 190 insertions(+), 207 deletions(-) delete mode 100644 barretenberg/acir_tests/Dockerfile.bb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d6db808cf3..2080e99f79c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,11 +52,14 @@ jobs: run: earthly-ci ./yarn-project+export-e2e-test-images # We base our e2e list used in e2e-x86 off the targets in ./yarn-project/end-to-end # (Note ARM uses just 2 tests as a smoketest) - - name: Create list of end-to-end jobs + - name: Create list of non-bench end-to-end jobs id: e2e_list - run: echo "list=$(earthly ls ./yarn-project/end-to-end | grep -v '+base' | sed 's/+//' | jq -R . | jq -cs .)" >> $GITHUB_OUTPUT + run: echo "list=$(earthly ls ./yarn-project/end-to-end | grep -v '+base' | grep -v '+bench' | sed 's/+//' | jq -R . | jq -cs .)" >> $GITHUB_OUTPUT + - name: Create list of bench end-to-end jobs + id: bench_list + run: echo "list=$(earthly ls ./yarn-project/end-to-end | grep '+bench' | sed 's/+//' | jq -R . | jq -cs .)" >> $GITHUB_OUTPUT - # all the end-to-end integration tests for aztec + # all the non-bench end-to-end integration tests for aztec e2e: needs: build runs-on: ${{ inputs.username || github.actor }}-x86 @@ -81,6 +84,31 @@ jobs: --no-output \ +${{ matrix.test }} --skip_build=true + # all the benchmarking end-to-end integration tests for aztec (not required to merge) + bench-e2e: + needs: build + runs-on: ${{ inputs.username || github.actor }}-x86 + strategy: + fail-fast: false + matrix: + test: ${{ fromJson( needs.build.outputs.bench_list )}} + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ github.event.pull_request.head.sha }}" } + - uses: ./.github/ci-setup-action + with: + dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}" + # must be globally unique for build x runner + concurrency_key: e2e-${{ inputs.username || github.actor }}-x86-${{ matrix.test }} + - name: Test + working-directory: ./yarn-project/end-to-end/ + timeout-minutes: 25 + run: earthly-ci -P \ + --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \ + --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \ + --no-output \ + +${{ matrix.test }} --skip_build=true + # bench-summary: # needs: e2e # runs-on: ${{ inputs.username || github.actor }}-x86 @@ -112,7 +140,7 @@ jobs: # barretenberg (prover) native and AVM (public VM) tests # only ran on x86 for resource reasons (memory intensive) bb-native-tests: - needs: build + needs: setup runs-on: ${{ inputs.username || github.actor }}-x86 steps: - { diff --git a/.github/workflows/setup-runner.yml b/.github/workflows/setup-runner.yml index dff8f10cff3..658e5b581ba 100644 --- a/.github/workflows/setup-runner.yml +++ b/.github/workflows/setup-runner.yml @@ -147,4 +147,6 @@ jobs: fi - name: Run Earthly Bootstrap - run: earthly bootstrap + run: | + earthly bootstrap + touch /run/.earthly-bootstrap # Used in `earthly-ci` wrapper to check that earthly has been bootstrapped ok diff --git a/barretenberg/acir_tests/Dockerfile.bb b/barretenberg/acir_tests/Dockerfile.bb deleted file mode 100644 index 20cc12846df..00000000000 --- a/barretenberg/acir_tests/Dockerfile.bb +++ /dev/null @@ -1,26 +0,0 @@ -FROM aztecprotocol/barretenberg-x86_64-linux-clang-assert -FROM aztecprotocol/noir-compile-acir-tests as noir-acir-tests - -FROM node:18.19.0 -RUN apt update && apt install git bash curl jq coreutils -y -COPY --from=0 /usr/src/barretenberg/cpp/build /usr/src/barretenberg/cpp/build -COPY --from=noir-acir-tests /usr/src/noir/noir-repo/test_programs /usr/src/noir/noir-repo/test_programs -WORKDIR /usr/src/barretenberg/acir_tests -COPY . . -# Run every acir test through native bb build prove_then_verify flow for UltraPlonk. -# This ensures we test independent pk construction through real/garbage witness data paths. -RUN FLOW=prove_then_verify ./run_acir_tests.sh -# Construct and separately verify a UltraHonk proof for a single program -RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh double_verify_nested_proof -# Construct and separately verify a GoblinUltraHonk proof for all acir programs -RUN FLOW=prove_then_verify_goblin_ultra_honk ./run_acir_tests.sh -# Construct and verify a UltraHonk proof for a single program -RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh double_verify_nested_proof -# Construct and verify a Goblin UltraHonk (GUH) proof for a single arbitrary program -RUN FLOW=prove_and_verify_goblin_ultra_honk ./run_acir_tests.sh 6_array -# Construct and verify a UltraHonk proof for all ACIR programs using the new witness stack workflow -RUN FLOW=prove_and_verify_ultra_honk_program ./run_acir_tests.sh -# This is a "full" Goblin flow. It constructs and verifies four proofs: GoblinUltraHonk, ECCVM, Translator, and merge -RUN FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array -# Run 1_mul through native bb build, all_cmds flow, to test all cli args. -RUN VERBOSE=1 FLOW=all_cmds ./run_acir_tests.sh 1_mul diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index 7d3c42a6e64..7d97dbfd191 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -180,6 +180,9 @@ test-clang-format: test: ARG hardware_concurrency="" + # prefetch + BUILD +test-binaries + BUILD +preset-release-assert-test BUILD +test-clang-format BUILD ./srs_db/+build # prefetch FROM +source diff --git a/noir/.gitignore b/noir/.gitignore index 781ea857ba6..b211695f37c 100644 --- a/noir/.gitignore +++ b/noir/.gitignore @@ -1,2 +1,3 @@ **/package.tgz -packages \ No newline at end of file +packages +.earthly-staging \ No newline at end of file diff --git a/noir/Earthfile b/noir/Earthfile index 3fb400700b5..5f0f0c928f4 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -106,64 +106,64 @@ packages: SAVE IMAGE --cache-hint packages-test-build: - FROM +packages-deps + FROM +packages-deps - COPY +nargo/nargo /usr/src/noir/noir-repo/target/release/nargo - COPY +nargo/acvm /usr/src/noir/noir-repo/target/release/acvm + COPY +nargo/nargo /usr/src/noir/noir-repo/target/release/nargo + COPY +nargo/acvm /usr/src/noir/noir-repo/target/release/acvm - ENV NARGO_BACKEND_PATH=/usr/src/barretenberg/ts/dest/node/main.js - ENV PATH=$PATH:/usr/src/noir/noir-repo/target/release + ENV NARGO_BACKEND_PATH=/usr/src/barretenberg/ts/dest/node/main.js + ENV PATH=$PATH:/usr/src/noir/noir-repo/target/release - WORKDIR /usr/src/barretenberg/ts - RUN yarn --immutable + WORKDIR /usr/src/barretenberg/ts + RUN yarn --immutable - WORKDIR /usr/src/noir/noir-repo - COPY --dir noir-repo/.github/scripts/wasm-bindgen-install.sh ./.github/scripts/wasm-bindgen-install.sh - RUN ./.github/scripts/wasm-bindgen-install.sh + WORKDIR /usr/src/noir/noir-repo + COPY --dir noir-repo/.github/scripts/wasm-bindgen-install.sh ./.github/scripts/wasm-bindgen-install.sh + RUN ./.github/scripts/wasm-bindgen-install.sh - ENV SOURCE_DATE_EPOCH=$(date +%s) - ENV GIT_DIRTY=false - ENV GIT_COMMIT=$COMMIT_HASH - RUN yarn build - # this builds text fixtures to be used in tests - RUN yarn workspace @noir-lang/noir_wasm run test:build_fixtures + ENV SOURCE_DATE_EPOCH=$(date +%s) + ENV GIT_DIRTY=false + ENV GIT_COMMIT=$COMMIT_HASH + RUN yarn build + # this builds text fixtures to be used in tests + RUN yarn workspace @noir-lang/noir_wasm run test:build_fixtures - SAVE ARTIFACT /usr/src /usr/src + SAVE ARTIFACT /usr/src /usr/src packages-test-node: - FROM +packages-test-build - ENV NODE_OPTIONS=--max_old_space_size=8192 - WORKDIR /usr/src/noir/noir-repo - RUN yarn workspaces foreach \ - --parallel \ - --verbose \ - --exclude @noir-lang/root \ # foreach includes the root workspace, ignore it - --exclude @noir-lang/noir_js \ # noir_js OOMs - --exclude integration-tests \ # separate node and browser tests - --exclude @noir-lang/noir_wasm \ - run test - RUN yarn workspaces foreach \ - --parallel \ - --verbose \ - --include integration-tests \ - --include @noir-lang/noir_wasm \ - run test:node + FROM +packages-test-build + ENV NODE_OPTIONS=--max_old_space_size=8192 + WORKDIR /usr/src/noir/noir-repo + RUN yarn workspaces foreach \ + --parallel \ + --verbose \ + --exclude @noir-lang/root \ # foreach includes the root workspace, ignore it + --exclude @noir-lang/noir_js \ # noir_js OOMs + --exclude integration-tests \ # separate node and browser tests + --exclude @noir-lang/noir_wasm \ + run test + RUN yarn workspaces foreach \ + --parallel \ + --verbose \ + --include integration-tests \ + --include @noir-lang/noir_wasm \ + run test:node packages-test-browser: - FROM node:18 - COPY --dir +packages-test-build/usr/src /usr - WORKDIR /usr/src/noir/noir-repo - RUN ./.github/scripts/playwright-install.sh - RUN yarn workspaces foreach \ - --parallel \ - --verbose \ - --include integration-tests \ - --include @noir-lang/noir_wasm \ - run test:browser + FROM node:18 + COPY --dir +packages-test-build/usr/src /usr + WORKDIR /usr/src/noir/noir-repo + RUN ./.github/scripts/playwright-install.sh + RUN yarn workspaces foreach \ + --parallel \ + --verbose \ + --include integration-tests \ + --include @noir-lang/noir_wasm \ + run test:browser packages-test: - BUILD +packages-test-node - BUILD +packages-test-browser + BUILD +packages-test-node + BUILD +packages-test-browser run: # When running the container, mount the users home directory to same location. @@ -174,141 +174,101 @@ run: COPY +build/. /usr/src ENTRYPOINT ["/usr/bin/tini", "--", "/usr/src/nargo"] -build: - BUILD +nargo - BUILD +packages - build-acir-tests: - FROM ../build-images/+build - COPY +nargo/ /usr/src/noir-repo/target/release - ENV PATH="/usr/src/noir-repo/target/release:${PATH}" - WORKDIR /usr/src/noir-repo/test_programs - COPY ./noir-repo/test_programs/ /usr/src/noir-repo/test_programs/ - RUN /usr/src/noir-repo/target/release/nargo --version - # We run this with parallel compilation switched off, which isn't ideal. - # There seems to be problems with this when running under Earthly, see bottom of this file* - RUN ./rebuild.sh true - SAVE ARTIFACT /usr/src/noir-repo/test_programs/acir_artifacts/* + LOCALLY + # Prepare our exact dependency formula, this avoids problems with copied empty folders or build artifacts + RUN rm -rf .earthly-staging && mkdir -p .earthly-staging + RUN cp --parents $(git ls-files "noir-repo/test_programs/*.toml" "noir-repo/test_programs/*.nr" "noir-repo/test_programs/rebuild.sh") .earthly-staging + FROM ../build-images/+build + COPY +nargo/ /usr/src/noir-repo/target/release + ENV PATH="/usr/src/noir-repo/target/release:${PATH}" + WORKDIR /usr/src/noir-repo/test_programs + COPY .earthly-staging/noir-repo/test_programs /usr/src/noir-repo/test_programs/ + RUN /usr/src/noir-repo/target/release/nargo --version + # TODO(#6225): We have trouble with concurrency and pass 'true' to build in serial, see #6225 for details + RUN ./rebuild.sh true + SAVE ARTIFACT /usr/src/noir-repo/test_programs/acir_artifacts/* barretenberg-acir-tests-bb: - FROM ../build-images/+build - - COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb - COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests - COPY +build-acir-tests/ /usr/src/acir_artifacts - - WORKDIR /usr/src/barretenberg/acir_tests - RUN rm -rf ./acir_tests - - ENV TEST_SRC /usr/src/acir_artifacts - ENV VERBOSE=1 - # Run every acir test through native bb build prove_then_verify flow for UltraPlonk. - # This ensures we test independent pk construction through real/garbage witness data paths. - RUN FLOW=prove_then_verify ./run_acir_tests.sh - # Construct and separately verify a UltraHonk proof for a single program - RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh double_verify_nested_proof - # Construct and separately verify a GoblinUltraHonk proof for all acir programs - RUN FLOW=prove_then_verify_goblin_ultra_honk ./run_acir_tests.sh - # Construct and verify a UltraHonk proof for a single program - RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh double_verify_nested_proof - # Construct and verify a Goblin UltraHonk (GUH) proof for a single arbitrary program - RUN FLOW=prove_and_verify_goblin_ultra_honk ./run_acir_tests.sh 6_array - # Construct and verify a UltraHonk proof for all ACIR programs using the new witness stack workflow - RUN FLOW=prove_and_verify_ultra_honk_program ./run_acir_tests.sh - # This is a "full" Goblin flow. It constructs and verifies four proofs: GoblinUltraHonk, ECCVM, Translator, and merge - RUN FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array - # Run 1_mul through native bb build, all_cmds flow, to test all cli args. - RUN FLOW=all_cmds ./run_acir_tests.sh 1_mul + FROM ../build-images/+build + COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb + COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests + COPY +build-acir-tests/ /usr/src/acir_artifacts + + WORKDIR /usr/src/barretenberg/acir_tests + RUN rm -rf ./acir_tests + + ENV TEST_SRC /usr/src/acir_artifacts + ENV VERBOSE=1 + # Run every acir test through native bb build prove_then_verify flow for UltraPlonk. + # This ensures we test independent pk construction through real/garbage witness data paths. + RUN FLOW=prove_then_verify ./run_acir_tests.sh + # Construct and separately verify a UltraHonk proof for a single program + RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh double_verify_nested_proof + # Construct and separately verify a GoblinUltraHonk proof for all acir programs + RUN FLOW=prove_then_verify_goblin_ultra_honk ./run_acir_tests.sh + # Construct and verify a UltraHonk proof for a single program + RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh double_verify_nested_proof + # Construct and verify a Goblin UltraHonk (GUH) proof for a single arbitrary program + RUN FLOW=prove_and_verify_goblin_ultra_honk ./run_acir_tests.sh 6_array + # Construct and verify a UltraHonk proof for all ACIR programs using the new witness stack workflow + RUN FLOW=prove_and_verify_ultra_honk_program ./run_acir_tests.sh + # This is a "full" Goblin flow. It constructs and verifies four proofs: GoblinUltraHonk, ECCVM, Translator, and merge + RUN FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array + # Run 1_mul through native bb build, all_cmds flow, to test all cli args. + RUN FLOW=all_cmds ./run_acir_tests.sh 1_mul barretenberg-acir-tests-sol: - FROM ../build-images/+build + FROM ../build-images/+build - COPY ../barretenberg/cpp/+preset-sol/ /usr/src/barretenberg/cpp/build - COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb - COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests - COPY ../barretenberg/+sol/ /usr/src/barretenberg/sol - COPY +build-acir-tests/ /usr/src/acir_artifacts + COPY ../barretenberg/cpp/+preset-sol/ /usr/src/barretenberg/cpp/build + COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb + COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests + COPY ../barretenberg/+sol/ /usr/src/barretenberg/sol + COPY +build-acir-tests/ /usr/src/acir_artifacts - WORKDIR /usr/src/barretenberg/acir_tests + WORKDIR /usr/src/barretenberg/acir_tests - ENV TEST_SRC /usr/src/acir_artifacts - ENV VERBOSE=1 + ENV TEST_SRC /usr/src/acir_artifacts + ENV VERBOSE=1 - RUN (cd sol-test && yarn) - RUN PARALLEL=1 FLOW=sol ./run_acir_tests.sh assert_statement double_verify_proof double_verify_nested_proof + RUN (cd sol-test && yarn) + RUN PARALLEL=1 FLOW=sol ./run_acir_tests.sh assert_statement double_verify_proof double_verify_nested_proof barretenberg-acir-tests-bb.js: - # Playwright not supported on base image ubuntu:noble, results in unmet dependencies - FROM node:18.19.0 - RUN apt update && apt install -y curl jq lsof - - COPY ../barretenberg/ts/+build/build/ /usr/src/barretenberg/ts - COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests - COPY +build-acir-tests/ /usr/src/acir_artifacts - - WORKDIR /usr/src/barretenberg/acir_tests - - # Build/install ts apps. - RUN cd browser-test-app && yarn && yarn build - RUN cd headless-test && yarn && npx playwright install && npx playwright install-deps - RUN cd ../ts && yarn - ENV VERBOSE=1 - ENV TEST_SRC /usr/src/acir_artifacts - - # Run double_verify_proof through bb.js on node to check 512k support. - RUN BIN=../ts/dest/node/main.js FLOW=prove_then_verify ./run_acir_tests.sh double_verify_proof - # Run a single arbitrary test not involving recursion through bb.js for UltraHonk - RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh 6_array - # Run a single arbitrary test not involving recursion through bb.js for GoblinUltraHonk - RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_goblin_ultra_honk ./run_acir_tests.sh 6_array - # Run a single arbitrary test not involving recursion through bb.js for full Goblin - RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array - # Run 1_mul through bb.js build, all_cmds flow, to test all cli args. - RUN BIN=../ts/dest/node/main.js FLOW=all_cmds ./run_acir_tests.sh 1_mul - # Run double_verify_proof through bb.js on chrome testing multi-threaded browser support. - # TODO: Currently headless webkit doesn't seem to have shared memory so skipping multi-threaded test. - RUN BROWSER=chrome THREAD_MODEL=mt ./run_acir_tests_browser.sh double_verify_proof - # Run 1_mul through bb.js on chrome/webkit testing single threaded browser support. - RUN BROWSER=chrome THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul - # Commenting for now as fails intermittently. Unreproducable on mainframe. - # See https://github.com/AztecProtocol/aztec-packages/issues/2104 - #RUN BROWSER=webkit THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul - -#* Analysis of compiling Acir tests inside/outside Earthly -# Each test run compiles the full suite, either in series or in parallel, either inside or outside Earthly. -# Each test prints the contents of the target directory of the eddsa circuit after compilation -# You can see that the 'Inside Earthly Parallel' run has an acir.gz file of a different size -# This results in a proof that fails verification -# -# Outside Earthly Parallel - -# [eddsa] Circuit witness successfully solved -# [eddsa] Witness saved to /mnt/user-data/phil/aztec3-packages/noir/noir-repo/test_programs/execution_success/eddsa/target/witness.gz -# total 2544 -# -rw-rw-r-- 1 phil phil 904034 May 3 10:40 acir.gz -# -rw-rw-r-- 1 phil phil 1696442 May 3 10:40 witness.gz - -# Outside Earthly Series - -# [eddsa] Circuit witness successfully solved -# [eddsa] Witness saved to /mnt/user-data/phil/aztec3-packages/noir/noir-repo/test_programs/execution_success/eddsa/target/witness.gz -# total 2544 -# -rw-rw-r-- 1 phil phil 904034 May 3 10:43 acir.gz -# -rw-rw-r-- 1 phil phil 1696442 May 3 10:43 witness.gz - -# Inside Earthly Parallel - -# +build-acir-tests | [eddsa] Circuit witness successfully solved -# +build-acir-tests | [eddsa] Witness saved to /usr/src/noir-repo/test_programs/execution_success/eddsa/target/witness.gz -# +build-acir-tests | total 2472 -# +build-acir-tests | -rw-r--r-- 1 root root 830340 May 3 10:47 acir.gz -# +build-acir-tests | -rw-r--r-- 1 root root 1696442 May 3 10:47 witness.gz - -# Inside Earthly Series - -# +build-acir-tests | [eddsa] Circuit witness successfully solved -# +build-acir-tests | [eddsa] Witness saved to /usr/src/noir-repo/test_programs/execution_success/eddsa/target/witness.gz -# +build-acir-tests | total 2544 -# +build-acir-tests | -rw-r--r-- 1 root root 904034 May 3 10:50 acir.gz -# +build-acir-tests | -rw-r--r-- 1 root root 1696442 May 3 10:51 witness.gz + # Playwright not supported on base image ubuntu:noble, results in unmet dependencies + FROM node:18.19.0 + RUN apt update && apt install -y curl jq lsof + + COPY ../barretenberg/ts/+build/build/ /usr/src/barretenberg/ts + COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests + COPY +build-acir-tests/ /usr/src/acir_artifacts + + WORKDIR /usr/src/barretenberg/acir_tests + + # Build/install ts apps. + RUN cd browser-test-app && yarn && yarn build + RUN cd headless-test && yarn && npx playwright install && npx playwright install-deps + RUN cd ../ts && yarn + ENV VERBOSE=1 + ENV TEST_SRC /usr/src/acir_artifacts + + # Run double_verify_proof through bb.js on node to check 512k support. + RUN BIN=../ts/dest/node/main.js FLOW=prove_then_verify ./run_acir_tests.sh double_verify_proof + # Run a single arbitrary test not involving recursion through bb.js for UltraHonk + RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh 6_array + # Run a single arbitrary test not involving recursion through bb.js for GoblinUltraHonk + RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_goblin_ultra_honk ./run_acir_tests.sh 6_array + # Run a single arbitrary test not involving recursion through bb.js for full Goblin + RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array + # Run 1_mul through bb.js build, all_cmds flow, to test all cli args. + RUN BIN=../ts/dest/node/main.js FLOW=all_cmds ./run_acir_tests.sh 1_mul + # Run double_verify_proof through bb.js on chrome testing multi-threaded browser support. + # TODO: Currently headless webkit doesn't seem to have shared memory so skipping multi-threaded test. + RUN BROWSER=chrome THREAD_MODEL=mt ./run_acir_tests_browser.sh double_verify_proof + # Run 1_mul through bb.js on chrome/webkit testing single threaded browser support. + RUN BROWSER=chrome THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul + # Commenting for now as fails intermittently. Unreproducable on mainframe. + # See https://github.com/AztecProtocol/aztec-packages/issues/2104 + #RUN BROWSER=webkit THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul diff --git a/scripts/earthly-ci b/scripts/earthly-ci index 84ffc925c7b..e424c0a4201 100755 --- a/scripts/earthly-ci +++ b/scripts/earthly-ci @@ -3,6 +3,21 @@ # The silver lining is if Earthly does crash, the cache can pick up the build. set -eu -o pipefail +MAX_WAIT_TIME=300 # Maximum wait time in seconds +WAIT_INTERVAL=10 # Interval between checks in seconds +elapsed_time=0 + +while ! [ -f /run/.earthly-bootstrap ] ; do + echo "Did not detect .earthly-bootstrap. Waiting for runner to fully initialize..." + if [ $elapsed_time -ge $MAX_WAIT_TIME ]; then + echo "Earthly bootstrap did not become available within $MAX_WAIT_TIME seconds... did the runner start correctly?" + exit 1 + fi + + sleep $WAIT_INTERVAL + elapsed_time=$((elapsed_time + WAIT_INTERVAL)) +done + OUTPUT_FILE=$(mktemp) INCONSISTENT_GRAPH_STATE_COUNT=0 # Counter for 'inconsistent graph state' errors @@ -22,12 +37,12 @@ while [ $ATTEMPT_COUNT -lt $MAX_ATTEMPTS ]; do # Check the output for specific errors if grep 'failed to get edge: inconsistent graph state' $OUTPUT_FILE >/dev/null || grep 'failed to get state for index' $OUTPUT_FILE >/dev/null ; then INCONSISTENT_GRAPH_STATE_COUNT=$((INCONSISTENT_GRAPH_STATE_COUNT + 1)) - if [ "$INCONSISTENT_GRAPH_STATE_COUNT" -eq 2 ]; then + if [ "$INCONSISTENT_GRAPH_STATE_COUNT" -eq 3 ]; then echo "Unable to recover from 'inconsistent graph state' or 'failed to get state for index'. Connect to spot runner and run 'earthly prune'." exit 1 fi - echo "Got 'inconsistent graph state' or 'failed to get state for index'. Sleeping for 20 seconds and retrying." - sleep 20 + echo "Got 'inconsistent graph state' or 'failed to get state for index'. Sleeping for 30 seconds and retrying." + sleep 30 elif grep 'Error: pull ping error: pull ping response' $OUTPUT_FILE >/dev/null; then echo "Got 'Error: pull ping error: pull ping response', intermittent failure when writing out images to docker" elif grep '================================= System Info ==================================' $OUTPUT_FILE >/dev/null; then