-
Notifications
You must be signed in to change notification settings - Fork 845
[ci] Support running re-execution benchmark with arbitrary version of Firewood #4650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
d0155dd
e851903
49b7fc3
2feeda4
6f21231
b3cc8ed
e437658
15b52ee
999c3f4
34a331f
cb5e59a
e0e784b
cab333e
c131420
f79c8d5
c4561be
a89c44e
d428155
87b3d4c
6f5502b
6493598
0451870
8cf656d
cfe4960
1416e52
0a7185a
48bdef7
279e120
325e42b
a2d7b8c
73d4057
4c4d3eb
af62634
b81d12f
2ecec16
cd4a9d7
1ef0920
05c1b8d
e1be9e1
5426ee8
2b86559
90fd09a
73c876e
a92e465
81b88b6
6f944d1
8a92625
db41178
f410444
d619a21
954121b
d9b2717
6076c4f
221157a
6aef9df
c28cd33
2ac5157
1f06a14
6ad2f13
e3ab8ad
01da31a
e463b6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,6 +174,10 @@ tasks: | |
| desc: Runs shellcheck to check sanity of shell scripts | ||
| cmd: ./scripts/shellcheck.sh | ||
|
|
||
| polyrepo: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use an action name e.g. |
||
| desc: "Run polyrepo for orchestrating local dependencies. Example: LIBEVM_REF=v1.2.3 task polyrepo -- sync firewood@abc123" | ||
| cmd: ./scripts/run_polyrepo.sh {{.CLI_ARGS}} | ||
|
|
||
| setup-chain-data: | ||
| desc: Sets up C-Chain test data (blocks from S3, state from S3 or empty for genesis). | ||
| cmd: ./scripts/setup_cchain_data.sh | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # Run polyrepo tool for managing local dependencies. | ||
| # | ||
| # Usage: | ||
| # ./scripts/run_polyrepo.sh [polyrepo args...] | ||
| # | ||
| # Environment variables (optional): | ||
| # LIBEVM_REF - Git ref for libevm (runs: go get && go mod tidy) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe use env vars for both args so that the caller has a consistent way of specifying both values? |
||
| # | ||
| # Examples: | ||
| # ./scripts/run_polyrepo.sh sync firewood@abc123 # sync firewood | ||
| # ./scripts/run_polyrepo.sh status # check status | ||
| # LIBEVM_REF=v1.2.3 ./scripts/run_polyrepo.sh sync firewood@abc123 # both | ||
|
|
||
| POLYREPO_REVISION=6239973c9b | ||
|
|
||
| if [[ -n "${LIBEVM_REF:-}" ]]; then | ||
| echo "Updating libevm to ${LIBEVM_REF}..." | ||
| go get "github.com/ava-labs/libevm@${LIBEVM_REF}" | ||
| go mod tidy | ||
| fi | ||
|
|
||
| if [[ $# -gt 0 ]]; then | ||
| go run github.com/ava-labs/avalanchego/tests/fixture/polyrepo@"${POLYREPO_REVISION}" "${@}" | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -250,6 +250,48 @@ To execute a benchmark with any of these options, you must use a compatible `CUR | |
|
|
||
| The `CONFIG` parameter currently only supports pre-defined configs and not passing a full JSON blob in, so that we can define corresponding names for each config option. The config name is attached as a label to the exported metrics and included in the name of the sub-benchmark (used by GitHub Action Benchmark to separate historical results with different configs). | ||
|
|
||
| ## Testing with Custom Dependency Versions | ||
|
|
||
| The benchmarks support testing with custom versions of `libevm` and `firewood` dependencies. This is useful for: | ||
| - Testing unreleased versions before merging | ||
| - Benchmarking performance changes in dependencies | ||
| - Reproducing issues with specific dependency versions | ||
|
|
||
| ### Local Usage | ||
|
|
||
| **Prerequisite**: You must be in a nix shell (`nix develop`). | ||
|
|
||
| Use `run_polyrepo.sh` to set up custom dependencies: | ||
| - `LIBEVM_REF=<ref>` env var updates libevm via `go get` | ||
| - `sync firewood@<ref>` arg syncs firewood via polyrepo | ||
|
|
||
| ```bash | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (No action required) Maybe include a single example with both versions and document that both or either one can be provided? Same comment for the CI invocation examples.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| # Both libevm and firewood | ||
| LIBEVM_REF=v1.2.3 ./scripts/run_polyrepo.sh sync firewood@abc123def | ||
|
|
||
| # Only firewood | ||
| ./scripts/run_polyrepo.sh sync firewood@abc123def | ||
|
|
||
| # Only libevm | ||
| LIBEVM_REF=v1.2.3 ./scripts/run_polyrepo.sh | ||
|
|
||
| # Then run the benchmark | ||
| ./scripts/run_task.sh test-cchain-reexecution -- firewood-101-250k | ||
| ``` | ||
|
|
||
| ### CI Usage | ||
|
|
||
| Use `with-dependencies` to specify custom versions. Either or both can be provided: | ||
|
|
||
| ```bash | ||
| gh workflow run "C-Chain Re-Execution Benchmark GH Native" \ | ||
| -f test=firewood-101-250k \ | ||
| -f with-dependencies="firewood=abc123,libevm=v1.2.3" \ | ||
| -f runner=blacksmith-4vcpu-ubuntu-2404 | ||
| ``` | ||
|
|
||
| See [Trigger Workflow Dispatch with GitHub CLI](#trigger-workflow-dispatch-with-github-cli) for more examples. | ||
|
|
||
| ## Metrics | ||
|
|
||
| The C-Chain benchmarks export VM metrics to the same Grafana instance as AvalancheGo CI: https://grafana-poc.avax-dev.network/. | ||
|
|
@@ -323,6 +365,18 @@ gh workflow run "C-Chain Re-Execution Benchmark GH Native" \ | |
| -f timeout-minutes=60 | ||
| ``` | ||
|
|
||
| ### Using Custom Dependency Versions | ||
|
|
||
| Use `with-dependencies` to specify `firewood=<ref>` and/or `libevm=<ref>`: | ||
|
|
||
| ```bash | ||
| gh workflow run "C-Chain Re-Execution Benchmark GH Native" \ | ||
| -f test=firewood-101-250k \ | ||
| -f with-dependencies="firewood=abc123def,libevm=v1.2.3" \ | ||
| -f runner=blacksmith-4vcpu-ubuntu-2404 \ | ||
| -f timeout-minutes=60 | ||
| ``` | ||
|
|
||
| ### Using Custom Parameters | ||
|
|
||
| ```bash | ||
|
|
@@ -335,3 +389,13 @@ gh workflow run "C-Chain Re-Execution Benchmark GH Native" \ | |
| -f runner=ubuntu-latest \ | ||
| -f timeout-minutes=360 | ||
| ``` | ||
|
|
||
| ### Pushing Post-Execution State to S3 | ||
|
|
||
| ```bash | ||
| gh workflow run "C-Chain Re-Execution Benchmark GH Native" \ | ||
| -f test=hashdb-101-250k \ | ||
| -f runner=blacksmith-4vcpu-ubuntu-2404 \ | ||
| -f push-post-state=s3://avalanchego-bootstrap-testing/cchain-current-state-new/ \ | ||
| -f timeout-minutes=60 | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When custom dependencies (firewood-ref or libevm-ref) are used,
go.mod/go.sum are modified. This causes github-action-benchmark
to fail when checking out gh-pages.
New input skips comparison step only when custom deps are present,
preserving summary display for normal PR runs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to make this skip automatic with an appropriate warning if the tree is dirty?