Skip to content

Commit 20202e2

Browse files
committed
feat(ci): parameterize consensus client docker images in integration tests
Introduce a `consensus_image` input in the checkpoint-sync action and use matrix strategy in `integration.yaml` to pass specific Docker images for each consensus client and network combination. This allows for testing against pinned versions instead of relying on `:latest` tags, improving test stability and reproducibility.
1 parent 2206655 commit 20202e2

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

.github/actions/checkpoint-sync/action.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ inputs:
1111
beacon_node_url:
1212
description: "The beacon node API URL to use"
1313
required: true
14+
consensus_image:
15+
description: "The docker image to use for the consensus client"
16+
required: true
1417

1518
runs:
1619
using: composite
@@ -183,35 +186,35 @@ runs:
183186
if: ${{ inputs.consensus == 'teku' }}
184187
run: |
185188
echo "Starting Teku...";
186-
docker run -p 5052:5052 -d --name beacon --network eth -e TEKU_REST_API_ENABLED=true -e TEKU_P2P_PORT=9000 consensys/teku:latest --rest-api-port=5052 --network=${{ inputs.network }} --log-destination=CONSOLE --initial-state=http://checkpointz:5555/eth/v2/debug/beacon/states/finalized --ee-endpoint=http://102.10.10.1:8545
189+
docker run -p 5052:5052 -d --name beacon --network eth -e TEKU_REST_API_ENABLED=true -e TEKU_P2P_PORT=9000 ${{ inputs.consensus_image }} --rest-api-port=5052 --network=${{ inputs.network }} --log-destination=CONSOLE --initial-state=http://checkpointz:5555/eth/v2/debug/beacon/states/finalized --ee-endpoint=http://102.10.10.1:8545
187190
echo "Teku is running.";
188191
- name: Run lighthouse client
189192
shell: bash
190193
if: ${{ inputs.consensus == 'lighthouse' }}
191194
run: |
192195
echo "Starting Lighthouse...";
193-
docker run -p 5052:5052 --network eth -d --name beacon sigp/lighthouse:latest lighthouse bn --network=${{ inputs.network }} --datadir=/data --checkpoint-sync-url=http://checkpointz:5555 --http --http-address=0.0.0.0 --execution-endpoint=http://localhost:8545 --execution-jwt-secret-key=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
196+
docker run -p 5052:5052 --network eth -d --name beacon ${{ inputs.consensus_image }} lighthouse bn --network=${{ inputs.network }} --datadir=/data --checkpoint-sync-url=http://checkpointz:5555 --http --http-address=0.0.0.0 --execution-endpoint=http://localhost:8545 --execution-jwt-secret-key=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
194197
echo "Lighthouse is running.";
195198
- name: Run prysm
196199
shell: bash
197200
if: ${{ inputs.consensus == 'prysm' }}
198201
run: |
199202
echo "Starting prysm...";
200-
docker run -d --name beacon --network eth -p 5052:5052 gcr.io/prysmaticlabs/prysm/beacon-chain:latest --datadir=/data --accept-terms-of-use --${{ inputs.network }} --clear-db --grpc-gateway-port=5052 --grpc-gateway-host=0.0.0.0 --execution-endpoint=http://localhost:8545 --force-clear-db --checkpoint-sync-url=http://checkpointz:5555 --genesis-beacon-api-url=http://checkpointz:5555 --grpc-gateway-port=5052
203+
docker run -d --name beacon --network eth -p 5052:5052 ${{ inputs.consensus_image }} --datadir=/data --accept-terms-of-use --${{ inputs.network }} --clear-db --grpc-gateway-port=5052 --grpc-gateway-host=0.0.0.0 --execution-endpoint=http://localhost:8545 --force-clear-db --checkpoint-sync-url=http://checkpointz:5555 --genesis-beacon-api-url=http://checkpointz:5555 --grpc-gateway-port=5052
201204
echo "Prysm is running.";
202205
- name: Run nimbus
203206
shell: bash
204207
if: ${{ inputs.consensus == 'nimbus' }}
205208
run: |
206209
echo "Starting nimbus...";
207-
docker run --name beacon --network eth statusim/nimbus-eth2:amd64-latest trustedNodeSync --network=${{ inputs.network }} --trusted-node-url=http://checkpointz:5555 --backfill=false
210+
docker run --name beacon --network eth ${{ inputs.consensus_image }} trustedNodeSync --network=${{ inputs.network }} --trusted-node-url=http://checkpointz:5555 --backfill=false
208211
echo "Nimbus is running.";
209212
- name: Run lodestar
210213
shell: bash
211214
if: ${{ inputs.consensus == 'lodestar' }}
212215
run: |
213216
echo "Starting lodestar...";
214-
docker run --name beacon -d --network eth -p 5052:5052 chainsafe/lodestar beacon --dataDir /data --network ${{ inputs.network }} --checkpointSyncUrl=http://checkpointz:5555 --rest --rest.address 0.0.0.0 --rest.port=5052
217+
docker run --name beacon -d --network eth -p 5052:5052 ${{ inputs.consensus_image }} beacon --dataDir /data --network ${{ inputs.network }} --checkpointSyncUrl=http://checkpointz:5555 --rest --rest.address 0.0.0.0 --rest.port=5052
215218
echo "Lodestar is running.";
216219
- name: Wait for consensus client to have checkpoint synced
217220
shell: bash

.github/workflows/integration.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
consensus: [lighthouse, teku, prysm, nimbus, lodestar]
16-
network: [mainnet, holesky]
15+
include:
16+
# Mainnet
17+
- {consensus: lighthouse, network: mainnet, image: 'sigp/lighthouse:latest'}
18+
- {consensus: teku, network: mainnet, image: 'consensys/teku:latest'}
19+
- {consensus: prysm, network: mainnet, image: 'gcr.io/prysmaticlabs/prysm/beacon-chain:latest'}
20+
- {consensus: nimbus, network: mainnet, image: 'statusim/nimbus-eth2:amd64-latest'}
21+
- {consensus: lodestar, network: mainnet, image: 'chainsafe/lodestar:latest'}
22+
# Holesky
23+
- {consensus: lighthouse, network: holesky, image: 'sigp/lighthouse:v8.0.0-rc.0'}
24+
- {consensus: teku, network: holesky, image: 'consensys/teku:25.9.3'}
25+
- {consensus: prysm, network: holesky, image: 'gcr.io/prysmaticlabs/prysm/beacon-chain:v6.1.1'}
26+
- {consensus: nimbus, network: holesky, image: 'statusim/nimbus-eth2:amd64-v25.9.2'}
27+
- {consensus: lodestar, network: holesky, image: 'chainsafe/lodestar:v1.35.0-rc.1'}
1728
runs-on: ubuntu-latest
1829
timeout-minutes: 10
1930
steps:
@@ -22,6 +33,7 @@ jobs:
2233
run: |
2334
echo "Consensus: ${{ matrix.consensus }}"
2435
echo "Network: ${{ matrix.network }}"
36+
echo "Image: ${{ matrix.image }}"
2537
- name: Set beacon node URL
2638
id: set-url
2739
run: |
@@ -36,4 +48,5 @@ jobs:
3648
with:
3749
consensus: ${{ matrix.consensus }}
3850
network: ${{ matrix.network }}
39-
beacon_node_url: ${{ steps.set-url.outputs.beacon_node_url }}
51+
beacon_node_url: ${{ steps.set-url.outputs.beacon_node_url }}
52+
consensus_image: ${{ matrix.image }}

0 commit comments

Comments
 (0)