diff --git a/bootstrap.sh b/bootstrap.sh index 919c1a331448..6c5aa022db64 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -484,6 +484,14 @@ function bench { } +function bench_if_enabled { + if [ "${BENCH_UPLOAD:-1}" == 0 ]; then + echo "Skipping benchmarks because BENCH_UPLOAD=0." + return + fi + bench +} + ### RELEASING ########################################################################################################## function versions { local noir_version anvil_version node_version cmake_version clang_version zig_version rustc_version wasi_sdk_version @@ -750,14 +758,14 @@ case "$cmd" in export USE_TEST_CACHE=1 export CI_FULL=1 build_and_test full - bench + bench_if_enabled ;; "ci-full-no-test-cache") export CI=1 export USE_TEST_CACHE=0 export CI_FULL=1 build_and_test full - bench + bench_if_enabled ;; "ci-chonk-input-update") export CI=1 diff --git a/ci.sh b/ci.sh index 01d2e6aeb8b4..15123df7cccd 100755 --- a/ci.sh +++ b/ci.sh @@ -96,9 +96,17 @@ function multi_job_run { export AWS_SHUTDOWN_TIME_ARM=${AWS_SHUTDOWN_TIME_ARM:-90} export DENOISE=1 export DENOISE_WIDTH=32 + # Only the first full shard should run and upload the bench artifact. Heavy + # merge-queue modes already grind tests across many shards; repeating the + # post-test bench sweep on every shard is redundant and can overrun the queue. + local bench_primary=${1%% *} + export bench_primary run() { [ -n "${4:-}" ] && export REF_NAME=$4 - PARENT_LOG_ID=$RUN_ID JOB_ID=$1 INSTANCE_POSTFIX=$1 ARCH=$2 exec denoise "bootstrap_ec2 './bootstrap.sh $3'" + local bench_upload=${BENCH_UPLOAD:-1} + [ "$1" != "$bench_primary" ] && bench_upload=0 + PARENT_LOG_ID=$RUN_ID JOB_ID=$1 INSTANCE_POSTFIX=$1 ARCH=$2 BENCH_UPLOAD=$bench_upload \ + exec denoise "bootstrap_ec2 './bootstrap.sh $3'" } export -f run