Skip to content

Schedule Rust Benchmarks #674

Schedule Rust Benchmarks

Schedule Rust Benchmarks #674

name: Schedule Rust Benchmarks
# This workflow is designed to execute a list of Rust benchmarks.
# It runs on a dedicated runner machine labeled 'rust-benchmarks'.
# Since there's only one machine available, the CI jobs will run one after the other.
# The dedicated machine is identified as fr1-spm15.
on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_PROJECT_DIR: ${{ github.workspace }}
CI_RUN_ID: ${{ github.run_id }}
jobs:
rust-benchmarks:
name: Bazel Run Rust Benchmarks
runs-on:
# see linux-x86-64 runner group
labels: rust-benchmarks
container:
image: ghcr.io/dfinity/ic-build@sha256:65ab9023792784e8e13dbdd5b9a63c2dff0cd38237afd1cdbc299577505d4b88
# running on bare metal machine using ubuntu user
options: --user ubuntu --mount type=tmpfs,target="/tmp/containers"
timeout-minutes: 720 # 12 hours
strategy:
matrix:
target:
- "//rs/bitcoin/..."
- "//rs/crypto/..."
- "//rs/state_manager/..."
- "//rs/certification/..."
- "//rs/boundary_node/ic_boundary/..."
- "//rs/artifact_pool/..."
- "//rs/consensus/..."
- "//rs/ingress_manager/..."
- "//rs/embedders:compilation_bench"
- "//rs/embedders:heap_bench"
- "//rs/embedders:stable_memory_bench"
- "//rs/execution_environment:execute_inspect_message_bench"
- "//rs/execution_environment:execute_query_bench"
- "//rs/execution_environment:execute_update_bench"
- "//rs/execution_environment:wasm_instructions_bench"
- "//rs/http_endpoints/..."
- "//rs/p2p/..."
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/netrc
- name: Run Rust Benchmarks
uses: ./.github/actions/bazel
env:
RUST_BACKTRACE: "full"
with:
run: |
echo -e "\e[34mRunning rust benchmarks on dedicated machine fr1-spm15!\e[0m"
CRITERION_HOME=$(mktemp -d)
trap "rm -rf $CRITERION_HOME" INT TERM EXIT
while IFS= read -r tgt; do
CRITERION_HOME="$CRITERION_HOME" bazel run "$tgt"
done < <(bazel query "attr(tags, 'rust_bench', ${{ matrix.target }})")
while IFS= read -r bench_dir; do
echo "bench dir: $bench_dir"
echo '{}' | jq -cMr \
--slurpfile benchmark "$bench_dir/benchmark.json" \
--slurpfile estimates "$bench_dir/estimates.json" \
--arg system x86_64-linux \
--arg timestamp "$(date --utc --iso-8601=seconds)" \
--arg rev "$CI_COMMIT_SHA" \
'.benchmark = $benchmark[] |
.estimates = $estimates[] |
.package = "replica-benchmarks" |
.system = $system |
.timestamp = $timestamp |
.rev = $rev |
.revCount = 1' \
>report.json
curl --fail --retry 2 -sS -o /dev/null -X POST -H 'Content-Type: application/json' --data @report.json \
"https://elasticsearch.testnet.dfinity.network/ci-performance-test/_doc"
done < <(find -L "$CRITERION_HOME" -type d -path '*/new')
echo -e "\e[34mRust benchmarks on dedicated machine fr1-spm15 finished.\e[0m"