Skip to content

Bench Vs Nightly

Bench Vs Nightly #86

name: Bench Vs Nightly
on:
schedule:
# 03:00 America/Argentina/Buenos_Aires = 06:00 UTC
- cron: "0 6 * * *"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: bench-vs-nightly-${{ github.ref }}
cancel-in-progress: true
jobs:
bench-vs:
runs-on: [self-hosted, bench]
timeout-minutes: 720
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust Environment
uses: ./.github/actions/setup-rust
- name: Add cargo to PATH
run: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Add SP1 to PATH
run: echo "$HOME/.sp1/bin" >> "$GITHUB_PATH"
- name: Install SP1 toolchain
run: |
export PATH="$HOME/.cargo/bin:$HOME/.sp1/bin:$PATH"
if ! cargo prove --version 2>/dev/null | grep -qE '\b6\.0\.1\b'; then
curl -L https://sp1up.succinct.xyz | bash
export PATH="$HOME/.sp1/bin:$PATH"
sp1up --version v6.0.1
fi
cargo prove --version
- name: Run nightly benchmark
run: |
bash ./bench_vs/run.sh \
--steps 1000000 2000000 4000000 8000000 16000000 \
--report-dir bench_vs_artifacts \
--no-color
- name: Run ethrex block benchmarks
id: ethrex_bench
# continue-on-error so the artifact upload, summary, and Slack steps below still
# run even when the ethrex bench fails; the "Fail if ethrex benchmark failed" step
# at the end of the job re-surfaces the failure so the run shows red.
continue-on-error: true
run: |
# Provision the RISC-V sysroot in a user-writable dir instead of the default
# /opt/lambda-vm-sysroot, which on the self-hosted bench runner is root-owned
# and was never fully provisioned (missing libc headers for guest C dependencies).
# `make` (via SYSROOT_DIR ?=) picks this up and passes it as clang's
# --sysroot, so the guest ELF rebuild self-provisions with no sudo, and the
# extracted sysroot persists in $HOME across runs on the persistent
# self-hosted runner (no actions/cache step is involved).
export SYSROOT_DIR="$HOME/.lambda-vm-sysroot"
bash ./bench_vs/run_ethrex.sh \
--report-dir bench_vs_artifacts \
--rebuild-elf \
--no-color
- name: Upload nightly benchmark artifact
uses: actions/upload-artifact@v4
with:
name: bench-vs-nightly-${{ github.run_number }}-${{ github.sha }}
path: bench_vs_artifacts
retention-days: 90
- name: Publish summary
run: cat bench_vs_artifacts/summary.md >> "$GITHUB_STEP_SUMMARY"
- name: Post results to Slack
if: always()
env:
SLACK_WEBHOOK: ${{ github.event_name == 'workflow_dispatch' && secrets.BENCH_VS_SLACK_WEBHOOK_TEST || secrets.BENCH_VS_SLACK_WEBHOOK }}
run: bash .github/scripts/publish_bench_vs.sh "$SLACK_WEBHOOK"
- name: Fail if ethrex benchmark failed
if: always() && steps.ethrex_bench.outcome == 'failure'
run: |
echo "::error::ethrex block benchmark step failed - see the 'Run ethrex block benchmarks' step logs"
exit 1