Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1e7faf0
chore: add c-chain-reexecution benchmark as concrete tasks
Elvis339 Oct 27, 2025
bf4fb7f
ci(c-chain-reexecution):
Elvis339 Oct 27, 2025
2d94d69
ci(c-chain-reexecution): replace `fromJSON` construction
Elvis339 Oct 27, 2025
7e4e52c
Merge branch 'master' into es/taskify-reexecution
Elvis339 Oct 27, 2025
d4f2f1b
ci(c-chain-reexecution): set correct config json path
Elvis339 Oct 27, 2025
52e17c8
test-ci(c-chain-reexecution): set correct config json path
Elvis339 Oct 27, 2025
f28890f
test-ci(c-chain-reexecution): switch back to `fromJSON` construction
Elvis339 Oct 27, 2025
48e272d
ci(c-chain-reexecution-benchmark)
Elvis339 Oct 28, 2025
0fcb8f4
Merge branch 'master' into es/taskify-reexecution
Elvis339 Oct 28, 2025
58075af
ci(c-chain-reexecution-benchmark): add `c-chain-reexecution-hashdb-10…
Elvis339 Oct 28, 2025
0a8a6e3
lint
Elvis339 Oct 28, 2025
af32912
ci(c-chain-reexecution-benchmark): install xz-utils on self-hosted ru…
Elvis339 Oct 28, 2025
581c2d1
ci(c-chain-reexecution-benchmark): remove `FILTER_BY_OWNER` from `Sho…
Elvis339 Oct 28, 2025
e44dfc4
test-ci(c-chain-reexecution-benchmark): upload benchmark results
Elvis339 Oct 28, 2025
3f1166b
ci(c-chain-reexecution-benchmark): fix missing benchmark file path in…
Elvis339 Oct 28, 2025
e5dc324
ci(c-chain-reexecution-benchmark): fix missing benchmark file path in…
Elvis339 Oct 28, 2025
bca25cc
ci(c-chain-reexecution-benchmark): fix missing benchmark file path in…
Elvis339 Oct 28, 2025
5e2c482
ci(c-chain-reexecution-benchmark): fix missing benchmark file path in…
Elvis339 Oct 28, 2025
e28693c
ci(c-chain-reexecution-benchmark): fix missing benchmark file path in…
Elvis339 Oct 28, 2025
73bbaa6
ci(c-chain-reexecution-benchmark): simplify workspace handling and fi…
Elvis339 Oct 28, 2025
098871b
ci(c-chain-reexecution-benchmark): simplify workspace handling and fi…
Elvis339 Oct 28, 2025
5664f93
ci(c-chain-reexecution-benchmark)
Elvis339 Oct 28, 2025
670500a
Merge branch 'master' into es/taskify-reexecution
Elvis339 Oct 28, 2025
4ead15b
co-pilot pr review
Elvis339 Oct 28, 2025
b9ae96f
Merge remote-tracking branch 'origin/es/taskify-reexecution' into es/…
Elvis339 Oct 28, 2025
5236925
ci(c-chain-reexecution-benchmark)
Elvis339 Oct 29, 2025
7c754ed
Merge remote-tracking branch 'origin/es/taskify-reexecution' into es/…
Elvis339 Oct 29, 2025
3020b86
ci(c-chain-reexecution-benchmark): set `BENCHMARK_OUTPUT_FILE` to `ou…
Elvis339 Oct 29, 2025
33c73c3
chore: configure one known variable per run of c-chain-reexecution-* …
Elvis339 Oct 29, 2025
2b67612
address pr
Elvis339 Oct 30, 2025
0635d05
chore: handle copy_dir.sh s3 path
Elvis339 Oct 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 100 additions & 55 deletions .github/actions/c-chain-reexecution-benchmark/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,18 @@ name: 'C-Chain Re-Execution Benchmark'
description: 'Run C-Chain re-execution benchmark'

inputs:
task:
description: 'Task name to execute from Taskfile.yml'
required: true
runner_name:
description: 'The name of the runner to use and include in the Golang Benchmark name.'
required: true
config:
description: 'The config to pass to the VM for the benchmark. See BenchmarkReexecuteRange for details.'
default: ''
start-block:
description: 'The start block for the benchmark.'
default: '101'
end-block:
description: 'The end block for the benchmark.'
default: '250000'
block-dir-src:
description: 'The source block directory. Supports S3 directory/zip and local directories.'
default: 's3://avalanchego-bootstrap-testing/cchain-mainnet-blocks-1m-ldb/**'
current-state-dir-src:
description: 'The current state directory. Supports S3 directory/zip and local directories.'
default: 's3://avalanchego-bootstrap-testing/cchain-current-state-hashdb-full-100/**'
aws-role:
description: 'AWS role to assume for S3 access.'
required: true
aws-region:
description: 'AWS region to use for S3 access.'
required: true
default: 'us-east-2'
aws-role-duration-seconds:
description: 'The duration of the AWS role to assume for S3 access.'
required: true
Expand Down Expand Up @@ -56,64 +44,121 @@ inputs:
push-github-action-benchmark:
description: 'Whether to push the benchmark result to GitHub.'
required: true
default: false
push-post-state:
description: 'S3 destination to copy the current-state directory after completing re-execution. If empty, this will be skipped.'
default: ''
# The following inputs need never be provided by the caller. They
# default to context values that the action's steps are unable to
# access directly.
repository-owner:
default: ${{ github.repository_owner }}
repository-name:
default: ${{ github.event.repository.name }}
workflow:
default: ${{ github.workflow }}
run-id:
default: ${{ github.run_id }}
run-number:
default: ${{ github.run_number }}
run-attempt:
default: ${{ github.run_attempt }}
job:
default: ${{ github.job }}
grafana-dashboard-id:
default: 'Gl1I20mnk/c-chain'

runs:
using: composite
steps:
- name: Set task env
- uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f #v31
with:
github_access_token: ${{ inputs.github-token }}
- run: $GITHUB_ACTION_PATH/nix-develop.sh --command echo "dependencies installed"
shell: bash
# Cache Go modules (architecture-independent)
- uses: actions/cache@v4
id: go-mod-cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-mod-
# Cache Go build cache (architecture-specific)
- uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-${{ runner.arch }}-go-build-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-${{ runner.arch }}-go-build-
# Download modules only on cache miss
- run: $GITHUB_ACTION_PATH/nix-develop.sh --command go mod download
if: steps.go-mod-cache.outputs.cache-hit != 'true'
shell: bash
- run: |
if [[ -f tools/go.mod ]]; then
$GITHUB_ACTION_PATH/nix-develop.sh --command go mod download -modfile=tools/go.mod
fi
if: steps.go-mod-cache.outputs.cache-hit != 'true'
shell: bash
- name: Notify of metrics availability
if: inputs.prometheus-username != ''
shell: bash
run: |
{
echo "EXECUTION_DATA_DIR=${{ inputs.workspace }}/reexecution-data"
echo "BENCHMARK_OUTPUT_FILE=output.txt"
echo "START_BLOCK=${{ inputs.start-block }}"
echo "END_BLOCK=${{ inputs.end-block }}"
echo "BLOCK_DIR_SRC=${{ inputs.block-dir-src }}"
echo "CURRENT_STATE_DIR_SRC=${{ inputs.current-state-dir-src }}"
} >> $GITHUB_ENV
metrics_url=$($GITHUB_ACTION_PATH/output-metrics-url.sh)
echo "Grafana: ${metrics_url}"
echo "🔗 [View Grafana Dashboard](${metrics_url})" >> "$GITHUB_STEP_SUMMARY"
env:
GRAFANA_URL: https://grafana-poc.avax-dev.network/d/${{ inputs.grafana_dashboard_id }}?orgId=1&refresh=10s&var-filter=is_ephemeral_node%7C%3D%7Cfalse&var-filter=gh_repo%7C%3D%7C${{ inputs.repository_owner }}%2F${{ inputs.repository_name }}&var-filter=gh_run_id%7C%3D%7C${{ inputs.run_id }}&var-filter=gh_run_attempt%7C%3D%7C${{ inputs.run_attempt }}
GH_JOB_ID: ${{ inputs.job }}
- name: Warn that collection of metrics and logs will not be performed
if: inputs.prometheus-username == ''
shell: bash
run: echo "::warning::Monitoring credentials not found. Skipping collector start. Is the PR from a fork branch?"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ inputs.aws-role }}
aws-region: ${{ inputs.aws-region }}
role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
- name: Run C-Chain Re-Execution
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: |
./scripts/run_task.sh reexecute-cchain-range-with-copied-data \
CONFIG=${{ inputs.config }} \
EXECUTION_DATA_DIR=${{ env.EXECUTION_DATA_DIR }} \
BLOCK_DIR_SRC=${{ env.BLOCK_DIR_SRC }} \
CURRENT_STATE_DIR_SRC=${{ env.CURRENT_STATE_DIR_SRC }} \
START_BLOCK=${{ env.START_BLOCK }} \
END_BLOCK=${{ env.END_BLOCK }} \
LABELS=${{ env.LABELS }} \
BENCHMARK_OUTPUT_FILE=${{ env.BENCHMARK_OUTPUT_FILE }} \
RUNNER_NAME=${{ inputs.runner_name }} \
METRICS_SERVER_ENABLED=true \
METRICS_COLLECTOR_ENABLED=true
prometheus_url: ${{ inputs.prometheus-url }}
prometheus_push_url: ${{ inputs.prometheus-push-url }}
prometheus_username: ${{ inputs.prometheus-username }}
prometheus_password: ${{ inputs.prometheus-password }}
grafana_dashboard_id: 'Gl1I20mnk/c-chain'
runtime: "" # Set runtime input to empty string to disable log collection

- name: Set task env
shell: bash
run: |
TIMESTAMP=$(date '+%Y%m%d-%H%M%S')
EXEC_DIR="/tmp/reexecution-data-${TIMESTAMP}"
echo "EXECUTION_DATA_DIR=${EXEC_DIR}" >> "$GITHUB_ENV"
- name: Run C-Chain Re-execution Benchmark
shell: bash
run: |
$GITHUB_ACTION_PATH/nix-develop.sh --impure --command bash -x ./scripts/run_task.sh ${{ inputs.task }} \
BENCHMARK_OUTPUT_FILE="benchmark-output.txt" \
EXECUTION_DATA_DIR="${EXEC_DIR}"
env:
RUNNER_NAME: ${{ inputs.runner_name }}
TMPNET_START_METRICS_COLLECTOR: ${{ inputs.prometheus-username != '' }}
TMPNET_CHECK_METRICS_COLLECTED: ${{ inputs.prometheus-username != '' }}
METRICS_SERVER_ENABLED: ${{ inputs.prometheus-username != '' }}
METRICS_COLLECTOR_ENABLED: ${{ inputs.prometheus-username != '' }}
PROMETHEUS_URL: ${{ inputs.prometheus-url }}
PROMETHEUS_PUSH_URL: ${{ inputs.prometheus-push-url }}
PROMETHEUS_USERNAME: ${{ inputs.prometheus-username }}
PROMETHEUS_PASSWORD: ${{ inputs.prometheus-password }}
GH_REPO: ${{ inputs.repository_owner }}/${{ inputs.repository_name }}
GH_WORKFLOW: ${{ inputs.workflow }}
GH_RUN_ID: ${{ inputs.run_id }}
GH_RUN_NUMBER: ${{ inputs.run_number }}
GH_RUN_ATTEMPT: ${{ inputs.run_attempt }}
GH_JOB_ID: ${{ inputs.job }}
- name: Compare Benchmark Results
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'go'
output-file-path: ${{ env.BENCHMARK_OUTPUT_FILE }}
output-file-path: benchmark-output.txt
summary-always: true
github-token: ${{ inputs.github-token }}
auto-push: ${{ inputs.push-github-action-benchmark }}

- name: Push Post-State to S3 (if not exists)
if: ${{ inputs.push-post-state != '' }}
shell: nix develop --command bash -x {0}
run: ./scripts/run_task.sh export-dir-to-s3 SRC=${{ env.EXECUTION_DATA_DIR }}/current-state/ DST=${{ inputs.push-post-state }}
- name: Push Post-State to S3
if: inputs.push-post-state != ''
shell: bash
run: |
$GITHUB_ACTION_PATH/nix-develop.sh --command bash -x \
./scripts/run_task.sh export-dir-to-s3 \
SRC=${{ env.EXECUTION_DATA_DIR }}/current-state/ \
DST=${{ inputs.push-post-state }}
35 changes: 35 additions & 0 deletions .github/actions/c-chain-reexecution-benchmark/nix-develop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rational for this addition?


set -euo pipefail

if [[ -f "flake.nix" ]]; then
echo "Starting nix shell for local flake"
FLAKE=
else
echo "No local flake found, will attempt to use avalanchego flake"

# Get module details from go.mod
MODULE_DETAILS="$(go list -m "github.com/ava-labs/avalanchego" 2>/dev/null)"

# Extract the version part
AVALANCHE_VERSION="$(echo "${MODULE_DETAILS}" | awk '{print $2}')"

if [[ -z "${AVALANCHE_VERSION}" ]]; then
echo "Failed to get avalanchego version from go.mod"
exit 1
fi

# Check if the version matches the pattern where the last part is the module hash
# v*YYYYMMDDHHMMSS-abcdef123456
#
# If not, the value is assumed to represent a tag
if [[ "${AVALANCHE_VERSION}" =~ ^v.*[0-9]{14}-[0-9a-f]{12}$ ]]; then
# Use the module hash as the version
AVALANCHE_VERSION="$(echo "${AVALANCHE_VERSION}" | cut -d'-' -f3)"
fi

FLAKE="github:ava-labs/avalanchego?ref=${AVALANCHE_VERSION}"
echo "Starting nix shell for ${FLAKE}"
fi

nix develop "${FLAKE}" "${@}"
46 changes: 46 additions & 0 deletions .github/workflows/c-chain-reexecution-benchmark-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"pull_request": {
"include": [
{
"task": "c-chain-reexecution-hashdb-101-250k",
"runner": "ubuntu-latest",
"self_hosted": false,
"timeout-minutes": 30
},
{
"task": "c-chain-reexecution-hashdb-101-250k",
"runner": "avalanche-avalanchego-runner-2ti",
"self_hosted": true,
"timeout-minutes": 30
},
{
"task": "c-chain-reexecution-hashdb-archive-101-250k",
"runner": "blacksmith-4vcpu-ubuntu-2404",
"self_hosted": false,
"timeout-minutes": 30
},
{
"task": "c-chain-reexecution-hashdb-101-250k",
"runner": "blacksmith-4vcpu-ubuntu-2404",
"self_hosted": false,
"timeout-minutes": 30
}
]
},
"schedule": {
"include": [
{
"task": "c-chain-reexecution-hashdb-33m-33m500k",
"runner": "avago-runner-m6i-4xlarge-ebs-fast",
"self_hosted": true,
"timeout-minutes": 1440
},
{
"task": "c-chain-reexecution-hashdb-33m-33m500k",
"runner": "avago-runner-i4i-4xlarge-local-ssd",
"self_hosted": true,
"timeout-minutes": 1440
}
]
}
}
46 changes: 0 additions & 46 deletions .github/workflows/c-chain-reexecution-benchmark-container.json

This file was deleted.

Loading
Loading