Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
69 changes: 17 additions & 52 deletions .github/actions/c-chain-reexecution-benchmark/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: 'C-Chain Re-Execution Benchmark'
description: 'Run C-Chain re-execution benchmark'

inputs:
task:
description: 'Task name to execute from Taskfile.yml. Leave empty to use custom inputs below.'
test:
description: 'Test name to run (e.g., hashdb-101-250k). Leave empty to use custom inputs below.'
default: ''
# Custom inputs (alternative to task-based approach)
# Custom inputs (used when test is not provided)
config:
description: 'The config to pass to the VM for the benchmark. See BenchmarkReexecuteRange for details.'
default: ''
Expand Down Expand Up @@ -50,10 +50,6 @@ inputs:
description: 'The password for the Prometheus instance.'
required: true
default: ''
workspace:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed this was unused.

description: 'Working directory to use for the benchmark.'
required: true
default: ${{ github.workspace }}
github-token:
description: 'GitHub token provided to GitHub Action Benchmark.'
required: true
Expand Down Expand Up @@ -126,54 +122,30 @@ runs:
role-to-assume: ${{ inputs.aws-role }}
aws-region: ${{ inputs.aws-region }}
role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
- name: Validate inputs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Validation moved to the script so its defined once for use locally and in CI and it can be subject to shellcheck linting.

shell: bash
run: |
if [[ -z "${{ inputs.task }}" ]]; then
# Granular mode - validate required inputs
missing=()
[[ -z "${{ inputs.block-dir-src }}" ]] && missing+=("block-dir-src")
[[ -z "${{ inputs.current-state-dir-src }}" ]] && missing+=("current-state-dir-src")
[[ -z "${{ inputs.start-block }}" ]] && missing+=("start-block")
[[ -z "${{ inputs.end-block }}" ]] && missing+=("end-block")

if [[ ${#missing[@]} -gt 0 ]]; then
echo "::error::When 'task' is empty, the following inputs are required: ${missing[*]}"
exit 1
fi
fi
- name: Set task env
- name: Set benchmark output file
shell: bash
run: |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

EXECUTION_DATA_DIR is now set in the script

TIMESTAMP=$(date '+%Y%m%d-%H%M%S')
echo "EXECUTION_DATA_DIR=/tmp/reexecution-data-${TIMESTAMP}" >> "$GITHUB_ENV"
echo "BENCHMARK_OUTPUT_FILE=${GITHUB_WORKSPACE}/benchmark-output.json" >> "$GITHUB_ENV"
run: echo "BENCHMARK_OUTPUT_FILE=${GITHUB_WORKSPACE}/benchmark-output.json" >> "$GITHUB_ENV"
- name: Run C-Chain Re-execution Benchmark
shell: nix develop --impure --command bash -x {0}
run: |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this configuration to the script

if [[ -n "${{ inputs.task }}" ]]; then
# Task-based approach
./scripts/run_task.sh ${{ inputs.task }} \
BENCHMARK_OUTPUT_FILE="${{ env.BENCHMARK_OUTPUT_FILE }}" \
EXECUTION_DATA_DIR="${{ env.EXECUTION_DATA_DIR }}"
else
# Granular approach
./scripts/run_task.sh reexecute-cchain-range-with-copied-data \
CONFIG=${{ inputs.config }} \
EXECUTION_DATA_DIR=${{ env.EXECUTION_DATA_DIR }} \
BLOCK_DIR_SRC=${{ inputs.block-dir-src }} \
CURRENT_STATE_DIR_SRC=${{ inputs.current-state-dir-src }} \
START_BLOCK=${{ inputs.start-block }} \
END_BLOCK=${{ inputs.end-block }} \
BENCHMARK_OUTPUT_FILE="${{ env.BENCHMARK_OUTPUT_FILE }}"
fi
run: ./scripts/run_task.sh test-cchain-reexecution -- "${{ inputs.test || '' }}"
env:
# Test configuration overrides
BLOCK_DIR_SRC: ${{ inputs.block-dir-src }}
CURRENT_STATE_DIR_SRC: ${{ inputs.current-state-dir-src }}
START_BLOCK: ${{ inputs.start-block }}
END_BLOCK: ${{ inputs.end-block }}
CONFIG: ${{ inputs.config }}
# Execution environment
BENCHMARK_OUTPUT_FILE: ${{ env.BENCHMARK_OUTPUT_FILE }}
PUSH_POST_STATE: ${{ inputs.push-post-state }}
# Runner and metrics
RUNNER_TYPE: ${{ inputs.runner_type }}
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 }}
# Github metadata
GH_REPO: ${{ inputs.repository-owner }}/${{ inputs.repository-name }}
GH_WORKFLOW: ${{ inputs.workflow }}
GH_RUN_ID: ${{ inputs.run-id }}
Expand All @@ -188,10 +160,3 @@ runs:
summary-always: true
github-token: ${{ inputs.github-token }}
auto-push: ${{ inputs.push-github-action-benchmark }}
- name: Push Post-State to S3
if: inputs.push-post-state != ''
shell: nix develop --impure --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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"include": [
{
"runner": "ubuntu-latest",
"task": "c-chain-reexecution-hashdb-101-250k",
"test": "hashdb-101-250k",
"timeout-minutes": 30
},
{
Expand All @@ -21,12 +21,12 @@
"include": [
{
"runner": "avago-runner-m6i-4xlarge-ebs-fast",
"task": "c-chain-reexecution-hashdb-33m-33m500k",
"test": "hashdb-33m-33m500k",
"timeout-minutes": 1440
},
{
"runner": "avago-runner-i4i-4xlarge-local-ssd",
"task": "c-chain-reexecution-hashdb-33m-33m500k",
"test": "hashdb-33m-33m500k",
"timeout-minutes": 1440
}
]
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/c-chain-reexecution-benchmark-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
pull_request:
workflow_dispatch:
inputs:
task:
description: 'Taskfile task to execute (e.g., c-chain-reexecution-hashdb-101-250k)'
test:
description: 'Test name (e.g., hashdb-101-250k, firewood-33m-33m500k). Leave empty for custom.'
default: ''
config:
description: 'The config to pass to the VM for the benchmark. See BenchmarkReexecuteRange for details.'
Expand Down Expand Up @@ -51,8 +51,8 @@ jobs:
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
{
echo "matrix<<EOF"
printf '{ "include": [{ "task": "%s", "start-block": "%s", "end-block": "%s", "block-dir-src": "%s", "current-state-dir-src": "%s", "config": "%s", "runner": "%s", "timeout-minutes": %s }] }\n' \
"${{ github.event.inputs.task }}" \
printf '{ "include": [{ "test": "%s", "start-block": "%s", "end-block": "%s", "block-dir-src": "%s", "current-state-dir-src": "%s", "config": "%s", "runner": "%s", "timeout-minutes": %s }] }\n' \
"${{ github.event.inputs.test }}" \
"${{ github.event.inputs.start-block }}" \
"${{ github.event.inputs.end-block }}" \
"${{ github.event.inputs.block-dir-src }}" \
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Run C-Chain Re-Execution Benchmark
uses: ./.github/actions/c-chain-reexecution-benchmark
with:
task: ${{ matrix.task }}
test: ${{ matrix.test }}
config: ${{ matrix.config }}
start-block: ${{ matrix.start-block }}
end-block: ${{ matrix.end-block }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"include": [
{
"runner": "ubuntu-latest",
"task": "c-chain-reexecution-hashdb-101-250k",
"test": "hashdb-101-250k",
"timeout-minutes": 30
},
{
"runner": "blacksmith-4vcpu-ubuntu-2404",
"task": "c-chain-reexecution-hashdb-101-250k",
"test": "hashdb-101-250k",
"timeout-minutes": 30
},
{
"runner": "blacksmith-4vcpu-ubuntu-2404",
"task": "c-chain-reexecution-hashdb-archive-101-250k",
"test": "hashdb-archive-101-250k",
"timeout-minutes": 30
}
]
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/c-chain-reexecution-benchmark-gh-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
pull_request:
workflow_dispatch:
inputs:
task:
description: 'Taskfile task to execute (e.g., c-chain-reexecution-hashdb-101-250k)'
test:
description: 'Test name (e.g., hashdb-101-250k, firewood-33m-33m500k). Leave empty for custom.'
default: ''
config:
description: 'The config to pass to the VM for the benchmark. See BenchmarkReexecuteRange for details.'
Expand Down Expand Up @@ -51,8 +51,8 @@ jobs:
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
{
echo "matrix<<EOF"
printf '{ "include": [{ "task": "%s", "start-block": "%s", "end-block": "%s", "block-dir-src": "%s", "current-state-dir-src": "%s", "config": "%s", "runner": "%s", "timeout-minutes": %s }] }\n' \
"${{ github.event.inputs.task }}" \
printf '{ "include": [{ "test": "%s", "start-block": "%s", "end-block": "%s", "block-dir-src": "%s", "current-state-dir-src": "%s", "config": "%s", "runner": "%s", "timeout-minutes": %s }] }\n' \
"${{ github.event.inputs.test }}" \
"${{ github.event.inputs.start-block }}" \
"${{ github.event.inputs.end-block }}" \
"${{ github.event.inputs.block-dir-src }}" \
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Run C-Chain Re-Execution Benchmark
uses: ./.github/actions/c-chain-reexecution-benchmark
with:
task: ${{ matrix.task }}
test: ${{ matrix.test }}
config: ${{ matrix.config }}
start-block: ${{ matrix.start-block }}
end-block: ${{ matrix.end-block }}
Expand Down
Loading