Firewood Chaos Test #213
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Firewood Chaos Test | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| test: | |
| description: 'Test name to run (e.g., firewood-101-250k). Leave empty to use custom inputs below.' | |
| default: '' | |
| # Custom inputs (used when test is not provided) | |
| start-block: | |
| description: 'The start block for the benchmark.' | |
| default: '' | |
| end-block: | |
| description: 'The end block for the benchmark.' | |
| default: '' | |
| block-dir-src: | |
| description: 'The source block directory. Supports S3 directory/zip and local directories.' | |
| default: '' | |
| current-state-dir-src: | |
| description: 'The current state directory. Supports S3 directory/zip and local directories.' | |
| default: '' | |
| # Chaos test specific inputs | |
| config: | |
| description: 'VM config preset (firewood, firewood-archive). Required for custom tests.' | |
| default: 'firewood' | |
| min-wait-time: | |
| description: 'Minimum wait time before killing the process (e.g., 120s, 2m).' | |
| default: '120s' | |
| max-wait-time: | |
| description: 'Maximum wait time before killing the process (e.g., 150s, 3m).' | |
| default: '150s' | |
| runner: | |
| description: 'Runner to execute the chaos test. Input to the runs-on field of the job.' | |
| required: true | |
| timeout-minutes: | |
| description: 'Timeout in minutes for the job.' | |
| default: '60' | |
| schedule: | |
| - cron: '0 9 * * *' # Runs every day at 09:00 UTC (04:00 EST) | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| define-matrix: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| matrix: ${{ steps.define-matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Define Matrix | |
| id: define-matrix | |
| shell: bash -x {0} | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| { | |
| echo "matrix<<EOF" | |
| printf '{ "include": [{ "test": "%s", "start-block": "%s", "end-block": "%s", "block-dir-src": "%s", "current-state-dir-src": "%s", "config": "%s", "min-wait-time": "%s", "max-wait-time": "%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 }}" \ | |
| "${{ github.event.inputs.current-state-dir-src }}" \ | |
| "${{ github.event.inputs.config }}" \ | |
| "${{ github.event.inputs.min-wait-time }}" \ | |
| "${{ github.event.inputs.max-wait-time }}" \ | |
| "${{ github.event.inputs.runner }}" \ | |
| "${{ github.event.inputs.timeout-minutes }}" | |
| echo EOF | |
| } >> "$GITHUB_OUTPUT" | |
| else | |
| { | |
| echo "matrix<<EOF" | |
| echo '{ "include": [{ "test": "firewood-101-250k" }, { "test": "firewood-archive-101-250k" }] }' | |
| echo EOF | |
| } >> "$GITHUB_OUTPUT" | |
| fi | |
| firewood-chaos-test: | |
| needs: define-matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }} | |
| timeout-minutes: ${{ matrix.timeout-minutes || 60 }} | |
| runs-on: ${{ matrix.runner || 'ubuntu-24.04' }} | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/install-nix | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} | |
| aws-region: 'us-east-2' | |
| role-duration-seconds: '43200' | |
| - name: Run chaos test with Firewood | |
| shell: nix develop --impure --command bash -x {0} | |
| run: ./scripts/run_task.sh test-cchain-reexecution -- "${{ matrix.test || '' }}" | |
| env: | |
| CHAOS_MODE: '1' | |
| START_BLOCK: ${{ matrix.start-block }} | |
| END_BLOCK: ${{ matrix.end-block }} | |
| BLOCK_DIR_SRC: ${{ matrix.block-dir-src }} | |
| CURRENT_STATE_DIR_SRC: ${{ matrix.current-state-dir-src }} | |
| CONFIG: ${{ matrix.config }} | |
| MIN_WAIT_TIME: ${{ matrix.min-wait-time }} | |
| MAX_WAIT_TIME: ${{ matrix.max-wait-time }} |