Skip to content

Commit

Permalink
add some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa committed Dec 12, 2023
1 parent f5e1eb3 commit 5a9406e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/blobber/blobber_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ blobber_context = import_module("../blobber/blobber_context.star")

BLOBBER_BEACON_PORT_NUM = 9000
BLOBBER_BEACON_PORT_ID = "discovery"
BLOBBER_VALIDATOR_PROXY_PORT_NUM = 4000
BLOBBER_VALIDATOR_PROXY_PORT_NUM = 5000
BLOBBER_VALIDATOR_PROXY_PORT_ID = "http"

PRIVATE_IP_ADDRESS_PLACEHOLDER = "KURTOSIS_IP_ADDR_PLACEHOLDER"
Expand Down Expand Up @@ -34,7 +34,7 @@ def launch(plan, service_name, node_keystore_files, beacon_http_url, extra_param

blobber_service = plan.add_service(blobber_service_name, blobber_config)
return blobber_context.new_blobber_context(
blobber_service.ip_address, BLOBBER_VALIDATOR_PROXY_PORT_NUM
blobber_service.ip_address, blobber_service.ports[BLOBBER_VALIDATOR_PROXY_PORT_NUM]
)


Expand All @@ -50,7 +50,7 @@ def get_config(service_name, node_keystore_files, beacon_http_url, extra_params)
"--validator-key-folder={0}".format(validator_root_dirpath),
"--enable-unsafe-mode",
"--external-ip={0}".format(PRIVATE_IP_ADDRESS_PLACEHOLDER),
"--validator-proxy-port-start={0}".format(BLOBBER_VALIDATOR_PROXY_PORT_NUM), # use the same port as the beacon http port
"--validator-proxy-port-start={0}".format(BLOBBER_VALIDATOR_PROXY_PORT_NUM),
]

if len(extra_params) > 0:
Expand Down
4 changes: 2 additions & 2 deletions src/cl/lighthouse/lighthouse_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ def launch(
)

blobber_service = plan.add_service(blobber_service_name, blobber_config)
blobber_http_port = blobber_service.ports[BEACON_HTTP_PORT_ID]
blobber_http_port = blobber_service.ports[blobber_launcher.BLOBBER_VALIDATOR_PROXY_PORT_ID]
blobber_http_url = "http://{0}:{1}".format(
blobber_service.ip_address, beacon_http_port.number
blobber_service.ip_address, blobber_http_port.number
)
beacon_http_url = blobber_http_url

Expand Down
16 changes: 8 additions & 8 deletions src/cl/lodestar/lodestar_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ input_parser = import_module("../../package_io/input_parser.star")
cl_client_context = import_module("../../cl/cl_client_context.star")
node_metrics = import_module("../../node_metrics_info.star")
cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star")

blobber_launcher = import_module("../../blobber/blobber_launcher.star")
constants = import_module("../../package_io/constants.star")

# ---------------------------------- Beacon client -------------------------------------
CONSENSUS_DATA_DIRPATH_ON_SERVICE_CONTAINER = "/consensus-data"
# Port IDs
TCP_DISCOVERY_PORT_ID = "tcp-discovery"
UDP_DISCOVERY_PORT_ID = "udp-discovery"
HTTP_PORT_ID = "http"
BEACON_HTTP_PORT_ID = "http"
METRICS_PORT_ID = "metrics"
VALIDATOR_METRICS_PORT_ID = "validator-metrics"

Expand Down Expand Up @@ -47,7 +47,7 @@ BEACON_USED_PORTS = {
UDP_DISCOVERY_PORT_ID: shared_utils.new_port_spec(
DISCOVERY_PORT_NUM, shared_utils.UDP_PROTOCOL
),
HTTP_PORT_ID: shared_utils.new_port_spec(HTTP_PORT_NUM, shared_utils.TCP_PROTOCOL),
BEACON_HTTP_PORT_ID: shared_utils.new_port_spec(HTTP_PORT_NUM, shared_utils.TCP_PROTOCOL),
METRICS_PORT_ID: shared_utils.new_port_spec(
METRICS_PORT_NUM, shared_utils.TCP_PROTOCOL
),
Expand Down Expand Up @@ -128,7 +128,7 @@ def launch(

beacon_service = plan.add_service(beacon_node_service_name, beacon_config)

beacon_http_port = beacon_service.ports[HTTP_PORT_ID]
beacon_http_port = beacon_service.ports[BEACON_HTTP_PORT_ID]

beacon_http_url = "http://{0}:{1}".format(
beacon_service.ip_address, beacon_http_port.number
Expand All @@ -145,9 +145,9 @@ def launch(
)

blobber_service = plan.add_service(blobber_service_name, blobber_config)
blobber_http_port = blobber_service.ports[BEACON_HTTP_PORT_ID]
blobber_http_port = blobber_service.ports[blobber_launcher.BLOBBER_VALIDATOR_PROXY_PORT_ID]
blobber_http_url = "http://{0}:{1}".format(
blobber_service.ip_address, beacon_http_port.number
blobber_service.ip_address, blobber_http_port.number
)
beacon_http_url = blobber_http_url

Expand Down Expand Up @@ -179,7 +179,7 @@ def launch(

beacon_node_identity_recipe = GetHttpRequestRecipe(
endpoint="/eth/v1/node/identity",
port_id=HTTP_PORT_ID,
port_id=BEACON_HTTP_PORT_ID,
extract={
"enr": ".data.enr",
"multiaddr": ".data.p2p_addresses[-1]",
Expand Down Expand Up @@ -306,7 +306,7 @@ def get_beacon_config(
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid
},
private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER,
ready_conditions=cl_node_ready_conditions.get_ready_conditions(HTTP_PORT_ID),
ready_conditions=cl_node_ready_conditions.get_ready_conditions(BEACON_HTTP_PORT_ID),
min_cpu=bn_min_cpu,
max_cpu=bn_max_cpu,
min_memory=bn_min_mem,
Expand Down
1 change: 1 addition & 0 deletions src/cl/nimbus/nimbus_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star

constants = import_module("../../package_io/constants.star")

blobber_launcher = import_module("../../blobber/blobber_launcher.star")
VALIDATOR_KEYS_MOUNTPOINT_ON_CLIENT = "/validator-keys"

# Port IDs
Expand Down
20 changes: 10 additions & 10 deletions src/cl/prysm/prysm_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cl_client_context = import_module("../../cl/cl_client_context.star")
node_metrics = import_module("../../node_metrics_info.star")
cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star")
constants = import_module("../../package_io/constants.star")

blobber_launcher = import_module("../../blobber/blobber_launcher.star")
IMAGE_SEPARATOR_DELIMITER = ","
EXPECTED_NUM_IMAGES = 2

Expand All @@ -15,7 +15,7 @@ CONSENSUS_DATA_DIRPATH_ON_SERVICE_CONTAINER = "/consensus-data"
TCP_DISCOVERY_PORT_ID = "tcp-discovery"
UDP_DISCOVERY_PORT_ID = "udp-discovery"
RPC_PORT_ID = "rpc"
HTTP_PORT_ID = "http"
BEACON_HTTP_PORT_ID = "http"
BEACON_MONITORING_PORT_ID = "monitoring"

# Port nums
Expand Down Expand Up @@ -61,7 +61,7 @@ BEACON_NODE_USED_PORTS = {
DISCOVERY_UDP_PORT_NUM, shared_utils.UDP_PROTOCOL
),
RPC_PORT_ID: shared_utils.new_port_spec(RPC_PORT_NUM, shared_utils.TCP_PROTOCOL),
HTTP_PORT_ID: shared_utils.new_port_spec(HTTP_PORT_NUM, shared_utils.TCP_PROTOCOL),
BEACON_HTTP_PORT_ID: shared_utils.new_port_spec(HTTP_PORT_NUM, shared_utils.TCP_PROTOCOL),
BEACON_MONITORING_PORT_ID: shared_utils.new_port_spec(
BEACON_MONITORING_PORT_NUM, shared_utils.TCP_PROTOCOL
),
Expand Down Expand Up @@ -155,7 +155,7 @@ def launch(

beacon_service = plan.add_service(beacon_node_service_name, beacon_config)

beacon_http_port = beacon_service.ports[HTTP_PORT_ID]
beacon_http_port = beacon_service.ports[BEACON_HTTP_PORT_ID]

beacon_http_endpoint = "{0}:{1}".format(beacon_service.ip_address, HTTP_PORT_NUM)
beacon_rpc_endpoint = "{0}:{1}".format(beacon_service.ip_address, RPC_PORT_NUM)
Expand All @@ -166,16 +166,16 @@ def launch(
blobber_config = blobber_launcher.get_config(
blobber_service_name,
node_keystore_files,
beacon_http_url,
beacon_rpc_endpoint,
blobber_extra_params,
)

blobber_service = plan.add_service(blobber_service_name, blobber_config)
blobber_http_port = blobber_service.ports[BEACON_HTTP_PORT_ID]
blobber_http_port = blobber_service.ports[blobber_launcher.BLOBBER_VALIDATOR_PROXY_PORT_ID]
blobber_http_url = "http://{0}:{1}".format(
blobber_service.ip_address, beacon_http_port.number
blobber_service.ip_address, blobber_http_port.number
)
beacon_http_url = blobber_http_url
beacon_rpc_endpoint = blobber_http_url

# Launch validator node if we have a keystore file
validator_service = None
Expand Down Expand Up @@ -210,7 +210,7 @@ def launch(
# TODO(old) add validator availability using the validator API: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v1#/ValidatorRequiredApi | from eth2-merge-kurtosis-module
beacon_node_identity_recipe = GetHttpRequestRecipe(
endpoint="/eth/v1/node/identity",
port_id=HTTP_PORT_ID,
port_id=BEACON_HTTP_PORT_ID,
extract={
"enr": ".data.enr",
"multiaddr": ".data.discovery_addresses[0]",
Expand Down Expand Up @@ -335,7 +335,7 @@ def get_beacon_config(
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
},
private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER,
ready_conditions=cl_node_ready_conditions.get_ready_conditions(HTTP_PORT_ID),
ready_conditions=cl_node_ready_conditions.get_ready_conditions(BEACON_HTTP_PORT_ID),
min_cpu=bn_min_cpu,
max_cpu=bn_max_cpu,
min_memory=bn_min_mem,
Expand Down
2 changes: 1 addition & 1 deletion src/cl/teku/teku_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ node_metrics = import_module("../../node_metrics_info.star")
cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star")

constants = import_module("../../package_io/constants.star")

blobber_launcher = import_module("../../blobber/blobber_launcher.star")
TEKU_BINARY_FILEPATH_IN_IMAGE = "/opt/teku/bin/teku"

# The Docker container runs as the "teku" user so we can't write to root
Expand Down

0 comments on commit 5a9406e

Please sign in to comment.