From 940e85fa607f57b261bee3ce99eb80471c8e1c8e Mon Sep 17 00:00:00 2001 From: danceratopz Date: Mon, 8 Dec 2025 13:54:51 +0100 Subject: [PATCH 1/3] fix(ci): add and use robust hive dev startup gh action --- .../build-benchmark-genesis/action.yaml | 41 +++--------- .github/actions/start-hive-dev/action.yaml | 63 +++++++++++++++++++ .github/workflows/hive-consume.yaml | 39 +++++------- 3 files changed, 88 insertions(+), 55 deletions(-) create mode 100644 .github/actions/start-hive-dev/action.yaml diff --git a/.github/actions/build-benchmark-genesis/action.yaml b/.github/actions/build-benchmark-genesis/action.yaml index e2ea4cbe77..718bc82e03 100644 --- a/.github/actions/build-benchmark-genesis/action.yaml +++ b/.github/actions/build-benchmark-genesis/action.yaml @@ -39,43 +39,18 @@ runs: - name: Start Hive in dev mode id: start-hive + uses: ./.github/actions/start-hive-dev + with: + clients: besu,go-ethereum,nethermind + client-file: .github/configs/hive/latest.yaml + hive-path: hive + + - name: Extract genesis configs shell: bash env: - HIVE_SIMULATOR: http://127.0.0.1:3000 + HIVE_SIMULATOR: ${{ steps.start-hive.outputs.hive-url }} run: | - cd hive - ./hive --dev \ - --client besu,go-ethereum,nethermind \ - --client-file ../.github/configs/hive/latest.yaml \ - --docker.output & - export HIVE_PID=$! - - echo "Waiting for Hive to be ready, pid=$HIVE_PID" - deadline=$((SECONDS + 600)) - - while :; do - # condition 1: time is up - if (( SECONDS >= deadline )); then - echo "Hive failed to start within timeout" - exit 1 - fi - - # condition 2: process exited - if ! kill -0 "$HIVE_PID" 2>/dev/null; then - echo "Hive process died" - exit 1 - fi - - # condition 3: curl succeeded - if curl -s $HIVE_SIMULATOR > /dev/null; then - echo "Hive is ready!" - break - fi - sleep 1 - done - echo "Running extract_config for benchmark fixtures..." - cd .. uv run extract_config \ --fixture fixtures/blockchain_tests_engine_x/pre_alloc/ \ --output genesis/ \ diff --git a/.github/actions/start-hive-dev/action.yaml b/.github/actions/start-hive-dev/action.yaml new file mode 100644 index 0000000000..aba7b69280 --- /dev/null +++ b/.github/actions/start-hive-dev/action.yaml @@ -0,0 +1,63 @@ +name: Start Hive in Dev Mode +description: Start Hive simulator API in dev mode with robust waiting + +inputs: + clients: + description: "Comma-separated list of clients to use" + required: true + client-file: + description: "Path to YAML file with client configurations" + required: true + timeout: + description: "Timeout in seconds waiting for Hive to be ready" + required: false + default: "600" + hive-path: + description: "Path to hive directory (must be checked out and built)" + required: false + default: "hive" + +outputs: + hive-url: + description: "URL of the Hive simulator API" + value: ${{ steps.start.outputs.hive-url }} + +runs: + using: "composite" + steps: + - name: Start Hive dev mode + id: start + shell: bash + run: | + cd "${{ inputs.hive-path }}" + + ./hive --dev \ + --client "${{ inputs.clients }}" \ + --client-file "../${{ inputs.client-file }}" \ + --docker.output & + HIVE_PID=$! + + HIVE_URL="http://127.0.0.1:3000" + echo "hive-url=$HIVE_URL" >> "$GITHUB_OUTPUT" + + echo "Waiting for Hive to be ready (pid=$HIVE_PID, timeout=${{ inputs.timeout }}s)..." + deadline=$((SECONDS + ${{ inputs.timeout }})) + + while :; do + if (( SECONDS >= deadline )); then + echo "::error::Hive failed to start within ${{ inputs.timeout }}s timeout" + exit 1 + fi + + if ! kill -0 "$HIVE_PID" 2>/dev/null; then + echo "::error::Hive process died unexpectedly" + exit 1 + fi + + if curl -s "$HIVE_URL" > /dev/null; then + echo "Hive is ready at $HIVE_URL" + exit 0 + fi + + sleep 1 + done diff --git a/.github/workflows/hive-consume.yaml b/.github/workflows/hive-consume.yaml index 5075cfd0d9..e3ca7a5937 100644 --- a/.github/workflows/hive-consume.yaml +++ b/.github/workflows/hive-consume.yaml @@ -3,16 +3,16 @@ name: Hive Consume Tests on: push: branches: - - 'forks/**' + - "forks/**" pull_request: paths: - - '.github/workflows/hive-consume.yaml' - - 'packages/testing/src/execution_testing/cli/pytest_commands/consume.py' - - 'packages/testing/src/execution_testing/cli/pytest_commands/pytest_ini_files/pytest-consume.ini' - - 'packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/**' - - 'packages/testing/src/execution_testing/cli/pytest_commands/plugins/pytest_hive/**' - - 'packages/testing/src/execution_testing/fixtures/consume.py' - - 'packages/testing/src/execution_testing/rpc/**' + - ".github/workflows/hive-consume.yaml" + - "packages/testing/src/execution_testing/cli/pytest_commands/consume.py" + - "packages/testing/src/execution_testing/cli/pytest_commands/pytest_ini_files/pytest-consume.ini" + - "packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/**" + - "packages/testing/src/execution_testing/cli/pytest_commands/plugins/pytest_hive/**" + - "packages/testing/src/execution_testing/fixtures/consume.py" + - "packages/testing/src/execution_testing/rpc/**" workflow_dispatch: concurrency: @@ -59,7 +59,7 @@ jobs: - name: Setup go env and cache uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: - go-version: '>=1.24' + go-version: ">=1.24" cache-dependency-path: hive/go.sum - name: Install uv and python @@ -90,24 +90,19 @@ jobs: - name: Start Hive in dev mode if: matrix.mode == 'dev' - run: | - cd hive - ./hive --dev --client go-ethereum --client-file ../execution-specs/.github/configs/hive/master.yaml --docker.output & - echo "Waiting for Hive to be ready..." - for i in {1..30}; do - if curl -s http://127.0.0.1:3000 > /dev/null 2>&1; then - echo "Hive is ready!" - break - fi - echo "Waiting... ($i/30)" - sleep 2 - done + id: start-hive + uses: ./execution-specs/.github/actions/start-hive-dev + with: + clients: go-ethereum + client-file: execution-specs/.github/configs/hive/master.yaml + hive-path: hive + timeout: "120" - name: Run consume in dev mode if: matrix.mode == 'dev' working-directory: execution-specs env: - HIVE_SIMULATOR: http://127.0.0.1:3000 + HIVE_SIMULATOR: ${{ steps.start-hive.outputs.hive-url }} run: | uv sync --all-extras uv run consume ${{ matrix.consume_command }} --input ${{ env.FIXTURES_URL }} -k "Osaka and test_block_at_rlp_limit_with_logs" From 47f5b033b496137d6c3e04471507a5192d0e0af1 Mon Sep 17 00:00:00 2001 From: danceratopz Date: Mon, 8 Dec 2025 14:03:14 +0100 Subject: [PATCH 2/3] chore(ci): use latest release instead of master images for consume --- .github/workflows/hive-consume.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hive-consume.yaml b/.github/workflows/hive-consume.yaml index e3ca7a5937..66a5307c6f 100644 --- a/.github/workflows/hive-consume.yaml +++ b/.github/workflows/hive-consume.yaml @@ -83,7 +83,7 @@ jobs: ./hive --sim '${{ matrix.simulator }}' \ --sim.parallelism=1 \ --client go-ethereum \ - --client-file ../execution-specs/.github/configs/hive/master.yaml \ + --client-file ../execution-specs/.github/configs/hive/latest.yaml \ --sim.buildarg fixtures=${{ env.FIXTURES_URL }} \ --sim.limit=".*test_block_at_rlp_limit_with_logs.*Osaka.*" \ --docker.output @@ -94,7 +94,7 @@ jobs: uses: ./execution-specs/.github/actions/start-hive-dev with: clients: go-ethereum - client-file: execution-specs/.github/configs/hive/master.yaml + client-file: execution-specs/.github/configs/hive/latest.yaml hive-path: hive timeout: "120" From ca7cc474da9c9a43ad281f6f0d24c3225ae8a03c Mon Sep 17 00:00:00 2001 From: spencer-tb Date: Sat, 6 Dec 2025 17:20:24 +0000 Subject: [PATCH 3/3] chore(ci): bump hive consume runner to self hosted --- .github/workflows/hive-consume.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hive-consume.yaml b/.github/workflows/hive-consume.yaml index 66a5307c6f..cb040765f9 100644 --- a/.github/workflows/hive-consume.yaml +++ b/.github/workflows/hive-consume.yaml @@ -26,7 +26,7 @@ env: jobs: test-hive: name: ${{ matrix.name }} - runs-on: ubuntu-latest + runs-on: [self-hosted-ghr, size-l-x64] strategy: fail-fast: true matrix: