Skip to content

feat: add docstring to simplify cdk deployment via kurtosis web interface #509

feat: add docstring to simplify cdk deployment via kurtosis web interface

feat: add docstring to simplify cdk deployment via kurtosis web interface #509

Workflow file for this run

---
name: deploy
on:
pull_request:
push:
branches: [main]
concurrency:
group: deploy-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CHECK_VERIFIED_BATCHES_TIMEOUT_SECONDS: "300" # 5 minutes
jobs:
# Deploy the CDK environment in one step, with the gas token feature enabled.
monolithic_cdk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Install tools.
- name: Install 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 analytics disable
- name: Install yq
run: pip3 install yq
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
# Deploy components.
- name: Enable gas token feature
run: yq -Y --in-place '.args.zkevm_use_gas_token_contract = true' params.yml
- name: Deploy Kurtosis CDK package
run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always .
# Check that batches are being verified.
- name: Check that batches are being verified
run: |
timeout_seconds="${CHECK_VERIFIED_BATCHES_TIMEOUT_SECONDS:-300}"
start_time=$(date +%s)
end_time=$((start_time + timeout_seconds))
export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)"
while true; do
current_time=$(date +%s)
if (( current_time > end_time )); then
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified."
exit 1
fi
verified_batches=$(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches"
if (( verified_batches > 0 )); then
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... At least one batch was verified."
exit 0
fi
sleep 10
done
# Deploy the CDK environment incrementally, stage by stage.
incremental_cdk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Install tools.
- name: Install 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 analytics disable
- name: Install yq
run: pip3 install yq
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
# Deploy components.
- name: Disable All Deployment Steps
run: |
yq -Y --in-place '.deploy_l1 = false' params.yml
yq -Y --in-place '.deploy_zkevm_contracts_on_l1 = false' params.yml
yq -Y --in-place '.deploy_databases = false' params.yml
yq -Y --in-place '.deploy_cdk_central_environment = false' params.yml
yq -Y --in-place '.deploy_cdk_bridge_infra = false' params.yml
yq -Y --in-place '.deploy_zkevm_permissionless_node = false' params.yml
yq -Y --in-place '.deploy_observability = false' params.yml
- name: Deploy L1
run: |
yq -Y --in-place '.deploy_l1 = true' params.yml
kurtosis run --enclave cdk-v1 --args-file params.yml .
yq -Y --in-place '.deploy_l1 = false' params.yml # reset
- name: Deploy ZkEVM Contracts on L1
run: |
yq -Y --in-place '.deploy_zkevm_contracts_on_l1 = true' params.yml
kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always .
yq -Y --in-place '.deploy_zkevm_contracts_on_l1 = false' params.yml # reset
- name: Deploy ZkEVM Node and CDK Peripheral Databases
run: |
yq -Y --in-place '.deploy_databases = true' params.yml
kurtosis run --enclave cdk-v1 --args-file params.yml .
yq -Y --in-place '.deploy_databases = false' params.yml # reset
- name: Deploy CDK Central Environment
run: |
yq -Y --in-place '.deploy_cdk_central_environment = true' params.yml
kurtosis run --enclave cdk-v1 --args-file params.yml .
yq -Y --in-place '.deploy_cdk_central_environment = false' params.yml # reset
- name: Deploy CDK Bridge Infrastructure
run: |
yq -Y --in-place '.deploy_cdk_bridge_infra = true' params.yml
kurtosis run --enclave cdk-v1 --args-file params.yml .
yq -Y --in-place '.deploy_cdk_bridge_infra = false' params.yml # reset
- name: Deploy ZkEVM Permissionless Node
run: |
yq -Y --in-place '.deploy_zkevm_permissionless_node = true' params.yml
kurtosis run --enclave cdk-v1 --args-file params.yml .
yq -Y --in-place '.deploy_zkevm_permissionless_node = false' params.yml # reset
- name: Deploy Observability Stack
run: |
yq -Y --in-place '.deploy_observability = true' params.yml
kurtosis run --enclave cdk-v1 --args-file params.yml .
yq -Y --in-place '.deploy_observability = false' params.yml # reset
# Check that batches are being verified.
- name: Check that batches are being verified
run: |
timeout_seconds="${CHECK_VERIFIED_BATCHES_TIMEOUT_SECONDS:-300}"
start_time=$(date +%s)
end_time=$((start_time + timeout_seconds))
export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)"
while true; do
current_time=$(date +%s)
if (( current_time > end_time )); then
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified."
exit 1
fi
verified_batches=$(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches"
if (( verified_batches > 0 )); then
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... At least one batch was verified."
exit 0
fi
sleep 10
done