Skip to content
This repository has been archived by the owner on Feb 18, 2025. It is now read-only.

feat(ci): Add kurtosis config without op-geth #29

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/assets/kurtosis_op_network_params_local_no_op_geth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ethereum_package:
participants:
- el_type: reth
cl_type: lighthouse
optimism_package:
chains:
- participants:
- el_type: op-reth
el_image: "ghcr.io/paradigmxyz/op-reth:kurtosis-ci"
cl_type: op-node
cl_image: "ghcr.io/ethereum-optimism/op-node:kurtosis-ci"
batcher_params:
extra_params:
- "--throttle-interval=0"
14 changes: 14 additions & 0 deletions .github/assets/kurtosis_op_network_params_remote_no_op_geth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ethereum_package:
participants:
- el_type: reth
cl_type: lighthouse
optimism_package:
chains:
- participants:
- el_type: op-reth
el_image: "ghcr.io/paradigmxyz/op-reth:kurtosis-ci"
cl_type: op-node
cl_image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:develop
batcher_params:
extra_params:
- "--throttle-interval=0"
142 changes: 142 additions & 0 deletions .github/workflows/kurtosis-op-local-no-op-geth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Runs simple OP stack setup in Kurtosis

name: Run kurtosis (local images)

on:
workflow_dispatch:
inputs:
op-node-repo:
type: string
required: true
description: "An optimizm repo (clone) to use for op-node"
default: https://github.com/ethereum-optimism/optimism.git

op-node-ref:
type: string
required: true
description: "op-node git ref (branch/commit) to use"
default: develop

op-geth-repo:
type: string
required: true
description: "An op-geth repo (clone) to use for op-geth"
default: https://github.com/ethereum-optimism/op-geth.git

op-geth-ref:
type: string
required: true
description: "op-geth git ref (branch/commit) to use"
default: optimism

env:
CARGO_TERM_COLOR: always

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
prepare-op-geth:
name: Prepare op-geth docker image
uses: ./.github/workflows/prepare-op-image.yml
with:
repo: ${{ inputs.op-geth-repo }}
ref: ${{ inputs.op-geth-ref }}
image_tag: ghcr.io/ethereum-optimism/op-geth:kurtosis-ci
artifact_name: op_geth_image

prepare-op-node:
name: Prepare op-node docker image
uses: ./.github/workflows/prepare-op-image.yml
with:
repo: ${{ inputs.op-node-repo }}
ref: ${{ inputs.op-node-ref }}
dockerfile: ops/docker/op-stack-go/Dockerfile
target: op-node-target
image_tag: ghcr.io/ethereum-optimism/op-node:kurtosis-ci
artifact_name: op_node_image

prepare-op-reth:
name: Prepare op-reth docker image
uses: ./.github/workflows/prepare-op-reth.yml
with:
image_tag: ghcr.io/paradigmxyz/op-reth:kurtosis-ci
binary_name: op-reth
cargo_features: optimism,asm-keccak
cargo_package: crates/optimism/bin/Cargo.toml

test:
timeout-minutes: 60
strategy:
fail-fast: false
name: run kurtosis
runs-on: ubuntu-latest
needs:
- prepare-op-reth
- prepare-op-geth
- prepare-op-node
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download docker image artifacts
uses: actions/download-artifact@v4
with:
pattern: artifacts--*
merge-multiple: true
path: /tmp

- name: Load Docker images
run: |
# Load all images from artifacts
docker load -i /tmp/op_reth_image.tar
docker load -i /tmp/op_geth_image.tar
docker load -i /tmp/op_node_image.tar

# List available images
docker image ls -a

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Run kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli
kurtosis engine start
kurtosis run --enclave op-devnet github.com/ethpandaops/optimism-package --args-file .github/assets/kurtosis_op_network_params_local_no_op_geth.yaml
ENCLAVE_ID=$(curl http://127.0.0.1:9779/api/enclaves | jq --raw-output 'keys[0]')
GETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-1-op-geth-op-node-op-kurtosis".public_ports.rpc.number')
RETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-2-op-reth-op-node-op-kurtosis".public_ports.rpc.number')
echo "GETH_RPC=http://127.0.0.1:$GETH_PORT" >> $GITHUB_ENV
echo "RETH_RPC=http://127.0.0.1:$RETH_PORT" >> $GITHUB_ENV

- name: Assert that clients advance
run: |
for i in {1..100}; do
sleep 5
BLOCK_GETH=$(cast bn --rpc-url $GETH_RPC)
BLOCK_RETH=$(cast bn --rpc-url $RETH_RPC)

if [ $BLOCK_GETH -ge 100 ] && [ $BLOCK_RETH -ge 100 ] ; then exit 0; fi
echo "Waiting for clients to advance..., Reth: $BLOCK_RETH Geth: $BLOCK_GETH"
done
kurtosis service logs -a op-devnet op-el-2-op-reth-op-node-op-kurtosis
kurtosis service logs -a op-devnet op-cl-2-op-node-op-reth-op-kurtosis
exit 1


notify-on-error:
needs: test
if: failure()
runs-on: ubuntu-latest
steps:
- name: Slack Webhook Action
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed run: https://github.com/paradigmxyz/reth/actions/runs/${{ github.run_id }}"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
94 changes: 94 additions & 0 deletions .github/workflows/kurtosis-op-remote-no-op-geth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Runs simple OP stack setup in Kurtosis

name: Run kurtosis (remote images)

on:
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
prepare-op-reth:
name: Prepare op-reth docker image
uses: ./.github/workflows/prepare-op-reth.yml
with:
image_tag: ghcr.io/paradigmxyz/op-reth:kurtosis-ci
binary_name: op-reth
cargo_features: optimism,asm-keccak
cargo_package: crates/optimism/bin/Cargo.toml

test:
timeout-minutes: 60
strategy:
fail-fast: false
name: run kurtosis
runs-on: ubuntu-latest
needs:
- prepare-op-reth
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download docker image artifacts
uses: actions/download-artifact@v4
with:
pattern: artifacts--*
merge-multiple: true
path: /tmp

- name: Load Docker images
run: |
# Load all images from artifacts
docker load -i /tmp/op_reth_image.tar

# List available images
docker image ls -a

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Run kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli
kurtosis engine start
kurtosis run --enclave op-devnet github.com/ethpandaops/optimism-package --args-file .github/assets/kurtosis_op_network_params_remote_no_op_geth.yaml
ENCLAVE_ID=$(curl http://127.0.0.1:9779/api/enclaves | jq --raw-output 'keys[0]')
GETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-1-op-geth-op-node-op-kurtosis".public_ports.rpc.number')
RETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-2-op-reth-op-node-op-kurtosis".public_ports.rpc.number')
echo "GETH_RPC=http://127.0.0.1:$GETH_PORT" >> $GITHUB_ENV
echo "RETH_RPC=http://127.0.0.1:$RETH_PORT" >> $GITHUB_ENV

- name: Assert that clients advance
run: |
for i in {1..100}; do
sleep 5
BLOCK_GETH=$(cast bn --rpc-url $GETH_RPC)
BLOCK_RETH=$(cast bn --rpc-url $RETH_RPC)

if [ $BLOCK_GETH -ge 100 ] && [ $BLOCK_RETH -ge 100 ] ; then exit 0; fi
echo "Waiting for clients to advance..., Reth: $BLOCK_RETH Geth: $BLOCK_GETH"
done
kurtosis service logs -a op-devnet op-el-2-op-reth-op-node-op-kurtosis
kurtosis service logs -a op-devnet op-cl-2-op-node-op-reth-op-kurtosis
exit 1


notify-on-error:
needs: test
if: failure()
runs-on: ubuntu-latest
steps:
- name: Slack Webhook Action
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed run: https://github.com/paradigmxyz/reth/actions/runs/${{ github.run_id }}"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
Loading