diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml new file mode 100644 index 0000000000..6b7f270226 --- /dev/null +++ b/.github/workflows/docker-test.yml @@ -0,0 +1,53 @@ +name: Build test Docker image + +on: + workflow_call: + inputs: + hive_target: + required: true + type: string + description: "Docker bake target to build (e.g. hive-stable, hive-edge)" + artifact_name: + required: false + type: string + default: "artifacts" + description: "Name for the uploaded artifact" + +jobs: + build: + if: github.repository == 'paradigmxyz/reth' + timeout-minutes: 45 + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v6 + - run: mkdir -p artifacts + + - name: Get git info + id: git + run: | + echo "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT" + echo "describe=$(git describe --always --tags)" >> "$GITHUB_OUTPUT" + + - name: Set up Depot CLI + uses: depot/setup-action@v1 + + - name: Build reth image + uses: depot/bake-action@v1 + env: + DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }} + VERGEN_GIT_SHA: ${{ steps.git.outputs.sha }} + VERGEN_GIT_DESCRIBE: ${{ steps.git.outputs.describe }} + with: + project: ${{ vars.DEPOT_PROJECT_ID }} + files: docker-bake.hcl + targets: ${{ inputs.hive_target }} + push: false + + - name: Upload reth image + uses: actions/upload-artifact@v6 + with: + name: ${{ inputs.artifact_name }} + path: ./artifacts diff --git a/.github/workflows/hive.yml b/.github/workflows/hive.yml index 660280d73a..7d2d956ff0 100644 --- a/.github/workflows/hive.yml +++ b/.github/workflows/hive.yml @@ -5,7 +5,7 @@ name: hive on: workflow_dispatch: schedule: - - cron: "0 */6 * * *" + - cron: "0 0 * * *" env: CARGO_TERM_COLOR: always @@ -15,27 +15,24 @@ concurrency: cancel-in-progress: true jobs: - prepare-reth-stable: - uses: ./.github/workflows/prepare-reth.yml + build-reth-stable: + uses: ./.github/workflows/docker-test.yml with: - image_tag: ghcr.io/paradigmxyz/reth:latest - binary_name: reth - cargo_features: "asm-keccak" + hive_target: hive-stable artifact_name: "reth-stable" + secrets: inherit - prepare-reth-edge: - uses: ./.github/workflows/prepare-reth.yml + build-reth-edge: + uses: ./.github/workflows/docker-test.yml with: - image_tag: ghcr.io/paradigmxyz/reth:latest - binary_name: reth - cargo_features: "asm-keccak edge" + hive_target: hive-edge artifact_name: "reth-edge" + secrets: inherit prepare-hive: if: github.repository == 'paradigmxyz/reth' timeout-minutes: 45 - runs-on: - group: Reth + runs-on: depot-ubuntu-latest-4 steps: - uses: actions/checkout@v6 - name: Checkout hive tests @@ -187,12 +184,11 @@ jobs: - sim: ethereum/eels/consume-rlp limit: .*tests/paris.* needs: - - prepare-reth-stable - - prepare-reth-edge + - build-reth-stable + - build-reth-edge - prepare-hive name: ${{ matrix.storage }} / ${{ matrix.scenario.sim }}${{ matrix.scenario.limit && format(' - {0}', matrix.scenario.limit) }} - runs-on: - group: Reth + runs-on: depot-ubuntu-latest-4 permissions: issues: write steps: diff --git a/.github/workflows/kurtosis.yml b/.github/workflows/kurtosis.yml index c846e1b585..88c20dbc92 100644 --- a/.github/workflows/kurtosis.yml +++ b/.github/workflows/kurtosis.yml @@ -5,7 +5,7 @@ name: kurtosis on: workflow_dispatch: schedule: - - cron: "0 */6 * * *" + - cron: "0 0 * * *" push: tags: @@ -19,11 +19,11 @@ concurrency: cancel-in-progress: true jobs: - prepare-reth: - uses: ./.github/workflows/prepare-reth.yml + build-reth: + uses: ./.github/workflows/docker-test.yml with: - image_tag: ghcr.io/paradigmxyz/reth:kurtosis-ci - binary_name: reth + hive_target: kurtosis + secrets: inherit test: timeout-minutes: 60 @@ -32,7 +32,7 @@ jobs: name: run kurtosis runs-on: depot-ubuntu-latest needs: - - prepare-reth + - build-reth steps: - uses: actions/checkout@v6 with: diff --git a/.github/workflows/prepare-reth.yml b/.github/workflows/prepare-reth.yml deleted file mode 100644 index 5275f9ddb0..0000000000 --- a/.github/workflows/prepare-reth.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Prepare Reth Image - -on: - workflow_call: - inputs: - image_tag: - required: true - type: string - description: "Docker image tag to use" - binary_name: - required: false - type: string - default: "reth" - description: "Binary name to build" - cargo_features: - required: false - type: string - default: "asm-keccak" - description: "Cargo features to enable" - cargo_package: - required: false - type: string - description: "Optional cargo package path" - artifact_name: - required: false - type: string - default: "artifacts" - description: "Name for the uploaded artifact" - -jobs: - prepare-reth: - if: github.repository == 'paradigmxyz/reth' - timeout-minutes: 45 - runs-on: depot-ubuntu-latest - steps: - - uses: actions/checkout@v6 - - run: mkdir artifacts - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and export reth image - uses: docker/build-push-action@v6 - with: - context: . - file: .github/scripts/hive/Dockerfile - tags: ${{ inputs.image_tag }} - outputs: type=docker,dest=./artifacts/reth_image.tar - build-args: | - CARGO_BIN=${{ inputs.binary_name }} - MANIFEST_PATH=${{ inputs.cargo_package }} - FEATURES=${{ inputs.cargo_features }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Upload reth image - id: upload - uses: actions/upload-artifact@v6 - with: - name: ${{ inputs.artifact_name }} - path: ./artifacts diff --git a/docker-bake.hcl b/docker-bake.hcl index c213ae9c4b..77349d0b2b 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -93,3 +93,50 @@ target "ethereum-edge-profiling" { tags = ["${REGISTRY}/reth:nightly-edge-profiling"] } +// Hive test targets — single-platform, hivetests profile, tar output +target "_base_hive" { + inherits = ["_base"] + platforms = ["linux/amd64"] + args = { + BUILD_PROFILE = "hivetests" + } +} + +variable "HIVE_OUTPUT_DIR" { + default = "./artifacts" +} + +target "hive-stable" { + inherits = ["_base_hive"] + args = { + BINARY = "reth" + MANIFEST_PATH = "bin/reth" + FEATURES = "asm-keccak" + } + tags = ["reth:local"] + output = ["type=docker,dest=${HIVE_OUTPUT_DIR}/reth_image.tar"] +} + +target "hive-edge" { + inherits = ["_base_hive"] + args = { + BINARY = "reth" + MANIFEST_PATH = "bin/reth" + FEATURES = "asm-keccak edge" + } + tags = ["reth:local"] + output = ["type=docker,dest=${HIVE_OUTPUT_DIR}/reth_image.tar"] +} + +// Kurtosis test target +target "kurtosis" { + inherits = ["_base_hive"] + args = { + BINARY = "reth" + MANIFEST_PATH = "bin/reth" + FEATURES = "asm-keccak" + } + tags = ["ghcr.io/paradigmxyz/reth:kurtosis-ci"] + output = ["type=docker,dest=${HIVE_OUTPUT_DIR}/reth_image.tar"] +} +