diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index 85546ceba8a6..a42e163921ad 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -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: '' @@ -50,10 +50,6 @@ inputs: description: 'The password for the Prometheus instance.' required: true default: '' - workspace: - 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 @@ -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 - 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: | - 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: | - 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 }} @@ -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 }} diff --git a/.github/workflows/c-chain-reexecution-benchmark-container.json b/.github/workflows/c-chain-reexecution-benchmark-container.json index dfb8ce6df230..79e3be9a82dd 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-container.json +++ b/.github/workflows/c-chain-reexecution-benchmark-container.json @@ -3,7 +3,7 @@ "include": [ { "runner": "ubuntu-latest", - "task": "c-chain-reexecution-hashdb-101-250k", + "test": "hashdb-101-250k", "timeout-minutes": 30 }, { @@ -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 } ] diff --git a/.github/workflows/c-chain-reexecution-benchmark-container.yml b/.github/workflows/c-chain-reexecution-benchmark-container.yml index 8c14edfecf30..483029c1f21f 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-container.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-container.yml @@ -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.' @@ -51,8 +51,8 @@ jobs: if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then { echo "matrix<&2 + fi + exit 1 +} + +show_usage() { + cat <