Skip to content

Commit c107b6b

Browse files
authored
chore: Block building benchmark via github-action-benchmark (#11202)
Deletes old benchmarks, along with the benchmark-related scripts and types. Adds a single benchmark for block building, with a stubbed `TelemetryClient` that collects all datapoints in memory, and then flushes a set of specified metrics into the custom format expected by [github-action-benchmark](https://github.com/benchmark-action/github-action-benchmark), which we're currently using for bb. Benchmarks get published to https://aztecprotocol.github.io/aztec-packages/dev/e2e-bench/ Fixes #11154
1 parent 2bd895b commit c107b6b

39 files changed

+452
-1933
lines changed

.github/workflows/ci.yml

+21-51
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ jobs:
239239
ci3/cache_upload_flag "$artifact"
240240
fi
241241
242-
# all the benchmarking end-to-end integration tests for aztec (not required to merge)
242+
# All the benchmarking end-to-end integration tests for aztec (not required to merge)
243243
bench-e2e:
244244
needs: [images-e2e, configure]
245245
if: needs.configure.outputs.e2e-all == 'true' || needs.configure.outputs.bench-list != '[]'
@@ -260,15 +260,28 @@ jobs:
260260
if ci3/test_should_run "$artifact"; then
261261
docker pull aztecprotocol/aztec:${{ env.GIT_COMMIT }}
262262
docker pull aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
263-
export FORCE_COLOR=1
264-
export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}"
265-
./yarn-project/end-to-end/scripts/e2e_test.sh ${{ matrix.test }}
266-
export COMMIT_HASH=${{ env.GIT_COMMIT }}
267-
export PULL_REQUEST=${{ github.event.pull_request.number }}
268-
export BRANCH=${{ github.ref_name }}
269-
scripts/logs/upload_logs_to_s3.sh /usr/var/log
263+
FORCE_COLOR=1 ./yarn-project/end-to-end/scripts/e2e_test.sh ${{ matrix.test }}
270264
ci3/cache_upload_flag "$artifact"
271265
fi
266+
- name: Inspect data folder
267+
continue-on-error: true
268+
run: tree ./yarn-project/end-to-end/out
269+
- name: Store benchmark result
270+
if: github.ref == 'refs/heads/master'
271+
continue-on-error: true
272+
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
273+
with:
274+
name: "End-to-end Benchmark"
275+
benchmark-data-dir-path: "dev/e2e-bench"
276+
tool: "customSmallerIsBetter"
277+
output-file-path: ./yarn-project/end-to-end/out/bench.json
278+
github-token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
279+
auto-push: true
280+
alert-threshold: "150%"
281+
comment-on-alert: true
282+
fail-on-alert: false
283+
alert-comment-cc-users: "@philwindle @spalladino"
284+
max-items-in-chart: 50
272285

273286
# Only e2e test that can't run on standard github runner
274287
e2e-prover-full:
@@ -320,49 +333,6 @@ jobs:
320333
ci3/cache_upload_flag acir-bench-$(./barretenberg/acir_tests/bootstrap.sh hash)
321334
fi
322335
323-
# TODO(ci3) fix and reinstate
324-
# bench-summary:
325-
# if: needs.configure.outputs.e2e-all == 'true'
326-
# needs:
327-
# - acir-bench
328-
# - bench-e2e
329-
# - configure
330-
# runs-on: ubuntu-latest
331-
# steps:
332-
# - uses: actions/checkout@v4
333-
# with:
334-
# fetch-depth: 100 # Downloading base benchmark from master requires access to history
335-
# ref: "${{ github.event.pull_request.head.sha }}"
336-
# - uses: ./.github/ci-setup-action
337-
# - name: "Build and upload bench aggregate file"
338-
# uses: ./.github/ensure-builder
339-
# with:
340-
# runner_type: builder-x86
341-
# username: ${{ needs.configure.outputs.username }}
342-
# run: scripts/earthly-ci ./yarn-project/scripts/+bench-aggregate
343-
# - name: "Download base benchmark and package into earthly"
344-
# if: github.event_name == 'pull_request'
345-
# uses: ./.github/run-on-builder
346-
# env:
347-
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
348-
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
349-
# BENCH_FOLDER: "./scripts/logs/tmp/bench"
350-
# PULL_REQUEST: "${{ github.event.pull_request.number }}"
351-
# with:
352-
# run: |
353-
# # Download the base benchmark locally (requires AWS creds and .git history)
354-
# mkdir -p $BENCH_FOLDER
355-
# ./scripts/logs/download_base_benchmark_from_s3.sh
356-
# # Package it into an earthly artifact to read from bench-comment
357-
# scripts/earthly-ci ./scripts/logs+pack-base-benchmark
358-
# - name: "Generate summary comment if pull request"
359-
# if: github.event_name == 'pull_request'
360-
# uses: ./.github/run-on-builder
361-
# env:
362-
# AZTEC_BOT_GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
363-
# with:
364-
# run: scripts/earthly-ci ./yarn-project/scripts/+bench-comment
365-
366336
# barretenberg (prover) native, AVM (public VM) and Merkle tree (world state) tests
367337
# ran on own runner for resource reasons (memory x cpu intensive)
368338
bb-native-tests:

scripts/logs/Earthfile

-20
This file was deleted.

scripts/logs/check_logs_for_benchmark.sh

-25
This file was deleted.

scripts/logs/download_base_benchmark_from_s3.sh

-35
This file was deleted.

scripts/logs/download_logs_from_s3.sh

-36
This file was deleted.

scripts/logs/upload_aggregated_benchmarks_to_s3.sh

-37
This file was deleted.

scripts/logs/upload_logs_to_s3.sh

-33
This file was deleted.

yarn-project/circuit-types/src/stats/benchmarks.ts

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,18 +1 @@
11
export * from './stats.js';
2-
export * from './metrics.js';
3-
export * from './benchmarks.js';
4-
5-
/** Block sizes to use for benchmark tests on multiple block sizes. */
6-
export const BENCHMARK_BLOCK_SIZES = process.env.BENCHMARK_BLOCK_SIZES
7-
? process.env.BENCHMARK_BLOCK_SIZES.split(',').map(Number)
8-
: [4, 8, 16];
9-
10-
/** Block size to use for building chains of multiple blocks. */
11-
export const BENCHMARK_HISTORY_BLOCK_SIZE = process.env.BENCHMARK_HISTORY_BLOCK_SIZE
12-
? +process.env.BENCHMARK_HISTORY_BLOCK_SIZE
13-
: 8;
14-
15-
/** Chain lengths to test for history processing benchmarks. */
16-
export const BENCHMARK_HISTORY_CHAIN_LENGTHS = process.env.BENCHMARK_HISTORY_CHAIN_LENGTHS
17-
? process.env.BENCHMARK_HISTORY_CHAIN_LENGTHS.split(',').map(x => Number(x))
18-
: [3, 5];

0 commit comments

Comments
 (0)