From 781bf878636d5c97799c3a6173c9744aefb3e0c4 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Thu, 13 Jun 2024 18:46:05 +0000 Subject: [PATCH 01/15] Create workflow for full AVM tests --- .github/workflows/vm_full_tests.yml | 60 +++++++++++++++++++ barretenberg/cpp/Earthfile | 17 ++++++ .../barretenberg/vm/avm_trace/avm_common.hpp | 5 +- .../barretenberg/vm/avm_trace/avm_trace.hpp | 2 +- .../barretenberg/vm/tests/helpers.test.hpp | 5 +- 5 files changed, 81 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/vm_full_tests.yml diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml new file mode 100644 index 00000000000..6a926ecabc3 --- /dev/null +++ b/.github/workflows/vm_full_tests.yml @@ -0,0 +1,60 @@ +name: AVM Full Tests + +on: + schedule: + - cron: "15 4 * * 1-5" # Monday to Friday at 4:15 AM UTC + workflow_dispatch: + inputs: + username: + description: "Username (optional)" + required: false + action: + description: "Default to 'start'" + required: false + default: "start" + +concurrency: + # force parallelism in master + group: avm-full-tests-${{ github.ref }} + cancel-in-progress: true + +env: + DOCKERHUB_PASSWORD: "${{ secrets.DOCKERHUB_PASSWORD }}" + RUN_ID: ${{ github.run_id }} + RUN_ATTEMPT: ${{ github.run_attempt }} + USERNAME: ${{ github.event.pull_request.user.login || github.actor }} + GITHUB_TOKEN: ${{ github.token }} + GH_SELF_HOSTED_RUNNER_TOKEN: ${{ secrets.GH_SELF_HOSTED_RUNNER_TOKEN }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }} + GIT_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} + # kludge until we move away from runners + WAIT_FOR_RUNNERS: false + +jobs: + setup: + uses: ./.github/workflows/setup-runner.yml + with: + username: ${{ github.event.pull_request.user.login || github.actor }} + runner_type: builder-x86 + secrets: inherit + + # barretenberg (prover) native and AVM (public VM) tests + # only ran on x86 for resource reasons (memory intensive) + avm-full-tests: + needs: [setup] + runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + # Only allow one memory-hunger prover test to use this runner + - uses: ./.github/ci-setup-action + with: + # must be globally unique for build x runner + concurrency_key: avm-full-tests-x86 + - name: "AVM Full Tests" + working-directory: ./barretenberg/cpp/ + timeout-minutes: 70 + # limit our parallelism to half our cores + run: earthly-ci --no-output +vm-full-test --hardware_concurrency=64 diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index 831eb535d83..6e6df6244e6 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -247,6 +247,23 @@ test: END RUN cd build && GTEST_COLOR=1 ctest -j$(nproc) --output-on-failure +vm-full-test: + ARG hardware_concurrency="" + # prefetch + BUILD +test-binaries + BUILD +preset-release-assert-test + BUILD +test-clang-format + BUILD ./srs_db/+build # prefetch + FROM +source + COPY --dir +test-binaries/build build + FROM +preset-release-assert-test + COPY --dir ./srs_db/+build/. srs_db + # limit hardware concurrency, if provided + IF [ "$HARDWARE_CONCURRENCY" != "" ] + ENV HARDWARE_CONCURRENCY=$hardware_concurrency + END + RUN cd build && GTEST_COLOR=1 AVM_TESTS_ENABLE_PROVING=1 ctest -j4 --test-dir src/barretenberg/vm --output-on-failure + build: BUILD +preset-wasm BUILD +preset-wasm-threads diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp index 40dde3ae6e9..74659b44262 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp @@ -15,9 +15,8 @@ namespace bb::avm_trace { using Flavor = bb::AvmFlavor; using FF = Flavor::FF; -} // namespace bb::avm_trace - -namespace bb::avm_trace { +// To toggle all relevant unit tests with proving, set the env variable "AVM_TESTS_ENABLE_PROVING". +static const bool ENABLE_PROVING = std::getenv("AVM_TESTS_ENABLE_PROVING") != nullptr; // There are 4 public input columns, 1 for context inputs, and 3 for emitting side effects using VmPublicInputs = std::tuple, // Input: Kernel context inputs diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp index 9c9b157b48f..b0d86f4c5da 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp @@ -33,7 +33,7 @@ class AvmTraceBuilder { ExecutionHints execution_hints = {}, uint32_t side_effect_counter = 0); - std::vector finalize(uint32_t min_trace_size = 0, bool range_check_required = false); + std::vector finalize(uint32_t min_trace_size = 0, bool range_check_required = ENABLE_PROVING); void reset(); uint32_t getPc() const { return pc; } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp index 6c8aa4fd068..cd7c010b94b 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp @@ -21,16 +21,13 @@ using ThreeOpParam = std::array; using ThreeOpParamRow = std::tuple; using VmPublicInputs = bb::avm_trace::VmPublicInputs; -// To toggle all relevant unit tests with proving, set the env variable "AVM_TESTS_ENABLE_PROVING". -static const bool ENABLE_PROVING = std::getenv("AVM_TESTS_ENABLE_PROVING") != nullptr; - // If the test is expecting a relation to fail, then use validate_trace_check_circuit. // Otherwise, use validate_trace with a single argument. If the proving needs to be // enabled all the time in a given test, use validate_trace with setting with_proof = true. void validate_trace_check_circuit(std::vector&& trace, VmPublicInputs public_inputs = {}); void validate_trace(std::vector&& trace, VmPublicInputs const& public_inputs = {}, - bool with_proof = ENABLE_PROVING); + bool with_proof = bb::avm_trace::ENABLE_PROVING); void mutate_ic_in_trace(std::vector& trace, std::function&& selectRow, FF const& newValue, From 157356c561bf911214914df52d3e57d5dc9e93bb Mon Sep 17 00:00:00 2001 From: jeanmon Date: Tue, 18 Jun 2024 15:26:10 +0000 Subject: [PATCH 02/15] Addressing review comments --- barretenberg/cpp/Earthfile | 2 +- barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp | 4 ++-- yarn-project/end-to-end/src/e2e_prover/full.test.ts | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index 6e6df6244e6..eca2fdc4987 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -262,7 +262,7 @@ vm-full-test: IF [ "$HARDWARE_CONCURRENCY" != "" ] ENV HARDWARE_CONCURRENCY=$hardware_concurrency END - RUN cd build && GTEST_COLOR=1 AVM_TESTS_ENABLE_PROVING=1 ctest -j4 --test-dir src/barretenberg/vm --output-on-failure + RUN cd build && GTEST_COLOR=1 AVM_ENABLE_FULL_PROVING=1 ctest -j4 --test-dir src/barretenberg/vm --output-on-failure build: BUILD +preset-wasm diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp index 74659b44262..1ff41a277cd 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp @@ -15,8 +15,8 @@ namespace bb::avm_trace { using Flavor = bb::AvmFlavor; using FF = Flavor::FF; -// To toggle all relevant unit tests with proving, set the env variable "AVM_TESTS_ENABLE_PROVING". -static const bool ENABLE_PROVING = std::getenv("AVM_TESTS_ENABLE_PROVING") != nullptr; +// To toggle all relevant unit tests with proving, set the env variable "AVM_ENABLE_FULL_PROVING". +static const bool ENABLE_PROVING = std::getenv("AVM_ENABLE_FULL_PROVING") != nullptr; // There are 4 public input columns, 1 for context inputs, and 3 for emitting side effects using VmPublicInputs = std::tuple, // Input: Kernel context inputs diff --git a/yarn-project/end-to-end/src/e2e_prover/full.test.ts b/yarn-project/end-to-end/src/e2e_prover/full.test.ts index cbcb387292c..bbc1c8b7404 100644 --- a/yarn-project/end-to-end/src/e2e_prover/full.test.ts +++ b/yarn-project/end-to-end/src/e2e_prover/full.test.ts @@ -7,6 +7,8 @@ const TIMEOUT = 1_800_000; // This makes AVM proving throw if there's a failure. process.env.AVM_PROVING_STRICT = '1'; +// Enable proving the full lookup tables (no truncation). +process.env.AVM_ENABLE_FULL_PROVING = '1'; describe('full_prover', () => { const t = new FullProverTest('full_prover', 2); From 217bc2ed9befe25abad386389efdb198a5f7acf4 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Tue, 18 Jun 2024 17:58:09 +0000 Subject: [PATCH 03/15] Adapt runner --- .github/workflows/vm_full_tests.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml index 6a926ecabc3..092b41ed9ef 100644 --- a/.github/workflows/vm_full_tests.yml +++ b/.github/workflows/vm_full_tests.yml @@ -34,6 +34,7 @@ env: jobs: setup: + runs-on: ubuntu-latest uses: ./.github/workflows/setup-runner.yml with: username: ${{ github.event.pull_request.user.login || github.actor }} @@ -44,7 +45,7 @@ jobs: # only ran on x86 for resource reasons (memory intensive) avm-full-tests: needs: [setup] - runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } @@ -56,5 +57,7 @@ jobs: - name: "AVM Full Tests" working-directory: ./barretenberg/cpp/ timeout-minutes: 70 - # limit our parallelism to half our cores - run: earthly-ci --no-output +vm-full-test --hardware_concurrency=64 + with: + # limit our parallelism to half our cores + run: earthly-ci --no-output +vm-full-test --hardware_concurrency=64 + runner_type: builder-x86 From 9ad2c85b4ccbbb2dcf189f9d5fced330b32fa919 Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Tue, 18 Jun 2024 20:10:01 +0200 Subject: [PATCH 04/15] Update vm_full_tests.yml --- .github/workflows/vm_full_tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml index 092b41ed9ef..f1b80aeade8 100644 --- a/.github/workflows/vm_full_tests.yml +++ b/.github/workflows/vm_full_tests.yml @@ -34,7 +34,6 @@ env: jobs: setup: - runs-on: ubuntu-latest uses: ./.github/workflows/setup-runner.yml with: username: ${{ github.event.pull_request.user.login || github.actor }} From 17aa91d0a80662e37a99f2cac6aee6b1397bc90b Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Tue, 18 Jun 2024 20:16:02 +0200 Subject: [PATCH 05/15] Update vm_full_tests.yml --- .github/workflows/vm_full_tests.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml index f1b80aeade8..d71e694e1ca 100644 --- a/.github/workflows/vm_full_tests.yml +++ b/.github/workflows/vm_full_tests.yml @@ -56,7 +56,5 @@ jobs: - name: "AVM Full Tests" working-directory: ./barretenberg/cpp/ timeout-minutes: 70 - with: - # limit our parallelism to half our cores - run: earthly-ci --no-output +vm-full-test --hardware_concurrency=64 - runner_type: builder-x86 + # limit our parallelism to half our cores + run: earthly-ci --no-output +vm-full-test --hardware_concurrency=64 From df3a0c45d61509aebb01986e186f4f88e4f09fbe Mon Sep 17 00:00:00 2001 From: jeanmon Date: Tue, 18 Jun 2024 18:20:24 +0000 Subject: [PATCH 06/15] Test run --- .github/workflows/vm_full_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml index d71e694e1ca..6648fadb43c 100644 --- a/.github/workflows/vm_full_tests.yml +++ b/.github/workflows/vm_full_tests.yml @@ -1,6 +1,7 @@ name: AVM Full Tests on: + push: #TODO: REMOVE BEFOre MERGING schedule: - cron: "15 4 * * 1-5" # Monday to Friday at 4:15 AM UTC workflow_dispatch: From de49b1573a847356e00d752348cbf71c0d07d8d6 Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Tue, 18 Jun 2024 20:29:17 +0200 Subject: [PATCH 07/15] Remove concurrency key --- .github/workflows/vm_full_tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml index 6648fadb43c..1e4ef6aa77d 100644 --- a/.github/workflows/vm_full_tests.yml +++ b/.github/workflows/vm_full_tests.yml @@ -51,9 +51,6 @@ jobs: with: { ref: "${{ env.GIT_COMMIT }}" } # Only allow one memory-hunger prover test to use this runner - uses: ./.github/ci-setup-action - with: - # must be globally unique for build x runner - concurrency_key: avm-full-tests-x86 - name: "AVM Full Tests" working-directory: ./barretenberg/cpp/ timeout-minutes: 70 From 9fe37ea6e6bc8152028595f98c423b0b2e2253c7 Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:59:38 +0200 Subject: [PATCH 08/15] Update timeout --- .github/workflows/vm_full_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml index 1e4ef6aa77d..265e4d620f7 100644 --- a/.github/workflows/vm_full_tests.yml +++ b/.github/workflows/vm_full_tests.yml @@ -53,6 +53,6 @@ jobs: - uses: ./.github/ci-setup-action - name: "AVM Full Tests" working-directory: ./barretenberg/cpp/ - timeout-minutes: 70 + timeout-minutes: 150 # limit our parallelism to half our cores run: earthly-ci --no-output +vm-full-test --hardware_concurrency=64 From 2509f5f7a164c309f9b831216d78d5161bcd256d Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 19 Jun 2024 10:12:50 +0000 Subject: [PATCH 09/15] Attempt to remove wasm build --- barretenberg/cpp/Earthfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index eca2fdc4987..367107fa279 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -253,11 +253,11 @@ vm-full-test: BUILD +test-binaries BUILD +preset-release-assert-test BUILD +test-clang-format - BUILD ./srs_db/+build # prefetch + BUILD ./srs_db/+build-no-wasm # prefetch FROM +source COPY --dir +test-binaries/build build FROM +preset-release-assert-test - COPY --dir ./srs_db/+build/. srs_db + COPY --dir ./srs_db/+build-no-wasm/. srs_db # limit hardware concurrency, if provided IF [ "$HARDWARE_CONCURRENCY" != "" ] ENV HARDWARE_CONCURRENCY=$hardware_concurrency @@ -267,4 +267,7 @@ vm-full-test: build: BUILD +preset-wasm BUILD +preset-wasm-threads + BUILD +preset-release + +build-no-wasm: BUILD +preset-release \ No newline at end of file From 570c557bf0d0179dfa97c3ee1e7d7851918764ea Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 19 Jun 2024 10:55:54 +0000 Subject: [PATCH 10/15] another try to decouple no-wasm builts --- barretenberg/cpp/Earthfile | 53 ++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index 367107fa279..9949b79c6ab 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -16,6 +16,17 @@ source: # for debugging rebuilds RUN echo CONTENT HASH $(find . -type f -exec sha256sum {} ';' | sort | sha256sum | awk '{print $1}') | tee .content-hash +source-no-wasm: + FROM ../../build-images+build-no-wasm + WORKDIR /usr/src/barretenberg + # cpp source + COPY --dir src/barretenberg src/CMakeLists.txt src + # cmake source + COPY --dir cmake CMakeLists.txt CMakePresets.json . + # for debugging rebuilds + RUN echo CONTENT HASH $(find . -type f -exec sha256sum {} ';' | sort | sha256sum | awk '{print $1}') | tee .content-hash + + preset-darwin-arm64: FROM +source LET OSX_SDK="MacOSX14.0.sdk" @@ -34,6 +45,16 @@ preset-release-assert: RUN cmake --preset clang16 -Bbuild && cmake --build build --target bb && rm -rf build/{deps,lib,src} SAVE ARTIFACT build/bin +preset-release-no-wasm: + FROM +source-no-wasm + RUN cmake --preset clang16 -Bbuild && cmake --build build --target bb && rm -rf build/{deps,lib,src} + SAVE ARTIFACT build/bin + +preset-release-assert-no-wasm: + FROM +source-no-wasm + RUN cmake --preset clang16 -Bbuild && cmake --build build --target bb && rm -rf build/{deps,lib,src} + SAVE ARTIFACT build/bin + preset-debug: FROM +source RUN cmake --preset clang16-dbg -Bbuild && cmake --build build --target bb && rm -rf build/{deps,lib,src} @@ -142,6 +163,13 @@ preset-release-assert-test: RUN cmake --build build && rm -rf build/{deps,lib,src} SAVE ARTIFACT build/bin +# test images +preset-release-assert-test-no-wasm: + FROM +preset-release-assert-no-wasm + # build all targets for tests + RUN cmake --build build && rm -rf build/{deps,lib,src} + SAVE ARTIFACT build/bin + # Sent to the bench runner using a earthly --push +bench-binaries # then we can run earthly +bench-ultra-honk --bench_mode=cache bench-binaries: @@ -224,6 +252,22 @@ test-binaries: SAVE IMAGE --push aztecprotocol/bb-test-binaries:$TARGETARCH-$EARTHLY_GIT_HASH END +# Sent to the bench runner using a earthly --push +test-binaries +# then we can run earthly +test --test_mode=cache +test-binaries-no-wasm: + ARG EARTHLY_GIT_HASH + ARG TARGETARCH + ARG test_mode=build + LOCALLY + IF [ $test_mode = cache ] + FROM aztecprotocol/bb-test-binaries:$TARGETARCH-$EARTHLY_GIT_HASH + SAVE ARTIFACT build + ELSE + FROM scratch + COPY +preset-release-assert-test-no-wasm/bin/*_tests build/bin/ + SAVE ARTIFACT build + END + test-clang-format: FROM +source COPY .clang-format . @@ -250,13 +294,12 @@ test: vm-full-test: ARG hardware_concurrency="" # prefetch - BUILD +test-binaries - BUILD +preset-release-assert-test - BUILD +test-clang-format + BUILD +test-binaries-no-wasm + BUILD +preset-release-assert-test-no-wasm BUILD ./srs_db/+build-no-wasm # prefetch FROM +source - COPY --dir +test-binaries/build build - FROM +preset-release-assert-test + COPY --dir +test-binaries-no-wasm/build build + FROM +preset-release-assert-test-no-wasm COPY --dir ./srs_db/+build-no-wasm/. srs_db # limit hardware concurrency, if provided IF [ "$HARDWARE_CONCURRENCY" != "" ] From 9f8866ba94b665fdde721b07f3281469aad9b73e Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 19 Jun 2024 11:50:03 +0000 Subject: [PATCH 11/15] Revert decoupling no-wasm build --- barretenberg/cpp/Earthfile | 59 ++++---------------------------------- 1 file changed, 6 insertions(+), 53 deletions(-) diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index 9949b79c6ab..555b05e9b9b 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -16,17 +16,6 @@ source: # for debugging rebuilds RUN echo CONTENT HASH $(find . -type f -exec sha256sum {} ';' | sort | sha256sum | awk '{print $1}') | tee .content-hash -source-no-wasm: - FROM ../../build-images+build-no-wasm - WORKDIR /usr/src/barretenberg - # cpp source - COPY --dir src/barretenberg src/CMakeLists.txt src - # cmake source - COPY --dir cmake CMakeLists.txt CMakePresets.json . - # for debugging rebuilds - RUN echo CONTENT HASH $(find . -type f -exec sha256sum {} ';' | sort | sha256sum | awk '{print $1}') | tee .content-hash - - preset-darwin-arm64: FROM +source LET OSX_SDK="MacOSX14.0.sdk" @@ -45,16 +34,6 @@ preset-release-assert: RUN cmake --preset clang16 -Bbuild && cmake --build build --target bb && rm -rf build/{deps,lib,src} SAVE ARTIFACT build/bin -preset-release-no-wasm: - FROM +source-no-wasm - RUN cmake --preset clang16 -Bbuild && cmake --build build --target bb && rm -rf build/{deps,lib,src} - SAVE ARTIFACT build/bin - -preset-release-assert-no-wasm: - FROM +source-no-wasm - RUN cmake --preset clang16 -Bbuild && cmake --build build --target bb && rm -rf build/{deps,lib,src} - SAVE ARTIFACT build/bin - preset-debug: FROM +source RUN cmake --preset clang16-dbg -Bbuild && cmake --build build --target bb && rm -rf build/{deps,lib,src} @@ -163,13 +142,6 @@ preset-release-assert-test: RUN cmake --build build && rm -rf build/{deps,lib,src} SAVE ARTIFACT build/bin -# test images -preset-release-assert-test-no-wasm: - FROM +preset-release-assert-no-wasm - # build all targets for tests - RUN cmake --build build && rm -rf build/{deps,lib,src} - SAVE ARTIFACT build/bin - # Sent to the bench runner using a earthly --push +bench-binaries # then we can run earthly +bench-ultra-honk --bench_mode=cache bench-binaries: @@ -252,22 +224,6 @@ test-binaries: SAVE IMAGE --push aztecprotocol/bb-test-binaries:$TARGETARCH-$EARTHLY_GIT_HASH END -# Sent to the bench runner using a earthly --push +test-binaries -# then we can run earthly +test --test_mode=cache -test-binaries-no-wasm: - ARG EARTHLY_GIT_HASH - ARG TARGETARCH - ARG test_mode=build - LOCALLY - IF [ $test_mode = cache ] - FROM aztecprotocol/bb-test-binaries:$TARGETARCH-$EARTHLY_GIT_HASH - SAVE ARTIFACT build - ELSE - FROM scratch - COPY +preset-release-assert-test-no-wasm/bin/*_tests build/bin/ - SAVE ARTIFACT build - END - test-clang-format: FROM +source COPY .clang-format . @@ -294,13 +250,13 @@ test: vm-full-test: ARG hardware_concurrency="" # prefetch - BUILD +test-binaries-no-wasm - BUILD +preset-release-assert-test-no-wasm - BUILD ./srs_db/+build-no-wasm # prefetch + BUILD +test-binaries + BUILD +preset-release-assert-test + BUILD ./srs_db/+build # prefetch FROM +source - COPY --dir +test-binaries-no-wasm/build build - FROM +preset-release-assert-test-no-wasm - COPY --dir ./srs_db/+build-no-wasm/. srs_db + COPY --dir +test-binaries/build build + FROM +preset-release-assert-test + COPY --dir ./srs_db/+build/. srs_db # limit hardware concurrency, if provided IF [ "$HARDWARE_CONCURRENCY" != "" ] ENV HARDWARE_CONCURRENCY=$hardware_concurrency @@ -310,7 +266,4 @@ vm-full-test: build: BUILD +preset-wasm BUILD +preset-wasm-threads - BUILD +preset-release - -build-no-wasm: BUILD +preset-release \ No newline at end of file From ffae50a8c7818e4d35f9fdb8393bc7e404cbaaf2 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 19 Jun 2024 11:59:01 +0000 Subject: [PATCH 12/15] Use runner of github.actor --- .github/workflows/vm_full_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml index 265e4d620f7..830b824479b 100644 --- a/.github/workflows/vm_full_tests.yml +++ b/.github/workflows/vm_full_tests.yml @@ -45,7 +45,7 @@ jobs: # only ran on x86 for resource reasons (memory intensive) avm-full-tests: needs: [setup] - runs-on: ubuntu-latest + runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } From dfcfb2946002f9ecfefc1bc1a3630b117ea0f519 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 19 Jun 2024 12:02:32 +0000 Subject: [PATCH 13/15] Decrease timeout to 90 minutes --- .github/workflows/vm_full_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml index 830b824479b..f74c6ef54b1 100644 --- a/.github/workflows/vm_full_tests.yml +++ b/.github/workflows/vm_full_tests.yml @@ -53,6 +53,6 @@ jobs: - uses: ./.github/ci-setup-action - name: "AVM Full Tests" working-directory: ./barretenberg/cpp/ - timeout-minutes: 150 + timeout-minutes: 90 # limit our parallelism to half our cores run: earthly-ci --no-output +vm-full-test --hardware_concurrency=64 From 121c51d33e167b5262714d5c7078d233cc1eda1e Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 19 Jun 2024 12:11:04 +0000 Subject: [PATCH 14/15] Concurrency key is back --- .github/workflows/vm_full_tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml index f74c6ef54b1..e53b9104395 100644 --- a/.github/workflows/vm_full_tests.yml +++ b/.github/workflows/vm_full_tests.yml @@ -51,6 +51,9 @@ jobs: with: { ref: "${{ env.GIT_COMMIT }}" } # Only allow one memory-hunger prover test to use this runner - uses: ./.github/ci-setup-action + with: + # must be globally unique for build x runner + concurrency_key: avm-full-tests-x86 - name: "AVM Full Tests" working-directory: ./barretenberg/cpp/ timeout-minutes: 90 From 3a1b0bef3a18e27c943e44c3340a82cab4983dd3 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 19 Jun 2024 12:13:16 +0000 Subject: [PATCH 15/15] Remove the trigger from push --- .github/workflows/vm_full_tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml index e53b9104395..1e912a05438 100644 --- a/.github/workflows/vm_full_tests.yml +++ b/.github/workflows/vm_full_tests.yml @@ -1,7 +1,6 @@ name: AVM Full Tests on: - push: #TODO: REMOVE BEFOre MERGING schedule: - cron: "15 4 * * 1-5" # Monday to Friday at 4:15 AM UTC workflow_dispatch: