-
Notifications
You must be signed in to change notification settings - Fork 845
[ci] Migrate reexec tasks to a script to simplify maintenance #4761
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
Changes from all commits
d9d8f95
dcd27d4
beac43f
2554640
2623a77
c06b861
b4666d2
bb1e04b
0d573ef
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 |
|---|---|---|
|
|
@@ -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 | ||
|
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. 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: | | ||
|
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. 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: | | ||
|
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. 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 }} | ||
|
|
@@ -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 | ||
maru-ava marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 }} | ||
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.
I noticed this was unused.