Skip to content

Commit

Permalink
feat: add another flag to use default public ports
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Oct 23, 2024
1 parent ff2a04c commit 3f106b1
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ args:
blutgang_start_port: 52100
erpc_start_port: 52200
panoptichain_start_port: 52300

2 changes: 2 additions & 0 deletions .github/tests/public-ports/default-public-ports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
args:
use_default_public_ports: true
35 changes: 1 addition & 34 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:

- id: set-matrix
# List all yml files in the .github/tests directory, as well as test combinations, except for the additional-services.yml file.
run: echo "matrix=$(ls -R ./.github/tests/combinations/*.yml | grep -v 'additional-services.yml' | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
run: echo "matrix=$(ls -R ./.github/tests/combinations/*.yml ./.github/tests/public-ports/*.yml | grep -v 'additional-services.yml' | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT

run-with-args:
needs: list-ymls
Expand Down Expand Up @@ -234,39 +234,6 @@ jobs:
name: dump_additional_services_${{ github.run_id }}
path: ./dump

static-ports:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

- name: Install Kurtosis CDK tools
uses: ./.github/actions/setup-kurtosis-cdk

- name: Run Starlark
run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/static-ports.yml --show-enclave-inspect=false .

- name: Inspect enclave
run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }}

- name: Monitor verified batches
working-directory: .github/scripts
run: |
./monitor-verified-batches.sh \
--enclave ${{ env.ENCLAVE_NAME }} \
--rpc-url "$(kurtosis port print ${{ env.ENCLAVE_NAME }} cdk-erigon-node-001 rpc)"
- name: Dump enclave logs
if: failure()
run: kurtosis dump ./dump

- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: dump_attach_ckds_${{ github.run_id }}
path: ./dump

attach-second-cdk:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down
49 changes: 43 additions & 6 deletions input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,37 @@ DEFAULT_PORTS = {
"zkevm_rpc_ws_port": 8133,
}

# By default, we rely on dynamic ports set by Kurtosis.
DEFAULT_PUBLIC_PORTS = {
# By default, we rely on dynamic ports set by Kurtosis.
"static_ports": {}
"public_ports": {
{
# L1 public ports (50000-50999).
"l1_public_ports": {
"l1_el_start_port": 50000,
"l1_cl_start_port": 50100,
"l1_vc_start_port": 50200,
"l1_additional_services_start_port": 50300,
},
# L2/CDK public ports (51000-51999).
"l2_cdk_public_ports": {
"agglayer_start_port": 51000,
"cdk_node_start_port": 51100,
"zkevm_bridge_service_start_port": 51210,
"zkevm_bridge_ui_start_port": 51220,
"reverse_proxy_start_port": 51230,
"database_start_port": 51300,
"zkevm_pool_manager_start_port": 51400,
"zkevm_dac_start_port": 51500,
},
# L2 additional services (52000-52999).
"l2_additional_services": {
"arpeggio_start_port": 52000,
"blutgang_start_port": 52100,
"erpc_start_port": 52200,
"panoptichain_start_port": 52300,
},
}
}
}

# Addresses and private keys of the different components.
Expand Down Expand Up @@ -164,6 +192,8 @@ DEFAULT_ROLLUP_ARGS = {
"erigon_strict_mode": True,
# Set to true to automatically deploy an ERC20 contract on L1 to be used as the gas token on the rollup.
"zkevm_use_gas_token_contract": False,
# Use the default public ports.
"use_default_public_ports": False,
}

DEFAULT_PLESS_ZKEVM_NODE_ARGS = {
Expand Down Expand Up @@ -207,7 +237,6 @@ DEFAULT_ARGS = (
}
| DEFAULT_IMAGES
| DEFAULT_PORTS
| DEFAULT_PUBLIC_PORTS
| DEFAULT_ACCOUNTS
| DEFAULT_L1_ARGS
| DEFAULT_ROLLUP_ARGS
Expand Down Expand Up @@ -235,12 +264,20 @@ def parse_args(plan, args):
sequencer_type = args.get("sequencer_type", "")
sequencer_name = get_sequencer_name(sequencer_type)

plan.print(
"DEBUG: " + str(deployment_stages.get("deploy_cdk_erigon_node", False))
) # DEBUG
deploy_cdk_erigon_node = deployment_stages.get("deploy_cdk_erigon_node", False)
l2_rpc_name = get_l2_rpc_name(deploy_cdk_erigon_node)

# Determine public ports.
# By default, we rely on dynamic ports set by Kurtosis.
if args.get("use_default_public_ports", False):
plan.print("Using default public ports.")
args = DEFAULT_PUBLIC_PORTS | args
else:
public_ports = args.get("public_ports", {})
if public_ports:
plan.print("Using custom public ports.")
args = args | {"public_ports": public_ports}

# Remove deployment stages from the args struct.
# This prevents updating already deployed services when updating the deployment stages.
if "deployment_stages" in args:
Expand Down

0 comments on commit 3f106b1

Please sign in to comment.