feat: github proving benchmark #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Benchmark proving | |
on: | |
schedule: | |
- cron: '0 4 * * *' | |
workflow_dispatch: | |
branches: | |
- "**" | |
#TODO REMOVE PR EXECUTION | |
push: | |
branches: [develop, main] | |
pull_request: | |
branches: | |
- "**" | |
env: | |
BENCHMARK_WITNESS: artifacts/witness_b19807080.json | |
jobs: | |
benchmark_proving: | |
name: Benchmark proving for representative blocks | |
runs-on: zero-reg | |
timeout-minutes: 200 # Timeout TBD | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Build the project | |
run: | | |
RUSTFLAGS='-C target-cpu=native -Zlinker-features=-lld' cargo build --release | |
sudo su -c "echo 0 > /proc/sys/kernel/perf_event_paranoid" | |
- name: Download previous results | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
workflow: benchmark.yml | |
workflow_conclusion: success | |
name: proving_benchmark | |
path: ./proving_benchmark_results.txt | |
if_no_artifact_found: ignore | |
- name: List previous results | |
run: | | |
ls -la ./ | |
cat proving_benchmark_results.txt | |
- name: Run the script | |
# TODO - run the benchmark with 20 blocks file | |
run: | | |
echo "Benchmarking proving for $BENCHMARK_WITNESS" | |
./scripts/benchmark_input.sh $BENCHMARK_WITNESS | tee benchmark_output.log | |
MEASURED_PROVING_TIME_SEC=`cat benchmark_output.log | grep 'Proving duration:' | tail -1 | awk '{ print int($3)}'` | |
MEASURED_PROVING_CPU_CLOCK_COUNT=`cat output.log | grep 'cycles' | tail -1 | awk '{ print int($1)}'` | |
printf '%s sec: %10s cpu: %30s %s\n' `date --utc +%y-%m-%d-%H:%M:%S` $MEASURED_PROVING_TIME_SEC $MEASURED_PROVING_CPU_CLOCK_COUNT $BENCHMARK_WITNESS >> proving_benchmark_results.txt | |
- name: List current output | |
run: | | |
ls -la ./ | |
cat output.log | |
- name: Upload new results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: proving_benchmark | |
path: ./proving_benchmark_results.txt | |
retention-days: 90 | |
overwrite: true | |