Commit f0fca7a4 authored by Gyanendra Mishra's avatar Gyanendra Mishra

rename smooth

parent 4a746ad1
......@@ -39,17 +39,17 @@ def launch_forkmon(
config_files_artifact_uuid = render_templates(template_and_data_by_rel_dest_filepath)
service_config = get_service_config(config_files_artifact_uuid)
config = get_config(config_files_artifact_uuid)
add_service(SERVICE_ID, service_config)
add_service(SERVICE_ID, config)
def get_service_config(config_files_artifact_uuid):
def get_config(config_files_artifact_uuid):
config_file_path = path_join(FORKMON_CONFIG_MOUNT_DIRPATH_ON_SERVICE, FORKMON_CONFIG_FILENAME)
return struct(
container_image_name = IMAGE_NAME,
used_ports = USED_PORTS,
files_artifact_mount_dirpaths = {
image = IMAGE_NAME,
ports = USED_PORTS,
files = {
config_files_artifact_uuid: FORKMON_CONFIG_MOUNT_DIRPATH_ON_SERVICE,
},
cmd_args = ["--config-path", config_file_path]
......
......@@ -30,9 +30,9 @@ USED_PORTS = {
def launch_grafana(datasource_config_template, dashboard_providers_config_template, prometheus_private_url):
grafana_config_artifacts_uuid, grafana_dashboards_artifacts_uuid = get_grafana_config_dir_artifact_uuid(datasource_config_template, dashboard_providers_config_template, prometheus_private_url)
service_config = get_service_config(grafana_config_artifacts_uuid, grafana_dashboards_artifacts_uuid)
config = get_config(grafana_config_artifacts_uuid, grafana_dashboards_artifacts_uuid)
add_service(SERVICE_ID, service_config)
add_service(SERVICE_ID, config)
def get_grafana_config_dir_artifact_uuid(datasource_config_template, dashboard_providers_config_template, prometheus_private_url):
......@@ -55,12 +55,12 @@ def get_grafana_config_dir_artifact_uuid(datasource_config_template, dashboard_p
return grafana_config_artifacts_uuid, grafana_dashboards_artifacts_uuid
def get_service_config(grafana_config_artifacts_uuid, grafana_dashboards_artifacts_uuid):
def get_config(grafana_config_artifacts_uuid, grafana_dashboards_artifacts_uuid):
return struct(
container_image_name = IMAGE_NAME,
used_ports = USED_PORTS,
image = IMAGE_NAME,
ports = USED_PORTS,
env_vars = {CONFIG_DIRPATH_ENV_VAR: GRAFANA_CONFIG_DIRPATH_ON_SERVICE},
files_artifact_mount_dirpaths = {
files = {
grafana_config_artifacts_uuid : GRAFANA_CONFIG_DIRPATH_ON_SERVICE,
grafana_dashboards_artifacts_uuid: GRAFANA_DASHBOARDS_DIRPATH_ON_SERVICE
}
......
......@@ -86,7 +86,7 @@ def launch(
log_level = get_client_log_level_or_default(participant_log_level, global_log_level, LIGHTHOUSE_LOG_LEVELS)
# Launch Beacon node
beacon_service_config = get_beacon_service_config(
beacon_config = get_beacon_config(
launcher.genesis_data,
image,
bootnode_context,
......@@ -96,7 +96,7 @@ def launch(
extra_beacon_params,
)
beacon_service = add_service(beacon_node_service_id, beacon_service_config)
beacon_service = add_service(beacon_node_service_id, beacon_config)
# TODO check whether its 200, 206 or 503 like golang
define_fact(service_id = beacon_node_service_id, fact_name = BEACON_HEALTH_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/health", content_type = "application/json", port_id = BEACON_HTTP_PORT_ID))
......@@ -107,7 +107,7 @@ def launch(
# Launch validator node
beacon_http_url = "http://{0}:{1}".format(beacon_service.ip_address, beacon_http_port.number)
validator_service_config = get_validator_service_config(
validator_config = get_validator_config(
launcher.genesis_data,
image,
log_level,
......@@ -117,7 +117,7 @@ def launch(
extra_validator_params,
)
validator_service = add_service(validator_node_service_id, validator_service_config)
validator_service = add_service(validator_node_service_id, validator_config)
# TODO(old) add validator availability using the validator API: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v1#/ValidatorRequiredApi | from eth2-merge-kurtosis-module
define_fact(service_id = beacon_node_service_id, fact_name = BEACON_ENR_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/identity", field_extractor = ".data.enr", content_type = "application/json", port_id = BEACON_HTTP_PORT_ID))
......@@ -144,7 +144,7 @@ def launch(
return result
def get_beacon_service_config(
def get_beacon_config(
genesis_data,
image,
boot_cl_client_ctx,
......@@ -219,10 +219,10 @@ def get_beacon_service_config(
return struct(
container_image_name = image,
used_ports = BEACON_USED_PORTS,
image = image,
ports = BEACON_USED_PORTS,
cmd_args = cmd_args,
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_MOUNTPOINT_ON_CLIENTS
},
env_vars = {
......@@ -232,7 +232,7 @@ def get_beacon_service_config(
)
def get_validator_service_config(
def get_validator_config(
genesis_data,
image,
log_level,
......@@ -280,10 +280,10 @@ def get_validator_service_config(
return struct(
container_image_name = image,
used_ports = VALIDATOR_USED_PORTS,
image = image,
ports = VALIDATOR_USED_PORTS,
cmd_args = cmd_args,
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_MOUNTPOINT_ON_CLIENTS,
node_keystore_files.files_artifact_uuid: VALIDATOR_KEYS_MOUNTPOINT_ON_CLIENTS,
},
......
......@@ -70,7 +70,7 @@ def launch(
log_level = get_client_log_level_or_default(participant_log_level, global_log_level, LODESTAR_LOG_LEVELS)
# Launch Beacon node
beacon_service_config = get_beacon_service_config(
beacon_config = get_beacon_config(
launcher.cl_genesis_data,
image,
bootnode_context,
......@@ -80,7 +80,7 @@ def launch(
extra_beacon_params,
)
beacon_service = add_service(beacon_node_service_id, beacon_service_config)
beacon_service = add_service(beacon_node_service_id, beacon_config)
beacon_http_port = beacon_service.ports[HTTP_PORT_ID]
......@@ -92,7 +92,7 @@ def launch(
# Launch validator node
beacon_http_url = "http://{0}:{1}".format(beacon_service.ip_address, beacon_http_port.number)
validator_service_config = get_validator_service_config(
validator_config = get_validator_config(
validator_node_service_id,
launcher.cl_genesis_data,
image,
......@@ -103,7 +103,7 @@ def launch(
extra_validator_params,
)
validator_service = add_service(validator_node_service_id, validator_service_config)
validator_service = add_service(validator_node_service_id, validator_config)
# TODO(old) add validator availability using the validator API: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v1#/ValidatorRequiredApi | from eth2-merge-kurtosis-module
......@@ -128,7 +128,7 @@ def launch(
return result
def get_beacon_service_config(
def get_beacon_config(
genesis_data,
image,
boot_cl_client_ctx,
......@@ -195,17 +195,17 @@ def get_beacon_service_config(
cmd_args.extend([param for param in extra_params])
return struct(
container_image_name = image,
used_ports = USED_PORTS,
image = image,
ports = USED_PORTS,
cmd_args = cmd_args,
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_MOUNT_DIRPATH_ON_SERVICE_CONTAINER
},
privaite_ip_address_placeholder = PRIVATE_IP_ADDRESS_PLACEHOLDER
)
def get_validator_service_config(
def get_validator_config(
service_id,
genesis_data,
image,
......@@ -247,10 +247,10 @@ def get_validator_service_config(
return struct(
container_image_name = image,
used_ports = USED_PORTS,
image = image,
ports = USED_PORTS,
cmd_args = cmd_args,
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_MOUNT_DIRPATH_ON_SERVICE_CONTAINER,
node_keystore_files.files_artifact_uuid: VALIDATOR_KEYS_MOUNT_DIRPATH_ON_SERVICE_CONTAINER
},
......
......@@ -76,9 +76,9 @@ def launch(
extra_params = [param for param in extra_beacon_params] + [param for param in extra_validator_params]
service_config = get_service_config(launcher.cl_genesis_data, image, bootnode_context, el_client_context, mev_boost_context, log_level, node_keystore_files, extra_params)
config = get_config(launcher.cl_genesis_data, image, bootnode_context, el_client_context, mev_boost_context, log_level, node_keystore_files, extra_params)
nimbus_service = add_service(service_id, service_config)
nimbus_service = add_service(service_id, config)
# TODO check whether its 200, 206 or 503 like golang
define_fact(service_id = service_id, fact_name = HEALTH_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/health", content_type = "application/json", port_id = HTTP_PORT_ID))
......@@ -106,7 +106,7 @@ def launch(
return result
def get_service_config(
def get_config(
genesis_data,
image,
boot_cl_client_ctx,
......@@ -201,11 +201,11 @@ def get_service_config(
cmd_str = " ".join(cmd_args)
return struct(
container_image_name = image,
used_ports = USED_PORTS,
image = image,
ports = USED_PORTS,
cmd_args = [cmd_str],
entry_point_args = ["sh", "-c"],
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_MOUNTPOINT_ON_CLIENT,
node_keystore_files.files_artifact_uuid: VALIDATOR_KEYS_MOUNTPOINT_ON_CLIENT
},
......
......@@ -93,7 +93,7 @@ def launch(
log_level = get_client_log_level_or_default(participant_log_level, global_log_level, PRYSM_LOG_LEVELS)
beacon_service_config = get_beacon_service_config(
beacon_config = get_beacon_config(
launcher.genesis_data,
beacon_image,
bootnode_context,
......@@ -103,7 +103,7 @@ def launch(
extra_beacon_params,
)
beacon_service = add_service(beacon_node_service_id, beacon_service_config)
beacon_service = add_service(beacon_node_service_id, beacon_config)
# TODO check whether its 200, 206 or 503 like golang
define_fact(service_id = beacon_node_service_id, fact_name = BEACON_HEALTH_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/health", content_type = "application/json", port_id = HTTP_PORT_ID))
......@@ -115,7 +115,7 @@ def launch(
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)
validator_service_config = get_validator_service_config(
validator_config = get_validator_config(
launcher.genesis_data,
validator_image,
validator_node_service_id,
......@@ -129,7 +129,7 @@ def launch(
launcher.prysm_password_artifact_uuid
)
validator_service = add_service(validator_node_service_id, validator_service_config)
validator_service = add_service(validator_node_service_id, validator_config)
# TODO(old) add validator availability using the validator API: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v1#/ValidatorRequiredApi | from eth2-merge-kurtosis-module
define_fact(service_id = beacon_node_service_id, fact_name = BEACON_ENR_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/identity", field_extractor = ".data.enr", content_type = "application/json", port_id = HTTP_PORT_ID))
......@@ -158,7 +158,7 @@ def launch(
return result
def get_beacon_service_config(
def get_beacon_config(
genesis_data,
beacon_image,
bootnode_context,
......@@ -213,17 +213,17 @@ def get_beacon_service_config(
cmd_args.extend([param for param in extra_params])
return struct(
container_image_name = beacon_image,
used_ports = BEACON_NODE_USED_PORTS,
image = beacon_image,
ports = BEACON_NODE_USED_PORTS,
cmd_args = cmd_args,
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_MOUNT_DIRPATH_ON_SERVICE_CONTAINER,
},
privaite_ip_address_placeholder = PRIVATE_IP_ADDRESS_PLACEHOLDER
)
def get_validator_service_config(
def get_validator_config(
genesis_data,
validator_image,
service_id,
......@@ -271,10 +271,10 @@ def get_validator_service_config(
return struct(
container_image_name = validator_image,
used_ports = VALIDATOR_NODE_USED_PORTS,
image = validator_image,
ports = VALIDATOR_NODE_USED_PORTS,
cmd_args = cmd_args,
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_MOUNT_DIRPATH_ON_SERVICE_CONTAINER,
node_keystore_files.files_artifact_uuid: VALIDATOR_KEYS_MOUNT_DIRPATH_ON_SERVICE_CONTAINER,
prysm_password_artifact_uuid: PRYSM_PASSWORD_MOUNT_DIRPATH_ON_SERVICE_CONTAINER,
......
......@@ -85,9 +85,9 @@ def launch(
extra_params = [param for param in extra_beacon_params] + [param for param in extra_validator_params]
service_config = get_service_config(launcher.cl_genesis_data, image, bootnode_context, el_client_context, mev_boost_context, log_level, node_keystore_files, extra_params)
config = get_config(launcher.cl_genesis_data, image, bootnode_context, el_client_context, mev_boost_context, log_level, node_keystore_files, extra_params)
teku_service = add_service(service_id, service_config)
teku_service = add_service(service_id, config)
# TODO check whether its 200, 206 or 503 like golang
define_fact(service_id = service_id, fact_name = HEALTH_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/health", content_type = "application/json", port_id = HTTP_PORT_ID))
......@@ -113,7 +113,7 @@ def launch(
)
return result
def get_service_config(
def get_config(
genesis_data,
image,
boot_cl_client_ctx,
......@@ -203,11 +203,11 @@ def get_service_config(
cmd_str = " ".join(cmd_args)
return struct(
container_image_name = image,
used_ports = USED_PORTS,
image = image,
ports = USED_PORTS,
cmd_args = [cmd_str],
entry_point_args = ["sh", "-c"],
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_MOUNT_DIRPATH_ON_SERVICE_CONTAINER,
node_keystore_files.files_artifact_uuid: VALIDATOR_KEYS_DIRPATH_ON_SERVICE_CONTAINER
},
......
......@@ -57,10 +57,10 @@ def launch(
log_level = get_client_log_level_or_default(participant_log_level, global_log_level, BESU_LOG_LEVELS)
service_config = get_service_config(launcher.network_id, launcher.el_genesis_data,
config = get_config(launcher.network_id, launcher.el_genesis_data,
image, existing_el_clients, log_level, extra_params)
service = add_service(service_id, service_config)
service = add_service(service_id, config)
define_fact(service_id = service_id, fact_name = ENODE_FACT_NAME, fact_recipe = struct(method= "POST", endpoint = "", field_extractor = ".result.enode", body = '{"method":"admin_nodeInfo","params":[],"id":1,"jsonrpc":"2.0"}', content_type = "application/json", port_id = RPC_PORT_ID))
enode = wait(service_id = service_id, fact_name = ENODE_FACT_NAME)
......@@ -76,7 +76,7 @@ def launch(
)
def get_service_config(network_id, genesis_data, image, existing_el_clients, log_level, extra_params):
def get_config(network_id, genesis_data, image, existing_el_clients, log_level, extra_params):
if len(existing_el_clients) < 2:
fail("Besu node cannot be boot nodes, and due to a bug it requires two nodes to exist beforehand")
......@@ -121,10 +121,10 @@ def get_service_config(network_id, genesis_data, image, existing_el_clients, log
launch_node_command_str = " ".join(launch_node_command)
return struct(
container_image_name = image,
used_ports = USED_PORTS,
image = image,
ports = USED_PORTS,
cmd_args = [launch_node_command_str],
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_DIRPATH_ON_CLIENT_CONTAINER
},
entry_point_args = ENTRYPOINT_ARGS,
......
......@@ -55,10 +55,10 @@ def launch(
log_level = get_client_log_level_or_default(participant_log_level, global_log_level, ERIGON_LOG_LEVELS)
service_config = get_service_config(launcher.network_id, launcher.el_genesis_data,
config = get_config(launcher.network_id, launcher.el_genesis_data,
image, existing_el_clients, log_level, extra_params)
service = add_service(service_id, service_config)
service = add_service(service_id, config)
define_fact(service_id = service_id, fact_name = ENR_FACT_NAME, fact_recipe = struct(method= "POST", endpoint = "", field_extractor = ".result.enr", body = '{"method":"admin_nodeInfo","params":[],"id":1,"jsonrpc":"2.0"}', content_type = "application/json", port_id = RPC_PORT_ID))
enr = wait(service_id = service_id, fact_name = ENR_FACT_NAME)
......@@ -77,7 +77,7 @@ def launch(
)
def get_service_config(network_id, genesis_data, image, existing_el_clients, verbosity_level, extra_params):
def get_config(network_id, genesis_data, image, existing_el_clients, verbosity_level, extra_params):
network_id = network_id
genesis_json_filepath_on_client = path_join(GENESIS_DATA_MOUNT_DIRPATH, genesis_data.erigon_genesis_json_relative_filepath)
......@@ -125,10 +125,10 @@ def get_service_config(network_id, genesis_data, image, existing_el_clients, ver
command_arg_str = " && ".join(command_arg)
return struct(
container_image_name = image,
used_ports = USED_PORTS,
image = image,
ports = USED_PORTS,
cmd_args = [command_arg_str],
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_MOUNT_DIRPATH
},
entry_point_args = ENTRYPOINT_ARGS,
......
......@@ -68,10 +68,10 @@ def launch(
log_level = get_client_log_level_or_default(participant_log_level, global_log_level, VERBOSITY_LEVELS)
service_config = get_service_config(launcher.network_id, launcher.el_genesis_data, launcher.prefunded_geth_keys_artifact_uuid,
config = get_config(launcher.network_id, launcher.el_genesis_data, launcher.prefunded_geth_keys_artifact_uuid,
launcher.prefunded_account_info, image, existing_el_clients, log_level, extra_params)
service = add_service(service_id, service_config)
service = add_service(service_id, config)
define_fact(service_id = service_id, fact_name = ENR_FACT_NAME, fact_recipe = struct(method= "POST", endpoint = "", field_extractor = ".result.enr", body = '{"method":"admin_nodeInfo","params":[],"id":1,"jsonrpc":"2.0"}', content_type = "application/json", port_id = RPC_PORT_ID))
enr = wait(service_id = service_id, fact_name = ENR_FACT_NAME)
......@@ -89,7 +89,7 @@ def launch(
ENGINE_RPC_PORT_NUM
)
def get_service_config(network_id, genesis_data, prefunded_geth_keys_artifact_uuid, prefunded_account_info, image, existing_el_clients, verbosity_level, extra_params):
def get_config(network_id, genesis_data, prefunded_geth_keys_artifact_uuid, prefunded_account_info, image, existing_el_clients, verbosity_level, extra_params):
genesis_json_filepath_on_client = path_join(GENESIS_DATA_MOUNT_DIRPATH, genesis_data.geth_genesis_json_relative_filepath)
jwt_secret_json_filepath_on_client = path_join(GENESIS_DATA_MOUNT_DIRPATH, genesis_data.jwt_secret_relative_filepath)
......@@ -172,10 +172,10 @@ def get_service_config(network_id, genesis_data, prefunded_geth_keys_artifact_uu
command_str = " && ".join(subcommand_strs)
return struct(
container_image_name = image,
used_ports = USED_PORTS,
image = image,
ports = USED_PORTS,
cmd_args = [command_str],
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_MOUNT_DIRPATH,
prefunded_geth_keys_artifact_uuid: PREFUNDED_KEYS_MOUNT_DIRPATH
},
......
......@@ -53,9 +53,9 @@ def launch(
log_level = get_client_log_level_or_default(participant_log_level, global_log_level, NETHERMIND_LOG_LEVELS)
service_config = get_service_config(launcher.el_genesis_data, image, existing_el_clients, log_level, extra_params)
config = get_config(launcher.el_genesis_data, image, existing_el_clients, log_level, extra_params)
service = add_service(service_id, service_config)
service = add_service(service_id, config)
define_fact(service_id = service_id, fact_name = ENODE_FACT_NAME, fact_recipe = struct(method= "POST", endpoint = "", field_extractor = ".result.enode", body = '{"method":"admin_nodeInfo","params":[],"id":1,"jsonrpc":"2.0"}', content_type = "application/json", port_id = RPC_PORT_ID))
enode = wait(service_id = service_id, fact_name = ENODE_FACT_NAME)
......@@ -72,7 +72,7 @@ def launch(
)
def get_service_config(genesis_data, image, existing_el_clients, log_level, extra_params):
def get_config(genesis_data, image, existing_el_clients, log_level, extra_params):
if len(existing_el_clients) < 2:
fail("Nethermind node cannot be boot nodes, and due to a bug it requires two nodes to exist beforehand")
......@@ -116,10 +116,10 @@ def get_service_config(genesis_data, image, existing_el_clients, log_level, extr
command_args.extend([param for param in extra_params])
return struct(
container_image_name = image,
used_ports = USED_PORTS,
image = image,
ports = USED_PORTS,
cmd_args = command_args,
files_artifact_mount_dirpaths = {
files = {
genesis_data.files_artifact_uuid: GENESIS_DATA_MOUNT_DIRPATH
},
privaite_ip_address_placeholder = PRIVATE_IP_ADDRESS_PLACEHOLDER,
......
......@@ -16,14 +16,14 @@ NETWORK_ID_TO_NAME = {
}
def launch(mev_boost_launcher, service_id, network_id):
service_config = get_service_config(mev_boost_launcher, network_id)
config = get_config(mev_boost_launcher, network_id)
mev_boost_service = add_service(service_id, service_config)
mev_boost_service = add_service(service_id, config)
return new_mev_boost_context(mev_boost_service.ip_address, FLASHBOTS_MEV_BOOST_PORT)
def get_service_config(mev_boost_launcher, network_id):
def get_config(mev_boost_launcher, network_id):
network_name = NETWORK_ID_TO_NAME.get(network_id, "network-{0}".format(network_id))
command = ["mev-boost"]
......@@ -37,8 +37,8 @@ def get_service_config(mev_boost_launcher, network_id):
command.append(",".join(mev_boost_launcher.relay_end_points))
return struct(
container_image_name = FLASHBOTS_MEV_BOOST_IMAGE,
used_ports = USED_PORTS,
image = FLASHBOTS_MEV_BOOST_IMAGE,
ports = USED_PORTS,
cmd_args = command
)
......
......@@ -11,24 +11,24 @@ ENTRYPOINT_ARGS = [
# Launches a prelaunch data generator IMAGE, for use in various of the genesis generation
def launch_prelaunch_data_generator(files_artifact_mountpoints):
service_config = get_service_config(files_artifact_mountpoints)
config = get_config(files_artifact_mountpoints)
service_id = "{0}{1}".format(
SERVICE_ID_PREFIX,
time.now().unix_nano,
)
add_service(service_id, service_config)
add_service(service_id, config)
return service_id
def get_service_config(
def get_config(
files_artifact_mountpoints,
):
return struct(
# TODO remove this when used_ports is optional to pass
used_ports = {},
container_image_name = IMAGE,
# TODO remove this when ports is optional to pass
ports = {},
image = IMAGE,
entry_point_args = ENTRYPOINT_ARGS,
files_artifact_mount_dirpaths = files_artifact_mountpoints,
files = files_artifact_mountpoints,
)
......@@ -32,8 +32,8 @@ def launch_prometheus(config_template, cl_client_contexts):
config_files_artifact_uuid = render_templates(template_and_data_by_rel_dest_filepath)
service_config = get_service_config(config_files_artifact_uuid)
prometheus_service = add_service(SERVICE_ID, service_config)
config = get_config(config_files_artifact_uuid)
prometheus_service = add_service(SERVICE_ID, config)
private_ip_address = prometheus_service.ip_address
prometheus_service_http_port = prometheus_service.ports[HTTP_PORT_ID].number
......@@ -41,12 +41,12 @@ def launch_prometheus(config_template, cl_client_contexts):
return "http://{0}:{1}".format(private_ip_address, prometheus_service_http_port)
def get_service_config(config_files_artifact_uuid):
def get_config(config_files_artifact_uuid):
config_file_path = path_join(CONFIG_DIR_MOUNTPOINT_ON_PROMETHEUS, path_base(CONFIG_FILENAME))
return struct(
container_image_name = IMAGE_NAME,
used_ports = USED_PORTS,
files_artifact_mount_dirpaths = {
image = IMAGE_NAME,
ports = USED_PORTS,
files = {
config_files_artifact_uuid : CONFIG_DIR_MOUNTPOINT_ON_PROMETHEUS
},
cmd_args = [
......
......@@ -10,13 +10,13 @@ SYNCHRONOUS_ENTRYPOINT_ARGS = [
# this is broken check - https://github.com/ethereum/merge-testnet-verifier/issues/4
def launch_testnet_verifier(params, el_client_contexts, cl_client_contexts):
service_config = get_asynchronous_verification_service_config(params, el_client_contexts, cl_client_contexts)
add_service(SERVICE_ID, service_config)
config = get_asynchronous_verification_config(params, el_client_contexts, cl_client_contexts)
add_service(SERVICE_ID, config)
def run_synchronous_testnet_verification(params, el_client_contexts, cl_client_contexts):
service_config = get_synchronous_verification_service_config()
add_service(SERVICE_ID, service_config)
config = get_synchronous_verification_config()
add_service(SERVICE_ID, config)
command = get_cmd(params, el_client_contexts, cl_client_contexts, True)
exec(SERVICE_ID, command)
......@@ -49,20 +49,20 @@ def get_cmd(params, el_client_contexts, cl_client_contexts, add_binary_name):
def get_asynchronous_verification_service_config(params, el_client_contexts, cl_client_contexts):
def get_asynchronous_verification_config(params, el_client_contexts, cl_client_contexts):
commands = get_cmd(params, el_client_contexts, cl_client_contexts, False)
return struct(
container_image_name = IMAGE_NAME,
image = IMAGE_NAME,
cmd_args = commands,
# TODO remove this when used_ports is optional in add_service
used_ports = {},
# TODO remove this when ports is optional in add_service
ports = {},
)
def get_synchronous_verification_service_config():
def get_synchronous_verification_config():
return struct(
container_image_name = IMAGE_NAME,
image = IMAGE_NAME,
entry_point_args = SYNCHRONOUS_ENTRYPOINT_ARGS,
# TODO remove this when used_ports is optional in add_service
used_ports = {},
# TODO remove this when ports is optional in add_service
ports = {},
)
......@@ -2,11 +2,11 @@ IMAGE_NAME = "kurtosistech/tx-fuzz:0.2.0"
SERVICE_ID = "transaction-spammer"
def launch_transaction_spammer(prefunded_addresses, el_client_context):
service_config = get_service_config(prefunded_addresses, el_client_context)
add_service(SERVICE_ID, service_config)
config = get_config(prefunded_addresses, el_client_context)
add_service(SERVICE_ID, config)
def get_service_config(prefunded_addresses, el_client_context):
def get_config(prefunded_addresses, el_client_context):
private_keys_strs = []
address_strs = []
......@@ -17,13 +17,13 @@ def get_service_config(prefunded_addresses, el_client_context):
comma_separated_private_keys = ",".join(private_keys_strs)
comma_separated_addresses = ",".join(address_strs)
return struct(
container_image_name = IMAGE_NAME,
image = IMAGE_NAME,
cmd_args = [
"http://{0}:{1}".format(el_client_context.ip_addr, el_client_context.rpc_port_num),
"spam",
comma_separated_private_keys,
comma_separated_addresses
],
used_ports = {}
ports = {}
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment