@@ -238,6 +238,103 @@ jobs:
238238 --data "$data"
239239 fi
240240
241+ # Spartan network benchmarks triggered on-demand from a PR label.
242+ # Runs TPS and proving benchmarks in parallel, uploads results to a PR-specific
243+ # path on the benchmark dashboard so nightly (bench/next) is never affected.
244+ # One-time use: label is removed after the job runs.
245+ ci-network-bench :
246+ name : ${{ matrix.bench_type }}
247+ runs-on : ubuntu-latest
248+ strategy :
249+ fail-fast : false
250+ matrix :
251+ include :
252+ - bench_type : benchmark
253+ ci3_cmd : network-bench
254+ scenario : tps-scenario
255+ namespace_suffix : bench
256+ download_cmd : gh-spartan-bench
257+ timeout : 300
258+ - bench_type : proving-benchmark
259+ ci3_cmd : network-proving-bench
260+ scenario : prove-n-tps-fake
261+ namespace_suffix : proving-bench
262+ download_cmd : gh-spartan-proving-bench
263+ timeout : 240
264+ needs : ci
265+ if : github.event.pull_request.head.repo.fork != true && github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'ci-network-bench') && (needs.ci.result == 'success' || needs.ci.result == 'skipped')
266+ steps :
267+ - name : Remove label (one-time use)
268+ env :
269+ GH_TOKEN : ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
270+ run : gh pr edit ${{ github.event.pull_request.number }} --remove-label ci-network-bench --repo ${{ github.repository }} || true
271+
272+ - name : Checkout
273+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
274+ with :
275+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
276+
277+ - name : Run Network Benchmarks
278+ timeout-minutes : ${{ matrix.timeout }}
279+ env :
280+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
281+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
282+ GITHUB_TOKEN : ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
283+ BUILD_INSTANCE_SSH_KEY : ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
284+ GCP_SA_KEY : ${{ secrets.GCP_SA_KEY }}
285+ GCP_PROJECT_ID : ${{ secrets.GCP_PROJECT_ID }}
286+ # For pushing docker images built from the PR
287+ DOCKERHUB_PASSWORD : ${{ secrets.DOCKERHUB_PASSWORD }}
288+ DOCKERHUB_USERNAME : ${{ secrets.DOCKERHUB_USERNAME }}
289+ SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
290+ RUN_ID : ${{ github.run_id }}
291+ AWS_SHUTDOWN_TIME : ${{ matrix.timeout }}
292+ NO_SPOT : 1
293+ run : |
294+ namespace=pr-${{ github.event.pull_request.number }}-${{ matrix.namespace_suffix }}
295+ echo "NAMESPACE=$namespace" >> $GITHUB_ENV
296+ set -x
297+ ./.github/ci3.sh ${{ matrix.ci3_cmd }} ${{ matrix.scenario }} "$namespace"
298+
299+ - name : Cleanup network resources
300+ if : always()
301+ env :
302+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
303+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
304+ GITHUB_TOKEN : ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
305+ BUILD_INSTANCE_SSH_KEY : ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
306+ GCP_SA_KEY : ${{ secrets.GCP_SA_KEY }}
307+ GCP_PROJECT_ID : ${{ secrets.GCP_PROJECT_ID }}
308+ NO_SPOT : 1
309+ run : ./.github/ci3.sh network-teardown ${{ matrix.scenario }} "${NAMESPACE}" || true
310+
311+ - name : Download benchmarks
312+ if : always()
313+ env :
314+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
315+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
316+ run : |
317+ if ./ci.sh ${{ matrix.download_cmd }}; then
318+ echo "ENABLE_DEPLOY_BENCH=1" >> $GITHUB_ENV
319+ fi
320+
321+ - name : Upload benchmarks
322+ if : always() && env.ENABLE_DEPLOY_BENCH == '1'
323+ uses : benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
324+ with :
325+ name : Spartan
326+ benchmark-data-dir-path : " bench/pr-${{ github.event.pull_request.number }}"
327+ tool : " customSmallerIsBetter"
328+ output-file-path : ./bench-out/bench.json
329+ gh-repository : github.com/AztecProtocol/benchmark-page-data
330+ github-token : ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
331+ auto-push : true
332+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
333+ alert-threshold : " 120%"
334+ comment-on-alert : false
335+ fail-on-alert : false
336+ max-items-in-chart : 100
337+
241338 # KIND-based e2e tests that run on a local Kubernetes cluster.
242339 # One-time use: label is removed after the job runs.
243340 ci-network-kind :
0 commit comments