From 539b23c9462a699a14b554167664c9afa630c415 Mon Sep 17 00:00:00 2001 From: PhilWindle Date: Wed, 1 May 2024 23:04:40 +0000 Subject: [PATCH 01/48] feat: run benchmarks for ACIR proving --- .github/workflows/ci.yml | 21 +++++++++- barretenberg/Earthfile | 7 ++++ barretenberg/acir_tests/bench_acir_tests.sh | 10 ++++- noir/Earthfile | 38 +++++++++++++++++++ .../circuit-types/src/stats/metrics.ts | 7 ++++ yarn-project/circuit-types/src/stats/stats.ts | 13 +++++++ yarn-project/end-to-end/Earthfile | 1 + .../scripts/src/benchmarks/aggregate.ts | 10 +++++ .../scripts/src/benchmarks/markdown.ts | 6 +++ 9 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 barretenberg/Earthfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b49dc2e74107..fe02066268d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,8 +78,25 @@ jobs: 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 }} + acir-bench: + runs-on: ${{ inputs.username || github.actor }}-bench-x86 + needs: setup-bench + steps: + - { + uses: actions/checkout@v4, + with: { ref: "${{ github.event.pull_request.head.sha }}" }, + } + - uses: ./.github/ci-setup-action + with: + dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}" + concurrency_key: acir-bench-${{ inputs.username || github.actor }}-bench-x86 + - name: ACIR Proving Bench + working-directory: ./noir/ + timeout-minutes: 15 + 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 +barretenberg-acir-benches-bb + # bench-summary: - # needs: e2e + # needs: [e2e, acir-bench] # runs-on: ${{ inputs.username || github.actor }}-x86 # steps: # - uses: actions/checkout@v4 @@ -265,12 +282,14 @@ jobs: timeout-minutes: 15 run: earthly-ci --no-output +bench-ultra-honk --bench_mode=cache + merge-check: runs-on: ubuntu-latest needs: - e2e - bb-native-tests - bb-bench + - acir-bench - yarn-project-formatting - yarn-project-test - prover-client-test diff --git a/barretenberg/Earthfile b/barretenberg/Earthfile new file mode 100644 index 000000000000..b6636cb671f4 --- /dev/null +++ b/barretenberg/Earthfile @@ -0,0 +1,7 @@ +VERSION 0.8 + +acir-tests: + FROM ../build-images+build + WORKDIR /usr/src/barretenberg + COPY ./acir_tests . + SAVE ARTIFACT ./* diff --git a/barretenberg/acir_tests/bench_acir_tests.sh b/barretenberg/acir_tests/bench_acir_tests.sh index a41b261d1cc3..05d763cea893 100755 --- a/barretenberg/acir_tests/bench_acir_tests.sh +++ b/barretenberg/acir_tests/bench_acir_tests.sh @@ -2,7 +2,11 @@ TEST_NAMES=("$@") THREADS=(1 4 16 32 64) -BENCHMARKS=$(mktemp) +BENCHMARKS=$LOG_FILE + +if [[ -z "${LOG_FILE}" ]]; then + BENCHMARKS=$(mktemp) +fi if [ "${#TEST_NAMES[@]}" -eq 0 ]; then TEST_NAMES=(sha256 ecdsa_secp256k1 ecdsa_secp256r1 schnorr double_verify_proof) @@ -64,4 +68,6 @@ function genthreadheaders(t, len, res) { } ' -rm $BENCHMARKS \ No newline at end of file +if [[ -z "${LOG_FILE}" ]]; then + rm $BENCHMARKS +fi diff --git a/noir/Earthfile b/noir/Earthfile index 18faae05e2e9..6e12ccb80c4a 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -81,6 +81,44 @@ build: BUILD +nargo BUILD +packages +build-acir-tests: + FROM +nargo + ENV PATH="/usr/src/noir-repo/target/release:${PATH}" + WORKDIR /usr/src/noir-repo/test_programs + COPY . . + RUN ./rebuild.sh + SAVE ARTIFACT /usr/src/noir-repo/test_programs/acir_artifacts/* + +# This is ripped from end-to-end's Earthfile, need to pull from there directly. +UPLOAD_LOGS: + FUNCTION + ARG PULL_REQUEST + ARG BRANCH + ARG COMMIT_HASH + ARG LOG_FILE=./log + LOCALLY + LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" + FROM ../+scripts + COPY ./log /usr/var/log + ENV PULL_REQUEST=$PULL_REQUEST + ENV BRANCH=$BRANCH + ENV COMMIT_HASH=$COMMIT_HASH + RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log + +barretenberg-acir-benches-bb: + FROM ../build-images/+build + WORKDIR /usr/src/barretenberg + + COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb + COPY +build-acir-tests/ /usr/src/acir_artifacts + COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests + + WORKDIR /usr/src/barretenberg/acir_tests + + ENV TEST_SRC /usr/src/acir_artifacts + ENV LOG_FILE=/log + RUN ./bench_acir_tests.sh sha256 + DO +UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH # TOOD # test-packages # FROM aztecprotocol/noir AS noir diff --git a/yarn-project/circuit-types/src/stats/metrics.ts b/yarn-project/circuit-types/src/stats/metrics.ts index 5b7217e42f57..f642c2f3b837 100644 --- a/yarn-project/circuit-types/src/stats/metrics.ts +++ b/yarn-project/circuit-types/src/stats/metrics.ts @@ -2,6 +2,7 @@ import { type StatsEventName } from './stats.js'; /** How a metric is grouped in benchmarks: by block size, by length of chain processed, or by circuit name. */ export type MetricGroupBy = + | 'threads' | 'block-size' | 'chain-length' | 'circuit-name' @@ -24,6 +25,12 @@ export interface Metric { /** Metric definitions to track from benchmarks. */ export const Metrics = [ + { + name: 'proof_construction_time_sha256', + groupBy: 'threads', + description: 'Time needed to generate a proof of an ACIR program.', + events: ['proof_construction_time'], + }, { name: 'l1_rollup_calldata_size_in_bytes', groupBy: 'block-size', diff --git a/yarn-project/circuit-types/src/stats/stats.ts b/yarn-project/circuit-types/src/stats/stats.ts index 6c28b6087eb3..8873c535ff60 100644 --- a/yarn-project/circuit-types/src/stats/stats.ts +++ b/yarn-project/circuit-types/src/stats/stats.ts @@ -1,3 +1,15 @@ +/** Stats associated with an ACIR proof generation.*/ +export type ProofConstructed = { + /** Name of the event for metrics purposes */ + eventName: 'proof_construction_time'; + /** Name of the program being proven */ + acir_test: string; + /** Number of threads used for proving */ + threads: number; + /** Time spent proving */ + value: number; +}; + /** Stats associated with an L2 block. */ export type L2BlockStats = { /** Number of txs in the L2 block. */ @@ -235,6 +247,7 @@ export type TxAddedToPoolStats = { /** Stats emitted in structured logs with an `eventName` for tracking. */ export type Stats = + | ProofConstructed | L1PublishStats | NodeSyncedChainHistoryStats | CircuitSimulationStats diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 3a9c18ff04b0..fa92c6736d72 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -28,6 +28,7 @@ UPLOAD_LOGS: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH + ARG LOG_FILE=./log LOCALLY LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" FROM ../../+scripts diff --git a/yarn-project/scripts/src/benchmarks/aggregate.ts b/yarn-project/scripts/src/benchmarks/aggregate.ts index f0bf75811f93..bc8b1ea51548 100644 --- a/yarn-project/scripts/src/benchmarks/aggregate.ts +++ b/yarn-project/scripts/src/benchmarks/aggregate.ts @@ -9,6 +9,7 @@ // And then run this script from the yarn-project/scripts folder // LOG_FOLDER=../end-to-end/log yarn bench-aggregate import { + type ProofConstructed, BENCHMARK_BLOCK_SIZES, BENCHMARK_HISTORY_BLOCK_SIZE, BENCHMARK_HISTORY_CHAIN_LENGTHS, @@ -66,6 +67,13 @@ function append( results[metric]![bucket].push(numeric); } +/** Processes an entry with event name 'acir-proof-generated' and updates results */ +function processAcirProofGenerated(entry: ProofConstructed, results: BenchmarkCollectedResults) { + if (entry.acir_test == 'sha256') { + append(results, `proof_construction_time_sha256`, entry.threads, entry.value); + } +} + /** Processes an entry with event name 'rollup-published-to-l1' and updates results */ function processRollupPublished(entry: L1PublishStats, results: BenchmarkCollectedResults) { const bucket = entry.txCount; @@ -218,6 +226,8 @@ function processTreeInsertion(entry: TreeInsertionStats, results: BenchmarkColle /** Processes a parsed entry from a log-file and updates results */ function processEntry(entry: Stats, results: BenchmarkCollectedResults, fileName: string) { switch (entry.eventName) { + case 'proof_construction_time': + return processAcirProofGenerated(entry, results); case 'rollup-published-to-l1': return processRollupPublished(entry, results); case 'l2-block-handled': diff --git a/yarn-project/scripts/src/benchmarks/markdown.ts b/yarn-project/scripts/src/benchmarks/markdown.ts index 772238679a94..6558145f0c59 100644 --- a/yarn-project/scripts/src/benchmarks/markdown.ts +++ b/yarn-project/scripts/src/benchmarks/markdown.ts @@ -183,6 +183,7 @@ export function getMarkdown(prNumber: number) { const benchmark = JSON.parse(fs.readFileSync(inputFile, 'utf-8')); const baseBenchmark = getBaseBenchmark(); + const metricsByThreads = Metrics.filter(m => m.groupBy === 'threads').map(m => m.name); const metricsByBlockSize = Metrics.filter(m => m.groupBy === 'block-size').map(m => m.name); const metricsByChainLength = Metrics.filter(m => m.groupBy === 'chain-length').map(m => m.name); const metricsByCircuitName = Metrics.filter(m => m.groupBy === 'circuit-name').map(m => m.name); @@ -217,6 +218,11 @@ All benchmarks are run on txs on the \`Benchmarking\` contract on the repository ${prSourceDataText} ${baseCommitText} +### Proof generation + +Each column represents the number of threads used in proof generation. +${getTableContent(pick(benchmark, metricsByThreads), baseBenchmark, 'threads')} + ### L2 block published to L1 Each column represents the number of txs on an L2 block published to L1. From bce6863c9bfdd9f14334702b421a14412734e9c3 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 2 May 2024 16:26:00 +0000 Subject: [PATCH 02/48] chore: run benchmarks locally --- noir/Earthfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/noir/Earthfile b/noir/Earthfile index 6e12ccb80c4a..823b3b3d7edc 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -116,9 +116,11 @@ barretenberg-acir-benches-bb: WORKDIR /usr/src/barretenberg/acir_tests ENV TEST_SRC /usr/src/acir_artifacts - ENV LOG_FILE=/log + ENV LOG_FILE=./log RUN ./bench_acir_tests.sh sha256 - DO +UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + + SAVE ARTIFACT ./log AS LOCAL ./log + DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH # TOOD # test-packages # FROM aztecprotocol/noir AS noir From 47ff339000e4366c9b6b67822ab8ae803537cada Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 2 May 2024 17:12:45 +0000 Subject: [PATCH 03/48] chore: dedupe log upload function --- Earthfile | 18 +++++++++++++++++- noir/Earthfile | 17 +---------------- yarn-project/end-to-end/Earthfile | 21 +++------------------ 3 files changed, 21 insertions(+), 35 deletions(-) diff --git a/Earthfile b/Earthfile index 5a42a251dfd2..94bd709777cf 100644 --- a/Earthfile +++ b/Earthfile @@ -34,4 +34,20 @@ scripts: FROM ubuntu:lunar RUN apt-get update && apt-get install -y awscli COPY scripts /usr/src/scripts - SAVE ARTIFACT /usr/src/scripts scripts \ No newline at end of file + SAVE ARTIFACT /usr/src/scripts scripts + +UPLOAD_LOGS: + FUNCTION + ARG PULL_REQUEST + ARG BRANCH + ARG COMMIT_HASH + ARG LOG_FILE=./log + LOCALLY + LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" + FROM ../+scripts + COPY ./log /usr/var/log + ENV PULL_REQUEST=$PULL_REQUEST + ENV BRANCH=$BRANCH + ENV COMMIT_HASH=$COMMIT_HASH + RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log + \ No newline at end of file diff --git a/noir/Earthfile b/noir/Earthfile index 823b3b3d7edc..7a6b639c5e57 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -89,21 +89,6 @@ build-acir-tests: RUN ./rebuild.sh SAVE ARTIFACT /usr/src/noir-repo/test_programs/acir_artifacts/* -# This is ripped from end-to-end's Earthfile, need to pull from there directly. -UPLOAD_LOGS: - FUNCTION - ARG PULL_REQUEST - ARG BRANCH - ARG COMMIT_HASH - ARG LOG_FILE=./log - LOCALLY - LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" - FROM ../+scripts - COPY ./log /usr/var/log - ENV PULL_REQUEST=$PULL_REQUEST - ENV BRANCH=$BRANCH - ENV COMMIT_HASH=$COMMIT_HASH - RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log barretenberg-acir-benches-bb: FROM ../build-images/+build @@ -120,7 +105,7 @@ barretenberg-acir-benches-bb: RUN ./bench_acir_tests.sh sha256 SAVE ARTIFACT ./log AS LOCAL ./log - DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH # TOOD # test-packages # FROM aztecprotocol/noir AS noir diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index fa92c6736d72..38eb257349af 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -23,21 +23,6 @@ E2E_COMPOSE_TEST: # Run our docker compose, ending whenever sandbox ends, filtering out noisy eth_getLogs RUN $CMD -p $project_name -f $compose_file up --exit-code-from=end-to-end --force-recreate -UPLOAD_LOGS: - FUNCTION - ARG PULL_REQUEST - ARG BRANCH - ARG COMMIT_HASH - ARG LOG_FILE=./log - LOCALLY - LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" - FROM ../../+scripts - COPY ./log /usr/var/log - ENV PULL_REQUEST=$PULL_REQUEST - ENV BRANCH=$BRANCH - ENV COMMIT_HASH=$COMMIT_HASH - RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log - # Define e2e tests e2e-tests: FROM ../+end-to-end @@ -84,18 +69,18 @@ bench-publish-rollup: ARG BRANCH ARG COMMIT_HASH DO +E2E_COMPOSE_TEST --test=benchmarks/bench_publish_rollup.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml - DO +UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../../../+UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-process-history: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH DO +E2E_COMPOSE_TEST --test=benchmarks/bench_process_history.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml - DO +UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../../../+UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-tx-size: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH DO +E2E_COMPOSE_TEST --test=benchmarks/bench_tx_size_fees.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml - DO +UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../../../+UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH From 2631727152a9fe3d7a86e2041438544378c0677e Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 2 May 2024 18:31:44 +0000 Subject: [PATCH 04/48] chore: fix reference to `+scripts` target --- Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Earthfile b/Earthfile index 94bd709777cf..c0385ad9bde0 100644 --- a/Earthfile +++ b/Earthfile @@ -44,7 +44,7 @@ UPLOAD_LOGS: ARG LOG_FILE=./log LOCALLY LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" - FROM ../+scripts + FROM +scripts COPY ./log /usr/var/log ENV PULL_REQUEST=$PULL_REQUEST ENV BRANCH=$BRANCH From 1326502ed3c37afdc57d23b8b248b38ad60eb7c0 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 2 May 2024 18:41:11 +0000 Subject: [PATCH 05/48] chore: run `yarn format` --- yarn-project/end-to-end/jest.integration.config.json | 2 +- yarn-project/package.common.json | 2 +- yarn-project/scripts/src/benchmarks/aggregate.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn-project/end-to-end/jest.integration.config.json b/yarn-project/end-to-end/jest.integration.config.json index 84d61df320c4..721267ff5523 100644 --- a/yarn-project/end-to-end/jest.integration.config.json +++ b/yarn-project/end-to-end/jest.integration.config.json @@ -6,7 +6,7 @@ "moduleNameMapper": { "^(\\.{1,2}/.*)\\.js$": "$1" }, - "reporters": [["default", {"summaryThreshold": 9999}]], + "reporters": [["default", { "summaryThreshold": 9999 }]], "testRegex": "./src/.*\\.test\\.ts$", "rootDir": "./src" } diff --git a/yarn-project/package.common.json b/yarn-project/package.common.json index 80b56a8d697a..6fcf1a283151 100644 --- a/yarn-project/package.common.json +++ b/yarn-project/package.common.json @@ -24,7 +24,7 @@ "moduleNameMapper": { "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" }, - "reporters": [["default", {"summaryThreshold": 9999}]], + "reporters": [["default", { "summaryThreshold": 9999 }]], "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src" } diff --git a/yarn-project/scripts/src/benchmarks/aggregate.ts b/yarn-project/scripts/src/benchmarks/aggregate.ts index bc8b1ea51548..ce1c90f4f7aa 100644 --- a/yarn-project/scripts/src/benchmarks/aggregate.ts +++ b/yarn-project/scripts/src/benchmarks/aggregate.ts @@ -9,7 +9,6 @@ // And then run this script from the yarn-project/scripts folder // LOG_FOLDER=../end-to-end/log yarn bench-aggregate import { - type ProofConstructed, BENCHMARK_BLOCK_SIZES, BENCHMARK_HISTORY_BLOCK_SIZE, BENCHMARK_HISTORY_CHAIN_LENGTHS, @@ -25,6 +24,7 @@ import { type MetricName, type NodeSyncedChainHistoryStats, type NoteProcessorCaughtUpStats, + type ProofConstructed, type Stats, type TreeInsertionStats, type TxAddedToPoolStats, From edebac74f2aca7848fc109db0592286c3ac67b63 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 2 May 2024 19:13:38 +0000 Subject: [PATCH 06/48] chore: one too many levels --- yarn-project/end-to-end/Earthfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 38eb257349af..3f12722c1451 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -69,18 +69,18 @@ bench-publish-rollup: ARG BRANCH ARG COMMIT_HASH DO +E2E_COMPOSE_TEST --test=benchmarks/bench_publish_rollup.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml - DO ../../../+UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../../+UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-process-history: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH DO +E2E_COMPOSE_TEST --test=benchmarks/bench_process_history.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml - DO ../../../+UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../../+UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-tx-size: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH DO +E2E_COMPOSE_TEST --test=benchmarks/bench_tx_size_fees.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml - DO ../../../+UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../../+UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH From 08579b6566abfca9e0267e8f19a70a48fcd335c2 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 2 May 2024 19:29:31 +0000 Subject: [PATCH 07/48] chore: remove temp arg --- Earthfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Earthfile b/Earthfile index c0385ad9bde0..0096d9640393 100644 --- a/Earthfile +++ b/Earthfile @@ -41,7 +41,6 @@ UPLOAD_LOGS: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH - ARG LOG_FILE=./log LOCALLY LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" FROM +scripts From b13f5cda65c572934e6f9f4e1d93df29101f5774 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 2 May 2024 19:53:58 +0000 Subject: [PATCH 08/48] chore: dumb hack --- noir/Earthfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/noir/Earthfile b/noir/Earthfile index 7a6b639c5e57..975a48d368cf 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -91,6 +91,7 @@ build-acir-tests: barretenberg-acir-benches-bb: + WAIT FROM ../build-images/+build WORKDIR /usr/src/barretenberg @@ -100,11 +101,11 @@ barretenberg-acir-benches-bb: WORKDIR /usr/src/barretenberg/acir_tests - ENV TEST_SRC /usr/src/acir_artifacts ENV LOG_FILE=./log RUN ./bench_acir_tests.sh sha256 SAVE ARTIFACT ./log AS LOCAL ./log + END DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH # TOOD # test-packages From c23ca99a5d42ce008dc6b6bc0c833800feac6d0c Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 2 May 2024 20:12:00 +0000 Subject: [PATCH 09/48] chore: re-add env var --- noir/Earthfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/noir/Earthfile b/noir/Earthfile index 975a48d368cf..3f807ace7bfd 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -101,6 +101,8 @@ barretenberg-acir-benches-bb: WORKDIR /usr/src/barretenberg/acir_tests + # Used by`run_acir_tests.sh` + ENV TEST_SRC /usr/src/acir_artifacts ENV LOG_FILE=./log RUN ./bench_acir_tests.sh sha256 From 8639d310342f448b9c6c222b08ea338ea0ffbba0 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 2 May 2024 20:25:15 +0000 Subject: [PATCH 10/48] chore: stop doing earthly badly --- noir/Earthfile | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/noir/Earthfile b/noir/Earthfile index 3f807ace7bfd..afe18901f6b8 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -91,23 +91,17 @@ build-acir-tests: barretenberg-acir-benches-bb: - WAIT - FROM ../build-images/+build - WORKDIR /usr/src/barretenberg - - COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb - COPY +build-acir-tests/ /usr/src/acir_artifacts - COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests - - WORKDIR /usr/src/barretenberg/acir_tests - - # Used by`run_acir_tests.sh` - ENV TEST_SRC /usr/src/acir_artifacts + LOCALLY + + COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb ../barretenberg/cpp/build/bin/bb + COPY +build-acir-tests/ noir-repo/test_programs/acir_artifacts + COPY ../barretenberg/+acir-tests/ ../barretenberg/acir_tests + ENV LOG_FILE=./log - RUN ./bench_acir_tests.sh sha256 + RUN ls + RUN ls ../barretenberg + RUN ../barretenberg/acir_tests/bench_acir_tests.sh sha256 - SAVE ARTIFACT ./log AS LOCAL ./log - END DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH # TOOD # test-packages From ba1f18c72662a9f1ca1e3c188797001da4ffada4 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 2 May 2024 20:25:38 +0000 Subject: [PATCH 11/48] chore: remove leftover code --- noir/Earthfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/noir/Earthfile b/noir/Earthfile index afe18901f6b8..1b1c6315e70b 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -98,8 +98,6 @@ barretenberg-acir-benches-bb: COPY ../barretenberg/+acir-tests/ ../barretenberg/acir_tests ENV LOG_FILE=./log - RUN ls - RUN ls ../barretenberg RUN ../barretenberg/acir_tests/bench_acir_tests.sh sha256 DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH From b82aae49e444ea46a73c16dafc3c0a2ffd3287da Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 2 May 2024 20:32:01 +0000 Subject: [PATCH 12/48] chore: add necessary args --- noir/Earthfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/noir/Earthfile b/noir/Earthfile index 1b1c6315e70b..bfe1dcfc3b9c 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -91,6 +91,9 @@ build-acir-tests: barretenberg-acir-benches-bb: + ARG PULL_REQUEST + ARG BRANCH + ARG COMMIT_HASH LOCALLY COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb ../barretenberg/cpp/build/bin/bb From 88149ac7cf05e8d8d9a79338b5e856c35059d9a3 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Tue, 14 May 2024 16:43:58 +0000 Subject: [PATCH 13/48] chore: fix merge --- .github/workflows/ci.yml | 18 +++++ noir/Earthfile | 152 +++++++++++++++++++++++++++++---------- 2 files changed, 131 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 165146cecfef..af52c6244a79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,6 +197,24 @@ jobs: timeout-minutes: 25 run: earthly-ci --no-output ./+test + noir-format: + needs: setup + runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + - uses: ./.github/ci-setup-action + with: + concurrency_key: noir-format-${{ github.event.pull_request.user.login || github.actor }}-x86 + - name: "Format Noir" + working-directory: ./noir/ + timeout-minutes: 25 + run: earthly-ci --no-output ./+format + - name: "Format noir-projects" + working-directory: ./noir-projects/ + timeout-minutes: 25 + run: earthly-ci --no-output ./+format + noir-test: needs: setup runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 diff --git a/noir/Earthfile b/noir/Earthfile index eafe38bfc3e4..36d6ecf04a6c 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -186,42 +186,116 @@ run: COPY +build/. /usr/src ENTRYPOINT ["/usr/bin/tini", "--", "/usr/src/nargo"] -build: - BUILD +nargo - BUILD +packages - -# TOOD -# test-packages -# FROM aztecprotocol/noir AS noir - -# FROM node:20 AS builder -# COPY --from=noir /usr/src/noir/noir-repo/target/release /usr/src/noir/noir-repo/target/release -# ENV PATH=${PATH}:/usr/src/noir/noir-repo/target/release -# RUN curl https://sh.rustup.rs -sSf | bash -s -- -y -# RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc -# ENV PATH=/root/.cargo/bin:${PATH} -# RUN apt update && apt install -y jq libc++1 -# ARG COMMIT_HASH -# ENV COMMIT_HASH=${COMMIT_HASH} - -# WORKDIR /usr/src/noir -# COPY . . -# RUN ./scripts/test_js_packages.sh - -# # Don't waste time pushing a huge container back to ECR as nothing needs the output. -# FROM scratch -# COPY --from=builder /usr/src/noir/README.md /usr/src/noir/README.md - -# TODO -# test: -# FROM rust:bullseye -# ARG COMMIT_HASH -# ENV COMMIT_HASH=${COMMIT_HASH} -# RUN apt update && apt install -y libc++1 -# WORKDIR /usr/src/noir -# COPY . . -# RUN ./scripts/test_native.sh - -# # Don't waste time pushing a huge container back to ECR as nothing needs the output. -# FROM scratch -# COPY --from=0 /usr/src/noir/README.md /usr/src/noir/README.md +build-acir-tests: + 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-benches-bb: + ARG PULL_REQUEST + ARG BRANCH + ARG COMMIT_HASH + LOCALLY + + COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb ../barretenberg/cpp/build/bin/bb + COPY +build-acir-tests/ noir-repo/test_programs/acir_artifacts + COPY ../barretenberg/+acir-tests/ ../barretenberg/acir_tests + + ENV LOG_FILE=./log + RUN ../barretenberg/acir_tests/bench_acir_tests.sh sha256 + + DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + +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 + +barretenberg-acir-tests-sol: + 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 + + WORKDIR /usr/src/barretenberg/acir_tests + + 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 + +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 From 11dd24334486ccda736c89abf88fe0ed1c080b8d Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Tue, 14 May 2024 17:12:43 +0000 Subject: [PATCH 14/48] wip --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af52c6244a79..178a9003d27f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,7 +134,12 @@ jobs: - name: ACIR Proving Bench working-directory: ./noir/ timeout-minutes: 15 - 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 +barretenberg-acir-benches-bb + run: | + ../scripts/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 \ + +barretenberg-acir-benches-bb bench-summary: needs: bench-e2e From 7eb8e09e88aec75f4c97242d49cf5fa1d3603c15 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Tue, 14 May 2024 17:15:28 +0000 Subject: [PATCH 15/48] wip --- .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 178a9003d27f..0ad0aa4f6e65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -426,13 +426,13 @@ jobs: delete: ${{ !steps.gates_diff.outputs.markdown }} message: ${{ steps.gates_diff.outputs.markdown }} - merge-check: runs-on: ubuntu-latest needs: [ e2e, bb-native-tests, + acir-bench, bb-bench, yarn-project-formatting, yarn-project-test, From 7fe2fa5fd8b1a83a711cbe0b7861c629c4be9387 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Tue, 14 May 2024 17:18:15 +0000 Subject: [PATCH 16/48] wip --- Earthfile | 3 +-- yarn-project/end-to-end/Earthfile | 16 +--------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Earthfile b/Earthfile index 37b0e2eabbf2..c0f36574b728 100644 --- a/Earthfile +++ b/Earthfile @@ -42,10 +42,9 @@ UPLOAD_LOGS: ARG COMMIT_HASH LOCALLY LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" - FROM +scripts + FROM +base-log-uploader COPY ./log /usr/var/log ENV PULL_REQUEST=$PULL_REQUEST ENV BRANCH=$BRANCH ENV COMMIT_HASH=$COMMIT_HASH RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log - \ No newline at end of file diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 3e0b3fc9521d..0792e4527916 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -43,20 +43,6 @@ E2E_TEST: # Run our docker compose, ending whenever sandbox ends, filtering out noisy eth_getLogs RUN docker run --rm aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG $test || $allow_fail -UPLOAD_LOGS: - FUNCTION - ARG PULL_REQUEST - ARG BRANCH - ARG COMMIT_HASH - LOCALLY - LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" - FROM +base-log-uploader - COPY ./log /usr/var/log - ENV PULL_REQUEST=$PULL_REQUEST - ENV BRANCH=$BRANCH - ENV COMMIT_HASH=$COMMIT_HASH - RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log - base-log-uploader: # Install awscli on a fresh ubuntu, and copy the repo "scripts" folder, which we'll use to upload logs # Note that we cannot do this LOCALLY because Earthly does not support using secrets locally @@ -229,4 +215,4 @@ bench-proving: ARG BRANCH ARG COMMIT_HASH DO +E2E_COMPOSE_TEST --test=bench_proving --debug="aztec:benchmarks:*,aztec:prover*,aztec:bb*" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml - DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH From cedd02833d1f3dec0d72bab12826cf56158d53fb Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Tue, 14 May 2024 17:20:23 +0000 Subject: [PATCH 17/48] wip --- .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 0ad0aa4f6e65..3415ce17ec40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,7 +121,7 @@ jobs: acir-bench: runs-on: ${{ inputs.username || github.actor }}-bench-x86 - needs: setup-bench + needs: build steps: - { uses: actions/checkout@v4, From 63131634660f8dc1dee5781fe04c3486aacd3127 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Tue, 14 May 2024 17:27:07 +0000 Subject: [PATCH 18/48] chore: avoid waiting for e2e build --- .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 3415ce17ec40..dd67cf71dbac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,7 +121,7 @@ jobs: acir-bench: runs-on: ${{ inputs.username || github.actor }}-bench-x86 - needs: build + needs: setup steps: - { uses: actions/checkout@v4, From 683aa7d329c6d1787cc049e5369425f8523ecd20 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Tue, 14 May 2024 18:00:22 +0000 Subject: [PATCH 19/48] chore: switch over to isolated runner --- .github/workflows/ci.yml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd67cf71dbac..c9563f745be8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,26 +120,32 @@ jobs: +${{ matrix.test }} acir-bench: - runs-on: ${{ inputs.username || github.actor }}-bench-x86 + runs-on: ubuntu-latest needs: setup steps: - - { - uses: actions/checkout@v4, - with: { ref: "${{ github.event.pull_request.head.sha }}" }, - } + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } - uses: ./.github/ci-setup-action + - name: Setup and Test + uses: ./.github/ensure-tester-with-images + timeout-minutes: 40 with: - dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}" - concurrency_key: acir-bench-${{ inputs.username || github.actor }}-bench-x86 - - name: ACIR Proving Bench - working-directory: ./noir/ - timeout-minutes: 15 - run: | - ../scripts/earthly-ci -P \ + runner_type: 16core-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 }} + # command to produce the images in case they don't exist + builder_command: cd noir && ../scripts/earthly-ci +barretenberg-acir-benches-bb + run: | + set -eux + cd ./noir/ + export FORCE_COLOR=1 + ../scripts/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 \ - +barretenberg-acir-benches-bb + +barretenberg-acir-benches-bb bench-summary: needs: bench-e2e From 9ac0becc6f2852bd06ce271645b9562336716ffd Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 13:30:13 +0000 Subject: [PATCH 20/48] chore: small fixes --- Earthfile | 2 +- barretenberg/acir_tests/bench_acir_tests.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Earthfile b/Earthfile index c0f36574b728..693ba95e35a9 100644 --- a/Earthfile +++ b/Earthfile @@ -42,7 +42,7 @@ UPLOAD_LOGS: ARG COMMIT_HASH LOCALLY LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" - FROM +base-log-uploader + FROM ./yarn-project/end-to-end/+base-log-uploader COPY ./log /usr/var/log ENV PULL_REQUEST=$PULL_REQUEST ENV BRANCH=$BRANCH diff --git a/barretenberg/acir_tests/bench_acir_tests.sh b/barretenberg/acir_tests/bench_acir_tests.sh index 05d763cea893..8cdc19a7c8f2 100755 --- a/barretenberg/acir_tests/bench_acir_tests.sh +++ b/barretenberg/acir_tests/bench_acir_tests.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +cd "$(dirname "$0")" + TEST_NAMES=("$@") THREADS=(1 4 16 32 64) BENCHMARKS=$LOG_FILE From f769124ee3ffadb2fb536e6d9283688ef123ba49 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 13:46:18 +0000 Subject: [PATCH 21/48] chore: update `UPLOAD_LOGS` --- Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Earthfile b/Earthfile index 693ba95e35a9..1353061331de 100644 --- a/Earthfile +++ b/Earthfile @@ -40,11 +40,11 @@ UPLOAD_LOGS: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH + ARG LOG_FILE=./log LOCALLY LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" FROM ./yarn-project/end-to-end/+base-log-uploader - COPY ./log /usr/var/log ENV PULL_REQUEST=$PULL_REQUEST ENV BRANCH=$BRANCH ENV COMMIT_HASH=$COMMIT_HASH - RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log + RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh $LOG_FILE From 312715b602d296e3664e9a3bf84cbf9f4636666a Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 15:35:12 +0000 Subject: [PATCH 22/48] chore: run acir-bench benchmarking inside of docker --- .github/workflows/ci.yml | 6 +++--- noir/Earthfile | 29 ++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75776edc7056..dc7aee56aeff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,9 +135,9 @@ jobs: 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 }} + builder_images_to_copy: aztecprotocol/barretenberg-acir-benches-bb:${{ env.GIT_COMMIT }} # command to produce the images in case they don't exist - builder_command: cd noir && ../scripts/earthly-ci +barretenberg-acir-benches-bb + builder_command: cd noir && ../scripts/earthly-ci +bench-barretenberg-acir-benches-bb run: | set -eux cd ./noir/ @@ -146,7 +146,7 @@ jobs: --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \ --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \ --no-output \ - +barretenberg-acir-benches-bb + +bench-barretenberg-acir-benches-bb bench-summary: needs: bench-e2e diff --git a/noir/Earthfile b/noir/Earthfile index 36d6ecf04a6c..289d29068e5e 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -202,17 +202,36 @@ build-acir-tests: SAVE ARTIFACT /usr/src/noir-repo/test_programs/acir_artifacts/* barretenberg-acir-benches-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 + +export-barretenberg-acir-benches-bb: + ARG EARTHLY_GIT_HASH + FROM +barretenberg-acir-benches-bb + SAVE IMAGE aztecprotocol/barretenberg-acir-benches:$EARTHLY_GIT_HASH + +bench-barretenberg-acir-benches-bb: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH LOCALLY - COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb ../barretenberg/cpp/build/bin/bb - COPY +build-acir-tests/ noir-repo/test_programs/acir_artifacts - COPY ../barretenberg/+acir-tests/ ../barretenberg/acir_tests + # Let docker compose know about the pushed tags above + ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD) + # Optimize to not cause serial behavior if image already exists + IF ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/barretenberg-acir-benches-bb:$AZTEC_DOCKER_TAG" + WAIT + BUILD +export-barretenberg-acir-benches-bb + END + END - ENV LOG_FILE=./log - RUN ../barretenberg/acir_tests/bench_acir_tests.sh sha256 + RUN touch ./log + RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH From 773de3df8d08dab406e05783e190597d22aac363 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 15:56:34 +0000 Subject: [PATCH 23/48] chore: set `TEST_SRC` env var --- noir/Earthfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/noir/Earthfile b/noir/Earthfile index 289d29068e5e..04df88293480 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -208,6 +208,8 @@ barretenberg-acir-benches-bb: COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests COPY +build-acir-tests/ /usr/src/acir_artifacts + ENV TEST_SRC=/usr/src/acir_artifacts + WORKDIR /usr/src/barretenberg/acir_tests export-barretenberg-acir-benches-bb: @@ -231,7 +233,7 @@ bench-barretenberg-acir-benches-bb: END RUN touch ./log - RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 + RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH From 94a188265957217e7939d8579a328d39fc2c0281 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 16:18:37 +0000 Subject: [PATCH 24/48] test --- noir/Earthfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/noir/Earthfile b/noir/Earthfile index 04df88293480..9dba34d1bddd 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -217,12 +217,9 @@ export-barretenberg-acir-benches-bb: FROM +barretenberg-acir-benches-bb SAVE IMAGE aztecprotocol/barretenberg-acir-benches:$EARTHLY_GIT_HASH -bench-barretenberg-acir-benches-bb: - ARG PULL_REQUEST - ARG BRANCH - ARG COMMIT_HASH +FOO: + FUNCTION LOCALLY - # Let docker compose know about the pushed tags above ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD) # Optimize to not cause serial behavior if image already exists @@ -233,8 +230,14 @@ bench-barretenberg-acir-benches-bb: END RUN touch ./log - RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 + RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 + +bench-barretenberg-acir-benches-bb: + ARG PULL_REQUEST + ARG BRANCH + ARG COMMIT_HASH + DO +FOO DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH barretenberg-acir-tests-bb: From b39137dabf1f3f9e8cdf62c51792cea693dd65ff Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 16:23:35 +0000 Subject: [PATCH 25/48] temp --- Earthfile | 13 ------------- yarn-project/end-to-end/Earthfile | 20 ++++---------------- yarn-project/scripts/Earthfile | 27 ++++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Earthfile b/Earthfile index 1353061331de..03c692519c3f 100644 --- a/Earthfile +++ b/Earthfile @@ -35,16 +35,3 @@ scripts: COPY scripts /usr/src/scripts SAVE ARTIFACT /usr/src/scripts scripts -UPLOAD_LOGS: - FUNCTION - ARG PULL_REQUEST - ARG BRANCH - ARG COMMIT_HASH - ARG LOG_FILE=./log - LOCALLY - LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" - FROM ./yarn-project/end-to-end/+base-log-uploader - ENV PULL_REQUEST=$PULL_REQUEST - ENV BRANCH=$BRANCH - ENV COMMIT_HASH=$COMMIT_HASH - RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh $LOG_FILE diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 0792e4527916..af66860ea1a1 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -43,18 +43,6 @@ E2E_TEST: # Run our docker compose, ending whenever sandbox ends, filtering out noisy eth_getLogs RUN docker run --rm aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG $test || $allow_fail -base-log-uploader: - # Install awscli on a fresh ubuntu, and copy the repo "scripts" folder, which we'll use to upload logs - # Note that we cannot do this LOCALLY because Earthly does not support using secrets locally - FROM ubuntu:noble - RUN apt update && \ - apt install -y curl git jq unzip - RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \ - unzip awscliv2.zip && \ - ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && \ - rm -rf aws awscliv2.zip - COPY ../../+scripts/scripts /usr/src/scripts - e2e-2-pxes: DO +E2E_TEST --test=./src/e2e_2_pxes.test.ts @@ -194,25 +182,25 @@ bench-publish-rollup: ARG BRANCH ARG COMMIT_HASH DO +E2E_COMPOSE_TEST --test=benchmarks/bench_publish_rollup.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml - DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../scripts/+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-process-history: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH DO +E2E_COMPOSE_TEST --test=benchmarks/bench_process_history.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml - DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../scripts/+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-tx-size: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH DO +E2E_COMPOSE_TEST --test=benchmarks/bench_tx_size_fees.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml - DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../scripts/+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-proving: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH DO +E2E_COMPOSE_TEST --test=bench_proving --debug="aztec:benchmarks:*,aztec:prover*,aztec:bb*" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml - DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../scripts/+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH diff --git a/yarn-project/scripts/Earthfile b/yarn-project/scripts/Earthfile index 3fcddf19798a..cdd55d10c86e 100644 --- a/yarn-project/scripts/Earthfile +++ b/yarn-project/scripts/Earthfile @@ -66,4 +66,29 @@ bench-comment: [ -f $BENCH_FOLDER/benchmark.json ] \ && (cd /usr/src/yarn-project/scripts && AZTEC_BOT_COMMENTER_GITHUB_TOKEN=$AZTEC_BOT_COMMENTER_GITHUB_TOKEN yarn bench-comment) \ || echo "No benchmark file found in $BENCH_FOLDER" - \ No newline at end of file + +base-log-uploader: + # Install awscli on a fresh ubuntu, and copy the repo "scripts" folder, which we'll use to upload logs + # Note that we cannot do this LOCALLY because Earthly does not support using secrets locally + FROM ubuntu:noble + RUN apt update && \ + apt install -y curl git jq unzip + RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \ + unzip awscliv2.zip && \ + ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && \ + rm -rf aws awscliv2.zip + COPY +scripts/scripts /usr/src/scripts + +UPLOAD_LOGS: + FUNCTION + ARG PULL_REQUEST + ARG BRANCH + ARG COMMIT_HASH + ARG LOG_FILE=./log + LOCALLY + LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" + FROM +base-log-uploader + ENV PULL_REQUEST=$PULL_REQUEST + ENV BRANCH=$BRANCH + ENV COMMIT_HASH=$COMMIT_HASH + RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh $LOG_FILE From 103d02ac7cc414958b14f9c48e09b5cc7174741b Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Wed, 15 May 2024 17:40:23 +0100 Subject: [PATCH 26/48] Update noir/Earthfile --- noir/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir/Earthfile b/noir/Earthfile index 9dba34d1bddd..3f5660c60817 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -238,7 +238,7 @@ bench-barretenberg-acir-benches-bb: ARG COMMIT_HASH DO +FOO - DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../yarn-project/scripts/+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH barretenberg-acir-tests-bb: FROM ../build-images/+build From e416d9e6d03a19cf33597c3efc874c1dcf535640 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 16:47:00 +0000 Subject: [PATCH 27/48] chore: update path --- yarn-project/scripts/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/scripts/Earthfile b/yarn-project/scripts/Earthfile index cdd55d10c86e..ccd26a5c8862 100644 --- a/yarn-project/scripts/Earthfile +++ b/yarn-project/scripts/Earthfile @@ -77,7 +77,7 @@ base-log-uploader: unzip awscliv2.zip && \ ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && \ rm -rf aws awscliv2.zip - COPY +scripts/scripts /usr/src/scripts + COPY ../../+scripts/scripts /usr/src/scripts UPLOAD_LOGS: FUNCTION From e676aa404dbc86fa5775f0aa54f508df78f6c8c7 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 18:26:01 +0000 Subject: [PATCH 28/48] chore: fix path to `UPLOAD_LOGS` --- noir/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir/Earthfile b/noir/Earthfile index 3f5660c60817..9dba34d1bddd 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -238,7 +238,7 @@ bench-barretenberg-acir-benches-bb: ARG COMMIT_HASH DO +FOO - DO ../yarn-project/scripts/+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH barretenberg-acir-tests-bb: FROM ../build-images/+build From 8f071aeef37026fcf621e5813a9b581202b66c6e Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 18:59:54 +0000 Subject: [PATCH 29/48] chore: change `builder_command` --- .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 23dbb4282169..09690f34d376 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,7 +137,7 @@ jobs: # if they fail to copy, it will try to build them on the tester and fail builder_images_to_copy: aztecprotocol/barretenberg-acir-benches-bb:${{ env.GIT_COMMIT }} # command to produce the images in case they don't exist - builder_command: cd noir && ../scripts/earthly-ci +bench-barretenberg-acir-benches-bb + builder_command: cd noir && ../scripts/earthly-ci +export-barretenberg-acir-benches-bb run: | set -eux cd ./noir/ From 3d6dc59c27f8f180e1f1da831b6e2d136a9ef2a8 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 19:05:35 +0000 Subject: [PATCH 30/48] chore: 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 09690f34d376..071cd12ee2ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,7 +135,7 @@ jobs: 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/barretenberg-acir-benches-bb:${{ env.GIT_COMMIT }} + builder_images_to_copy: aztecprotocol/barretenberg-acir-benches:${{ env.GIT_COMMIT }} # command to produce the images in case they don't exist builder_command: cd noir && ../scripts/earthly-ci +export-barretenberg-acir-benches-bb run: | From 3b77eadea08e735cf467977547630ae4d5a40c02 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 19:15:05 +0000 Subject: [PATCH 31/48] chore: fix --- noir/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir/Earthfile b/noir/Earthfile index 9dba34d1bddd..1947b686ddc8 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -223,7 +223,7 @@ FOO: # Let docker compose know about the pushed tags above ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD) # Optimize to not cause serial behavior if image already exists - IF ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/barretenberg-acir-benches-bb:$AZTEC_DOCKER_TAG" + IF ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG" WAIT BUILD +export-barretenberg-acir-benches-bb END From 8f2f2f88e6fdfc422d70f1aaabfc204f353a09e2 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 19:26:53 +0000 Subject: [PATCH 32/48] foo --- .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 7ad679dd4a7e..5901656ce8fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,7 +135,7 @@ jobs: 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/barretenberg-acir-benches:${{ env.GIT_COMMIT }} + builder_images_to_copy: aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/barretenberg-acir-benches:${{ env.GIT_COMMIT }} # command to produce the images in case they don't exist builder_command: cd noir && ../scripts/earthly-ci +export-barretenberg-acir-benches-bb run: | From f8fa03bae9dccc397ece7e01faa0814847c5e8fe Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 19:40:00 +0000 Subject: [PATCH 33/48] chore: foo --- .github/ensure-tester-with-images/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ensure-tester-with-images/action.yml b/.github/ensure-tester-with-images/action.yml index 52bb975d223b..633ce3b06bb7 100644 --- a/.github/ensure-tester-with-images/action.yml +++ b/.github/ensure-tester-with-images/action.yml @@ -64,7 +64,7 @@ runs: sudo flock /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.lock bash -c ' if ! [ -f /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli ] ; then - docker save aztecprotocol/aztec:${{ env.IMAGE_KEY }} aztecprotocol/end-to-end:${{ env.IMAGE_KEY }} | brotli -2 > /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli.tmp + docker save aztecprotocol/aztec:${{ env.IMAGE_KEY }} aztecprotocol/end-to-end:${{ env.IMAGE_KEY }} aztecprotocol/barretenberg-acir-benches:${{ env.IMAGE_KEY }} | brotli -2 > /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli.tmp mv /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli.tmp /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli fi' sudo cat /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli From bad5c1c98fc2bc9e95cd4d80bf13283ce7e03850 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 19:59:15 +0000 Subject: [PATCH 34/48] wip --- .github/workflows/ci.yml | 5 +++-- noir/Earthfile | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5901656ce8fa..ed34f7ee8515 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,16 +137,17 @@ jobs: # 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/barretenberg-acir-benches:${{ env.GIT_COMMIT }} # command to produce the images in case they don't exist - builder_command: cd noir && ../scripts/earthly-ci +export-barretenberg-acir-benches-bb + builder_command: cd noir && ../scripts/earthly-ci +export-bench-acir-bb run: | set -eux cd ./noir/ export FORCE_COLOR=1 + export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" ../scripts/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 \ - +bench-barretenberg-acir-benches-bb + +bench-publish-acir-bb bench-summary: needs: bench-e2e diff --git a/noir/Earthfile b/noir/Earthfile index 1947b686ddc8..eca235f9a025 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -212,7 +212,7 @@ barretenberg-acir-benches-bb: WORKDIR /usr/src/barretenberg/acir_tests -export-barretenberg-acir-benches-bb: +export-bench-acir-bb: ARG EARTHLY_GIT_HASH FROM +barretenberg-acir-benches-bb SAVE IMAGE aztecprotocol/barretenberg-acir-benches:$EARTHLY_GIT_HASH @@ -232,7 +232,7 @@ FOO: RUN touch ./log RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 -bench-barretenberg-acir-benches-bb: +bench-publish-acir-bb: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH From 17f3df8f19207c1db63df354408e3fda026f7548 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 20:00:34 +0000 Subject: [PATCH 35/48] chore: remove foo --- noir/Earthfile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/noir/Earthfile b/noir/Earthfile index eca235f9a025..aa3a2baf99f9 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -217,9 +217,11 @@ export-bench-acir-bb: FROM +barretenberg-acir-benches-bb SAVE IMAGE aztecprotocol/barretenberg-acir-benches:$EARTHLY_GIT_HASH -FOO: - FUNCTION - LOCALLY +bench-publish-acir-bb: + ARG PULL_REQUEST + ARG BRANCH + ARG COMMIT_HASH + # Let docker compose know about the pushed tags above ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD) # Optimize to not cause serial behavior if image already exists @@ -232,12 +234,6 @@ FOO: RUN touch ./log RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 -bench-publish-acir-bb: - ARG PULL_REQUEST - ARG BRANCH - ARG COMMIT_HASH - - DO +FOO DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH barretenberg-acir-tests-bb: From cd73efebd8641d6fbfee894bfdbe14789647e829 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 20:07:09 +0000 Subject: [PATCH 36/48] chore: replace hardcoded list with `builder_images_to_copy` --- .github/ensure-tester-with-images/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ensure-tester-with-images/action.yml b/.github/ensure-tester-with-images/action.yml index 633ce3b06bb7..0503d88c1ab5 100644 --- a/.github/ensure-tester-with-images/action.yml +++ b/.github/ensure-tester-with-images/action.yml @@ -64,7 +64,7 @@ runs: sudo flock /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.lock bash -c ' if ! [ -f /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli ] ; then - docker save aztecprotocol/aztec:${{ env.IMAGE_KEY }} aztecprotocol/end-to-end:${{ env.IMAGE_KEY }} aztecprotocol/barretenberg-acir-benches:${{ env.IMAGE_KEY }} | brotli -2 > /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli.tmp + docker save ${{ inputs.builder_images_to_copy }} | brotli -2 > /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli.tmp mv /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli.tmp /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli fi' sudo cat /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli From a52ecbba4792bb4bea3af375261e6e9f42dbd5f8 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Wed, 15 May 2024 21:13:38 +0100 Subject: [PATCH 37/48] Update .github/workflows/ci.yml --- .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 ed34f7ee8515..da57b1a32c1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,7 +135,7 @@ jobs: 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/barretenberg-acir-benches:${{ env.GIT_COMMIT }} + builder_images_to_copy: aztecprotocol/barretenberg-acir-benches:${{ env.GIT_COMMIT }} # command to produce the images in case they don't exist builder_command: cd noir && ../scripts/earthly-ci +export-bench-acir-bb run: | From 6b66a88bc377bd3dc252fe5d4e55d4beffe546f2 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 20:16:56 +0000 Subject: [PATCH 38/48] run benchmarks `LOCALLY` --- noir/Earthfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/noir/Earthfile b/noir/Earthfile index aa3a2baf99f9..a6ccd0f99734 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -216,12 +216,13 @@ export-bench-acir-bb: ARG EARTHLY_GIT_HASH FROM +barretenberg-acir-benches-bb SAVE IMAGE aztecprotocol/barretenberg-acir-benches:$EARTHLY_GIT_HASH - + bench-publish-acir-bb: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH - + LOCALLY + # Let docker compose know about the pushed tags above ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD) # Optimize to not cause serial behavior if image already exists From 7f5fff88fe409e752391647d899f5f36f2484b29 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 20:20:51 +0000 Subject: [PATCH 39/48] chore: revert change to ensure-images pending other PR --- .github/ensure-tester-with-images/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ensure-tester-with-images/action.yml b/.github/ensure-tester-with-images/action.yml index 0503d88c1ab5..633ce3b06bb7 100644 --- a/.github/ensure-tester-with-images/action.yml +++ b/.github/ensure-tester-with-images/action.yml @@ -64,7 +64,7 @@ runs: sudo flock /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.lock bash -c ' if ! [ -f /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli ] ; then - docker save ${{ inputs.builder_images_to_copy }} | brotli -2 > /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli.tmp + docker save aztecprotocol/aztec:${{ env.IMAGE_KEY }} aztecprotocol/end-to-end:${{ env.IMAGE_KEY }} aztecprotocol/barretenberg-acir-benches:${{ env.IMAGE_KEY }} | brotli -2 > /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli.tmp mv /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli.tmp /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli fi' sudo cat /var/lib/docker/tmp-images/${{ env.IMAGE_KEY }}.brotli From 27fcfbcb80c336fe0712c914cd88563443d8089c Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 20:33:29 +0000 Subject: [PATCH 40/48] chore: fix --- noir/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir/Earthfile b/noir/Earthfile index a6ccd0f99734..c16df92ee2cb 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -228,7 +228,7 @@ bench-publish-acir-bb: # Optimize to not cause serial behavior if image already exists IF ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG" WAIT - BUILD +export-barretenberg-acir-benches-bb + BUILD +export-bench-acir-bb END END From 3335bf8f94b91a146149bf07eb520c0569b1eb6c Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 15 May 2024 20:38:24 +0000 Subject: [PATCH 41/48] chore: fix --- noir/Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noir/Earthfile b/noir/Earthfile index c16df92ee2cb..f5d1389c2e35 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -232,8 +232,8 @@ bench-publish-acir-bb: END END - RUN touch ./log - RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 + RUN mkdir -p ./log + RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log/foo --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH From bfef6045e02827f14b1273701b02bf5b896a7d6f Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 16 May 2024 09:23:25 -0400 Subject: [PATCH 42/48] chore: acir benchmark use slim image (#6456) --- noir/Earthfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/noir/Earthfile b/noir/Earthfile index f5d1389c2e35..dee6a20fcd04 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -202,8 +202,9 @@ build-acir-tests: SAVE ARTIFACT /usr/src/noir-repo/test_programs/acir_artifacts/* barretenberg-acir-benches-bb: - FROM ../build-images/+build - + FROM ubuntu:noble + RUN apt update && \ + apt install -y curl git jq unzip 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 From a630b1e1891386f4c32cfc2559bcc4ff1581cfba Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 16 May 2024 23:21:59 +0000 Subject: [PATCH 43/48] wip --- .github/workflows/ci.yml | 4 +++- noir/Earthfile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 713f710a8f8b..556537fb72a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,7 +183,9 @@ jobs: +bench-publish-acir-bb bench-summary: - needs: bench-e2e + needs: + - acir-bench + - bench-e2e runs-on: ${{ inputs.username || github.actor }}-x86 steps: - uses: actions/checkout@v4 diff --git a/noir/Earthfile b/noir/Earthfile index dee6a20fcd04..c07fdc65e7e4 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -234,7 +234,7 @@ bench-publish-acir-bb: END RUN mkdir -p ./log - RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log/foo --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 + RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log/acir-bench.jsonl --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH From 5df247ebbb5aab87db746c7c5915393deff36a38 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 16 May 2024 23:24:27 +0000 Subject: [PATCH 44/48] chore: rename log file --- noir/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir/Earthfile b/noir/Earthfile index c07fdc65e7e4..22e5175c4e9f 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -234,7 +234,7 @@ bench-publish-acir-bb: END RUN mkdir -p ./log - RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log/acir-bench.jsonl --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 + RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log/bench-acir.jsonl --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH From 223c90e7836919b316e7ecc27e8fcde486ac9c0d Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 16 May 2024 23:38:50 +0000 Subject: [PATCH 45/48] chore: turn off other benches --- .github/workflows/ci.yml | 66 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 556537fb72a5..376f627416fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,38 +120,38 @@ jobs: ../../scripts/earthly-ci -P --no-output +${{ matrix.test }} # all the benchmarking end-to-end integration tests for aztec (not required to merge) - bench-e2e: - needs: build - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - test: ${{ fromJson( needs.build.outputs.bench_list )}} - steps: - - uses: actions/checkout@v4 - with: { ref: "${{ env.GIT_COMMIT }}" } - - uses: ./.github/ci-setup-action - - name: Setup and Test - uses: ./.github/ensure-tester-with-images - timeout-minutes: 40 - with: - runner_type: ${{ contains(matrix.test, 'prover') && '64core-tester-x86' || '16core-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: cd yarn-project/end-to-end/ && ../../scripts/earthly-ci +${{ matrix.test }} - run: | - set -eux - cd ./yarn-project/end-to-end/ - export FORCE_COLOR=1 - export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" - ../../scripts/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 }} + # bench-e2e: + # needs: build + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # test: ${{ fromJson( needs.build.outputs.bench_list )}} + # steps: + # - uses: actions/checkout@v4 + # with: { ref: "${{ env.GIT_COMMIT }}" } + # - uses: ./.github/ci-setup-action + # - name: Setup and Test + # uses: ./.github/ensure-tester-with-images + # timeout-minutes: 40 + # with: + # runner_type: ${{ contains(matrix.test, 'prover') && '64core-tester-x86' || '16core-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: cd yarn-project/end-to-end/ && ../../scripts/earthly-ci +${{ matrix.test }} + # run: | + # set -eux + # cd ./yarn-project/end-to-end/ + # export FORCE_COLOR=1 + # export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" + # ../../scripts/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 }} acir-bench: runs-on: ubuntu-latest @@ -185,7 +185,7 @@ jobs: bench-summary: needs: - acir-bench - - bench-e2e + # - bench-e2e runs-on: ${{ inputs.username || github.actor }}-x86 steps: - uses: actions/checkout@v4 From 134a0a1a808915d836250d0a9acd2850a361b615 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Fri, 17 May 2024 00:20:18 +0000 Subject: [PATCH 46/48] chore: rename `name` to `eventName` in bb benchmarks --- barretenberg/cpp/src/barretenberg/common/benchmark.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/barretenberg/cpp/src/barretenberg/common/benchmark.hpp b/barretenberg/cpp/src/barretenberg/common/benchmark.hpp index 98715635c926..ad966dc3833d 100644 --- a/barretenberg/cpp/src/barretenberg/common/benchmark.hpp +++ b/barretenberg/cpp/src/barretenberg/common/benchmark.hpp @@ -94,7 +94,7 @@ template void write_benchmark(const std::string& } std::ostringstream oss; oss << "{\"timestamp\": \"" << getCurrentTimestamp() << "\", " - << "\"name\": \"" << name << "\", " + << "\"eventName\": \"" << name << "\", " << "\"type\": \"" << TypeTraits::type << "\", " << "\"value\": " << value << ", " << "\"threads\": " << env_hardware_concurrency(); From f609e2125ba3e5f71d7b2c119d408c8af4b6cf9a Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Fri, 17 May 2024 11:14:34 +0000 Subject: [PATCH 47/48] chore: reactivate other benchmarks --- .github/workflows/ci.yml | 66 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b66f32104d3e..6b4db3a4d531 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,38 +120,38 @@ jobs: ../../scripts/earthly-ci -P --no-output +${{ matrix.test }} # all the benchmarking end-to-end integration tests for aztec (not required to merge) - # bench-e2e: - # needs: build - # runs-on: ubuntu-latest - # strategy: - # fail-fast: false - # matrix: - # test: ${{ fromJson( needs.build.outputs.bench_list )}} - # steps: - # - uses: actions/checkout@v4 - # with: { ref: "${{ env.GIT_COMMIT }}" } - # - uses: ./.github/ci-setup-action - # - name: Setup and Test - # uses: ./.github/ensure-tester-with-images - # timeout-minutes: 40 - # with: - # runner_type: ${{ contains(matrix.test, 'prover') && '64core-tester-x86' || '16core-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: cd yarn-project/end-to-end/ && ../../scripts/earthly-ci +${{ matrix.test }} - # run: | - # set -eux - # cd ./yarn-project/end-to-end/ - # export FORCE_COLOR=1 - # export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" - # ../../scripts/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 }} + bench-e2e: + needs: build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + test: ${{ fromJson( needs.build.outputs.bench_list )}} + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + - uses: ./.github/ci-setup-action + - name: Setup and Test + uses: ./.github/ensure-tester-with-images + timeout-minutes: 40 + with: + runner_type: ${{ contains(matrix.test, 'prover') && '64core-tester-x86' || '16core-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: cd yarn-project/end-to-end/ && ../../scripts/earthly-ci +${{ matrix.test }} + run: | + set -eux + cd ./yarn-project/end-to-end/ + export FORCE_COLOR=1 + export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" + ../../scripts/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 }} acir-bench: runs-on: ubuntu-latest @@ -185,7 +185,7 @@ jobs: bench-summary: needs: - acir-bench - # - bench-e2e + - bench-e2e runs-on: ${{ inputs.username || github.actor }}-x86 steps: - uses: actions/checkout@v4 From b9fbe764d947b60ee61b96648e37c8819cf49380 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Mon, 20 May 2024 14:18:30 +0100 Subject: [PATCH 48/48] Update yarn-project/scripts/src/benchmarks/aggregate.ts Co-authored-by: Santiago Palladino --- yarn-project/scripts/src/benchmarks/aggregate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/scripts/src/benchmarks/aggregate.ts b/yarn-project/scripts/src/benchmarks/aggregate.ts index 210fb3dc3519..caa95c220101 100644 --- a/yarn-project/scripts/src/benchmarks/aggregate.ts +++ b/yarn-project/scripts/src/benchmarks/aggregate.ts @@ -69,7 +69,7 @@ function append( /** Processes an entry with event name 'acir-proof-generated' and updates results */ function processAcirProofGenerated(entry: ProofConstructed, results: BenchmarkCollectedResults) { - if (entry.acir_test == 'sha256') { + if (entry.acir_test === 'sha256') { append(results, `proof_construction_time_sha256`, entry.threads, entry.value); } }