From 0b6c4e1ddf92ae007903519ef3bd43780829a82e Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 Jan 2025 16:00:52 +0100 Subject: [PATCH 1/4] feat(ci): add hive for devnet-5 --- .github/actions/hive-deps/action.yaml | 20 +++ .github/workflows/hive-devnet-5.yaml | 177 ++++++++++++++++++++++++++ 2 files changed, 197 insertions(+) create mode 100644 .github/actions/hive-deps/action.yaml create mode 100644 .github/workflows/hive-devnet-5.yaml diff --git a/.github/actions/hive-deps/action.yaml b/.github/actions/hive-deps/action.yaml new file mode 100644 index 0000000..1922eda --- /dev/null +++ b/.github/actions/hive-deps/action.yaml @@ -0,0 +1,20 @@ +name: Install dependencies + +runs: + using: 'composite' + steps: + - name: Add gh-cli to apt + shell: bash + run: | + (type -p wget >/dev/null || (apt update && apt-get install wget -y)) \ + && mkdir -p -m 755 /etc/apt/keyrings \ + && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ + && cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ + && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null + - name: Install apt packages + shell: bash + run: | + apt update && apt install -y unzip gh + - name: Install yq + uses: dcarbone/install-yq-action@4075b4dca348d74bd83f2bf82d30f25d7c54539b # v1.3.1 diff --git a/.github/workflows/hive-devnet-5.yaml b/.github/workflows/hive-devnet-5.yaml new file mode 100644 index 0000000..7769fcb --- /dev/null +++ b/.github/workflows/hive-devnet-5.yaml @@ -0,0 +1,177 @@ +name: Hive - Devnet 5 +on: + push: + branches: + - skylenet/hive-action + workflow_dispatch: + # Note: We're limited to 10 inputs + inputs: + client: + type: string + default: go-ethereum, besu, reth, nethermind, erigon + description: Comma-separated list of clients to test .e.g go-ethereum, besu, reth, nethermind, erigon + simulator: + type: string + default: ethereum/rpc-compat, ethereum/eest/consume-engine, ethereum/eest/consume-rlp + description: Comma-separated list of simulators to test .e.g ethereum/rpc-compat, ethereum/eest/consume-engine, ethereum/eest/consume-rlp + geth_version: + type: string + default: s1na/go-ethereum@prague-devnet-5 + description: GitHub repository and tag for go-ethereum (repo@tag) + besu_version: + type: string + default: siladu/besu@pectra-devnet-5-interop + description: GitHub repository and tag for besu (repo@tag) + reth_version: + type: string + default: paradigmxyz/reth@main + description: GitHub repository and tag for reth (repo@tag) + nethermind_version: + type: string + default: NethermindEth/nethermind@pectra-devnet-5 + description: GitHub repository and tag for nethermind (repo@tag) + erigon_version: + type: string + default: erigontech/erigon@pectra5 + description: Docker image and tag for erigon (image@tag) + +env: + S3_BUCKET: hive-results + S3_PATH: pectra-devnet-5 + S3_PUBLIC_URL: https://hive.ethpandaops.io/pectra-devnet-5 + INSTALL_RCLONE_VERSION: v1.68.2 + GLOBAL_EXTRA_FLAGS: >- + --sim.buildarg fixtures=https://github.com/ethereum/execution-spec-tests/releases/download/pectra-devnet-5%40v1.1.0/fixtures_pectra-devnet-5.tar.gz + --sim.buildarg branch=pectra-devnet-5 + --client.checktimelimit=60s + --sim.parallelism=4 + +jobs: + prepare: + runs-on: ubuntu-latest + outputs: + # Versions of the clients + geth_repo: ${{ steps.parse.outputs.geth_repo }} + geth_tag: ${{ steps.parse.outputs.geth_tag }} + geth_docker_image_tag: ${{ steps.parse.outputs.geth_docker_image_tag }} + besu_repo: ${{ steps.parse.outputs.besu_repo }} + besu_tag: ${{ steps.parse.outputs.besu_tag }} + besu_docker_image_tag: ${{ steps.parse.outputs.besu_docker_image_tag }} + reth_repo: ${{ steps.parse.outputs.reth_repo }} + reth_tag: ${{ steps.parse.outputs.reth_tag }} + reth_docker_image_tag: ${{ steps.parse.outputs.reth_docker_image_tag }} + nethermind_repo: ${{ steps.parse.outputs.nethermind_repo }} + nethermind_tag: ${{ steps.parse.outputs.nethermind_tag }} + nethermind_docker_image_tag: ${{ steps.parse.outputs.nethermind_docker_image_tag }} + erigon_image: ${{ steps.parse.outputs.erigon_image }} + erigon_tag: ${{ steps.parse.outputs.erigon_tag }} + erigon_docker_image_tag: ${{ steps.parse.outputs.erigon_docker_image_tag }} + # client_config contains the YAML client config for Hive + client_config: ${{ steps.client_config.outputs.config }} + steps: + - id: parse + run: | + # Default client versions + GETH_DEFAULT="s1na/go-ethereum@prague-devnet-5" + BESU_DEFAULT="siladu/besu@pectra-devnet-5-interop" + RETH_DEFAULT="paradigmxyz/reth@main" + NETHERMIND_DEFAULT="NethermindEth/nethermind@pectra-devnet-5" + ERIGON_DEFAULT="erigontech/erigon@pectra5" + + # Parse geth + echo "geth_repo=$(echo ${GETH_VERSION:-$GETH_DEFAULT} | cut -d@ -f1)" >> $GITHUB_OUTPUT + echo "geth_tag=$(echo ${GETH_VERSION:-$GETH_DEFAULT} | cut -d@ -f2)" >> $GITHUB_OUTPUT + echo "geth_docker_image_tag=geth_$(echo ${GETH_VERSION:-$GETH_DEFAULT} | sed 's/[@\/]/_/g' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + + # Parse besu + echo "besu_repo=$(echo ${BESU_VERSION:-$BESU_DEFAULT} | cut -d@ -f1)" >> $GITHUB_OUTPUT + echo "besu_tag=$(echo ${BESU_VERSION:-$BESU_DEFAULT} | cut -d@ -f2)" >> $GITHUB_OUTPUT + echo "besu_docker_image_tag=besu_$(echo ${BESU_VERSION:-$BESU_DEFAULT} | sed 's/[@\/]/_/g' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + + # Parse reth + echo "reth_repo=$(echo ${RETH_VERSION:-$RETH_DEFAULT} | cut -d@ -f1)" >> $GITHUB_OUTPUT + echo "reth_tag=$(echo ${RETH_VERSION:-$RETH_DEFAULT} | cut -d@ -f2)" >> $GITHUB_OUTPUT + echo "reth_docker_image_tag=reth_$(echo ${RETH_VERSION:-$RETH_DEFAULT} | sed 's/[@\/]/_/g' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + + # Parse nethermind + echo "nethermind_repo=$(echo ${NETHERMIND_VERSION:-$NETHERMIND_DEFAULT} | cut -d@ -f1)" >> $GITHUB_OUTPUT + echo "nethermind_tag=$(echo ${NETHERMIND_VERSION:-$NETHERMIND_DEFAULT} | cut -d@ -f2)" >> $GITHUB_OUTPUT + echo "nethermind_docker_image_tag=nethermind_$(echo ${NETHERMIND_VERSION:-$NETHERMIND_DEFAULT} | sed 's/[@\/]/_/g' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + + # Parse erigon + echo "erigon_image=$(echo ${ERIGON_VERSION:-$ERIGON_DEFAULT} | cut -d@ -f1)" >> $GITHUB_OUTPUT + echo "erigon_tag=$(echo ${ERIGON_VERSION:-$ERIGON_DEFAULT} | cut -d@ -f2)" >> $GITHUB_OUTPUT + echo "erigon_docker_image_tag=erigon_$(echo ${ERIGON_VERSION:-$ERIGON_DEFAULT} | sed 's/[@\/]/_/g' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + env: + GETH_VERSION: ${{ inputs.geth_version }} + BESU_VERSION: ${{ inputs.besu_version }} + RETH_VERSION: ${{ inputs.reth_version }} + NETHERMIND_VERSION: ${{ inputs.nethermind_version }} + ERIGON_VERSION: ${{ inputs.erigon_version }} + - id: client_config + run: | + cat << 'EOF' >> $GITHUB_OUTPUT + config<- + ${{ github.head_ref || inputs }}-${{ matrix.client }}-${{ matrix.simulator }} + cancel-in-progress: true + strategy: + fail-fast: false + matrix: + #client: ${{ fromJSON(format('[{0}]', inputs.client || '"go-ethereum","besu","reth","nethermind","erigon"')) }} + #simulator: ${{ fromJSON(format('[{0}]', inputs.simulator || '"ethereum/rpc-compat","ethereum/eest/consume-engine","ethereum/eest/consume-rlp"')) }} + client: ${{ fromJSON(format('[{0}]', inputs.client || '"go-ethereum"')) }} + simulator: ${{ fromJSON(format('[{0}]', inputs.simulator || '"ethereum/rpc-compat"')) }} + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/hive-deps + - uses: ethpandaops/hive-github-action@master + with: + client: ${{ matrix.client }} + simulator: ${{ matrix.simulator }} + client_config: ${{ needs.prepare.outputs.client_config }} + extra_flags: ${{ env.GLOBAL_EXTRA_FLAGS }} + s3_upload: true + s3_bucket: ${{ env.S3_BUCKET }} + s3_path: ${{ env.S3_PATH }} + s3_public_url: ${{ env.S3_PUBLIC_URL }} + rclone_config: ${{ secrets.HIVE_RCLONE_CONFIG }} + rclone_version: ${{ env.INSTALL_RCLONE_VERSION }} + workflow_artifact_upload: true From 3cd8ff061aedeaa89e4ebc7d0b98076f146c1662 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 Jan 2025 16:02:17 +0100 Subject: [PATCH 2/4] fixup perms --- .github/actions/hive-deps/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/hive-deps/action.yaml b/.github/actions/hive-deps/action.yaml index 1922eda..56fe6de 100644 --- a/.github/actions/hive-deps/action.yaml +++ b/.github/actions/hive-deps/action.yaml @@ -15,6 +15,6 @@ runs: - name: Install apt packages shell: bash run: | - apt update && apt install -y unzip gh + sudo apt update && sudo apt install -y unzip gh - name: Install yq uses: dcarbone/install-yq-action@4075b4dca348d74bd83f2bf82d30f25d7c54539b # v1.3.1 From d5e6ae171995b167863ea6f6057ee6f5c5674156 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 Jan 2025 16:09:51 +0100 Subject: [PATCH 3/4] only install deps if not on github runner --- .github/actions/hive-deps/action.yaml | 2 +- .github/workflows/hive-devnet-5.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/hive-deps/action.yaml b/.github/actions/hive-deps/action.yaml index 56fe6de..1922eda 100644 --- a/.github/actions/hive-deps/action.yaml +++ b/.github/actions/hive-deps/action.yaml @@ -15,6 +15,6 @@ runs: - name: Install apt packages shell: bash run: | - sudo apt update && sudo apt install -y unzip gh + apt update && apt install -y unzip gh - name: Install yq uses: dcarbone/install-yq-action@4075b4dca348d74bd83f2bf82d30f25d7c54539b # v1.3.1 diff --git a/.github/workflows/hive-devnet-5.yaml b/.github/workflows/hive-devnet-5.yaml index 7769fcb..21bd2e2 100644 --- a/.github/workflows/hive-devnet-5.yaml +++ b/.github/workflows/hive-devnet-5.yaml @@ -162,6 +162,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/hive-deps + if: runner.environment != 'github-hosted' - uses: ethpandaops/hive-github-action@master with: client: ${{ matrix.client }} From 2c1082a764626e51ffd4d6858df9673bd6bd921e Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 Jan 2025 16:17:03 +0100 Subject: [PATCH 4/4] make runners dependant on simulator --- .github/workflows/hive-devnet-5.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/hive-devnet-5.yaml b/.github/workflows/hive-devnet-5.yaml index 21bd2e2..3f7fa8c 100644 --- a/.github/workflows/hive-devnet-5.yaml +++ b/.github/workflows/hive-devnet-5.yaml @@ -146,12 +146,15 @@ jobs: test: needs: prepare - #runs-on: self-hosted-ghr-size-m-x64 - runs-on: ubuntu-latest + runs-on: >- + ${{ + matrix.simulator == 'ethereum/rpc-compat' && 'ubuntu-latest' || + contains(matrix.simulator, 'ethereum/eest/') && 'self-hosted-ghr-size-m-x64' || + 'ubuntu-latest' + }} concurrency: group: >- ${{ github.head_ref || inputs }}-${{ matrix.client }}-${{ matrix.simulator }} - cancel-in-progress: true strategy: fail-fast: false matrix: