Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ethereum-package
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
ethereum-package
Commits
968f0734
Unverified
Commit
968f0734
authored
Jan 10, 2023
by
Gyanendra Mishra
Committed by
GitHub
Jan 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: use named artifacts (#69)
Closes #70
parent
094352d6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
28 deletions
+28
-28
forkmon_launcher.star
src/forkmon/forkmon_launcher.star
+4
-4
grafana_launcher.star
src/grafana/grafana_launcher.star
+6
-6
participant_network.star
src/participant_network/participant_network.star
+2
-2
cl_genesis_data_generator.star
..._data_generator/cl_genesis/cl_genesis_data_generator.star
+4
-4
cl_validator_keystore_generator.star
..._validator_keystores/cl_validator_keystore_generator.star
+4
-4
el_genesis_data_generator.star
..._data_generator/el_genesis/el_genesis_data_generator.star
+4
-4
prometheus_launcher.star
src/prometheus/prometheus_launcher.star
+4
-4
No files found.
src/forkmon/forkmon_launcher.star
View file @
968f0734
...
@@ -36,20 +36,20 @@ def launch_forkmon(
...
@@ -36,20 +36,20 @@ def launch_forkmon(
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath[FORKMON_CONFIG_FILENAME] = template_and_data
template_and_data_by_rel_dest_filepath[FORKMON_CONFIG_FILENAME] = template_and_data
config_files_artifact_
uuid = plan.render_templates(template_and_data_by_rel_dest_filepath
)
config_files_artifact_
name = plan.render_templates(template_and_data_by_rel_dest_filepath, "forkmon-config"
)
config = get_config(config_files_artifact_
uuid
)
config = get_config(config_files_artifact_
name
)
plan.add_service(SERVICE_ID, config)
plan.add_service(SERVICE_ID, config)
def get_config(config_files_artifact_
uuid
):
def get_config(config_files_artifact_
name
):
config_file_path = shared_utils.path_join(FORKMON_CONFIG_MOUNT_DIRPATH_ON_SERVICE, FORKMON_CONFIG_FILENAME)
config_file_path = shared_utils.path_join(FORKMON_CONFIG_MOUNT_DIRPATH_ON_SERVICE, FORKMON_CONFIG_FILENAME)
return ServiceConfig(
return ServiceConfig(
image = IMAGE_NAME,
image = IMAGE_NAME,
ports = USED_PORTS,
ports = USED_PORTS,
files = {
files = {
FORKMON_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_
uuid
,
FORKMON_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_
name
,
},
},
cmd = ["--config-path", config_file_path]
cmd = ["--config-path", config_file_path]
)
)
...
...
src/grafana/grafana_launcher.star
View file @
968f0734
...
@@ -44,21 +44,21 @@ def get_grafana_config_dir_artifact_uuid(plan, datasource_config_template, dashb
...
@@ -44,21 +44,21 @@ def get_grafana_config_dir_artifact_uuid(plan, datasource_config_template, dashb
template_and_data_by_rel_dest_filepath[DATASOURCE_CONFIG_REL_FILEPATH] = datasource_template_and_data
template_and_data_by_rel_dest_filepath[DATASOURCE_CONFIG_REL_FILEPATH] = datasource_template_and_data
template_and_data_by_rel_dest_filepath[DASHBOARD_PROVIDERS_CONFIG_REL_FILEPATH] = dashboard_providers_template_and_data
template_and_data_by_rel_dest_filepath[DASHBOARD_PROVIDERS_CONFIG_REL_FILEPATH] = dashboard_providers_template_and_data
grafana_config_artifacts_
uuid = plan.render_templates(template_and_data_by_rel_dest_filepath
)
grafana_config_artifacts_
name = plan.render_templates(template_and_data_by_rel_dest_filepath, name="grafana-config"
)
grafana_dashboards_artifacts_
uuid = plan.upload_files(static_files.GRAFANA_DASHBOARDS_CONFIG_DIRPATH
)
grafana_dashboards_artifacts_
name = plan.upload_files(static_files.GRAFANA_DASHBOARDS_CONFIG_DIRPATH, name="grafana-dashboards"
)
return grafana_config_artifacts_
uuid, grafana_dashboards_artifacts_uuid
return grafana_config_artifacts_
name, grafana_dashboards_artifacts_name
def get_config(grafana_config_artifacts_
uuid, grafana_dashboards_artifacts_uuid
):
def get_config(grafana_config_artifacts_
name, grafana_dashboards_artifacts_name
):
return ServiceConfig(
return ServiceConfig(
image = IMAGE_NAME,
image = IMAGE_NAME,
ports = USED_PORTS,
ports = USED_PORTS,
env_vars = {CONFIG_DIRPATH_ENV_VAR: GRAFANA_CONFIG_DIRPATH_ON_SERVICE},
env_vars = {CONFIG_DIRPATH_ENV_VAR: GRAFANA_CONFIG_DIRPATH_ON_SERVICE},
files = {
files = {
GRAFANA_CONFIG_DIRPATH_ON_SERVICE: grafana_config_artifacts_
uuid
,
GRAFANA_CONFIG_DIRPATH_ON_SERVICE: grafana_config_artifacts_
name
,
GRAFANA_DASHBOARDS_DIRPATH_ON_SERVICE: grafana_dashboards_artifacts_
uuid
GRAFANA_DASHBOARDS_DIRPATH_ON_SERVICE: grafana_dashboards_artifacts_
name
}
}
)
)
...
...
src/participant_network/participant_network.star
View file @
968f0734
...
@@ -76,12 +76,12 @@ def launch_participant_network(plan, participants, network_params, global_log_le
...
@@ -76,12 +76,12 @@ def launch_participant_network(plan, participants, network_params, global_log_le
plan.print("Uploading GETH prefunded keys")
plan.print("Uploading GETH prefunded keys")
geth_prefunded_keys_artifact_
id = plan.upload_files(static_files.GETH_PREFUNDED_KEYS_DIRPATH
)
geth_prefunded_keys_artifact_
name = plan.upload_files(static_files.GETH_PREFUNDED_KEYS_DIRPATH, name="geth-prefunded-keys"
)
plan.print("Uploaded GETH files succesfully, launching EL participants")
plan.print("Uploaded GETH files succesfully, launching EL participants")
el_launchers = {
el_launchers = {
package_io.EL_CLIENT_TYPE.geth : {"launcher": geth.new_geth_launcher(network_params.network_id, el_genesis_data, geth_prefunded_keys_artifact_
id
, genesis_constants.PRE_FUNDED_ACCOUNTS), "launch_method": geth.launch},
package_io.EL_CLIENT_TYPE.geth : {"launcher": geth.new_geth_launcher(network_params.network_id, el_genesis_data, geth_prefunded_keys_artifact_
name
, genesis_constants.PRE_FUNDED_ACCOUNTS), "launch_method": geth.launch},
package_io.EL_CLIENT_TYPE.besu : {"launcher": besu.new_besu_launcher(network_params.network_id, el_genesis_data), "launch_method": besu.launch},
package_io.EL_CLIENT_TYPE.besu : {"launcher": besu.new_besu_launcher(network_params.network_id, el_genesis_data), "launch_method": besu.launch},
package_io.EL_CLIENT_TYPE.erigon : {"launcher": erigon.new_erigon_launcher(network_params.network_id, el_genesis_data), "launch_method": erigon.launch},
package_io.EL_CLIENT_TYPE.erigon : {"launcher": erigon.new_erigon_launcher(network_params.network_id, el_genesis_data), "launch_method": erigon.launch},
package_io.EL_CLIENT_TYPE.nethermind : {"launcher": nethermind.new_nethermind_launcher(el_genesis_data), "launch_method": nethermind.launch},
package_io.EL_CLIENT_TYPE.nethermind : {"launcher": nethermind.new_nethermind_launcher(el_genesis_data), "launch_method": nethermind.launch},
...
...
src/participant_network/prelaunch_data_generator/cl_genesis/cl_genesis_data_generator.star
View file @
968f0734
...
@@ -56,13 +56,13 @@ def generate_cl_genesis_data(
...
@@ -56,13 +56,13 @@ def generate_cl_genesis_data(
template_and_data_by_rel_dest_filepath[MNEMONICS_YML_FILENAME] = genesis_generation_mnemonics_template_and_data
template_and_data_by_rel_dest_filepath[MNEMONICS_YML_FILENAME] = genesis_generation_mnemonics_template_and_data
template_and_data_by_rel_dest_filepath[GENESIS_CONFIG_YML_FILENAME] = genesis_generation_config_template_and_data
template_and_data_by_rel_dest_filepath[GENESIS_CONFIG_YML_FILENAME] = genesis_generation_config_template_and_data
genesis_generation_config_artifact_
uuid = plan.render_templates(template_and_data_by_rel_dest_filepath
)
genesis_generation_config_artifact_
name = plan.render_templates(template_and_data_by_rel_dest_filepath, "genesis-generation-config-cl"
)
# TODO(old) Make this the actual data generator - comment copied from the original module
# TODO(old) Make this the actual data generator - comment copied from the original module
launcher_service_id = prelaunch_data_generator_launcher.launch_prelaunch_data_generator(
launcher_service_id = prelaunch_data_generator_launcher.launch_prelaunch_data_generator(
plan,
plan,
{
{
CONFIG_DIRPATH_ON_GENERATOR: genesis_generation_config_artifact_
uuid
,
CONFIG_DIRPATH_ON_GENERATOR: genesis_generation_config_artifact_
name
,
EL_GENESIS_DIRPATH_ON_GENERATOR: el_genesis_data.files_artifact_uuid,
EL_GENESIS_DIRPATH_ON_GENERATOR: el_genesis_data.files_artifact_uuid,
},
},
)
)
...
@@ -135,7 +135,7 @@ def generate_cl_genesis_data(
...
@@ -135,7 +135,7 @@ def generate_cl_genesis_data(
genesis_generation_result = plan.exec(struct(service_id=launcher_service_id, command=cl_genesis_generation_cmd))
genesis_generation_result = plan.exec(struct(service_id=launcher_service_id, command=cl_genesis_generation_cmd))
plan.assert(genesis_generation_result["code"], "==", SUCCESSFUL_EXEC_CMD_EXIT_CODE)
plan.assert(genesis_generation_result["code"], "==", SUCCESSFUL_EXEC_CMD_EXIT_CODE)
cl_genesis_data_artifact_
uuid = plan.store_service_files(launcher_service_id, OUTPUT_DIRPATH_ON_GENERATOR
)
cl_genesis_data_artifact_
name = plan.store_service_files(launcher_service_id, OUTPUT_DIRPATH_ON_GENERATOR, name = "cl-genesis-data"
)
jwt_secret_rel_filepath = shared_utils.path_join(
jwt_secret_rel_filepath = shared_utils.path_join(
shared_utils.path_base(OUTPUT_DIRPATH_ON_GENERATOR),
shared_utils.path_base(OUTPUT_DIRPATH_ON_GENERATOR),
...
@@ -150,7 +150,7 @@ def generate_cl_genesis_data(
...
@@ -150,7 +150,7 @@ def generate_cl_genesis_data(
GENESIS_STATE_FILENAME,
GENESIS_STATE_FILENAME,
)
)
result = cl_genesis_data.new_cl_genesis_data(
result = cl_genesis_data.new_cl_genesis_data(
cl_genesis_data_artifact_
uuid
,
cl_genesis_data_artifact_
name
,
jwt_secret_rel_filepath,
jwt_secret_rel_filepath,
genesis_config_rel_filepath,
genesis_config_rel_filepath,
genesis_ssz_rel_filepath,
genesis_ssz_rel_filepath,
...
...
src/participant_network/prelaunch_data_generator/cl_validator_keystores/cl_validator_keystore_generator.star
View file @
968f0734
...
@@ -72,12 +72,12 @@ def generate_cl_validator_keystores(
...
@@ -72,12 +72,12 @@ def generate_cl_validator_keystores(
# Store outputs into files artifacts
# Store outputs into files artifacts
keystore_files = []
keystore_files = []
for idx, output_dirpath in enumerate(all_output_dirpaths):
for idx, output_dirpath in enumerate(all_output_dirpaths):
artifact_
uuid = plan.store_service_files(service_id, output_dirpath
)
artifact_
name = plan.store_service_files(service_id, output_dirpath, name = "validator-keystore-" + str(idx)
)
# This is necessary because the way Kurtosis currently implements artifact-storing is
# This is necessary because the way Kurtosis currently implements artifact-storing is
base_dirname_in_artifact = shared_utils.path_base(output_dirpath)
base_dirname_in_artifact = shared_utils.path_base(output_dirpath)
to_add = keystore_files_module.new_keystore_files(
to_add = keystore_files_module.new_keystore_files(
artifact_
uuid
,
artifact_
name
,
shared_utils.path_join(base_dirname_in_artifact, RAW_KEYS_DIRNAME),
shared_utils.path_join(base_dirname_in_artifact, RAW_KEYS_DIRNAME),
shared_utils.path_join(base_dirname_in_artifact, RAW_SECRETS_DIRNAME),
shared_utils.path_join(base_dirname_in_artifact, RAW_SECRETS_DIRNAME),
shared_utils.path_join(base_dirname_in_artifact, NIMBUS_KEYS_DIRNAME),
shared_utils.path_join(base_dirname_in_artifact, NIMBUS_KEYS_DIRNAME),
...
@@ -100,10 +100,10 @@ def generate_cl_validator_keystores(
...
@@ -100,10 +100,10 @@ def generate_cl_validator_keystores(
write_prysm_password_file_cmd_result = plan.exec(struct(service_id=service_id, command=write_prysm_password_file_cmd))
write_prysm_password_file_cmd_result = plan.exec(struct(service_id=service_id, command=write_prysm_password_file_cmd))
plan.assert(write_prysm_password_file_cmd_result["code"], "==", SUCCESSFUL_EXEC_CMD_EXIT_CODE)
plan.assert(write_prysm_password_file_cmd_result["code"], "==", SUCCESSFUL_EXEC_CMD_EXIT_CODE)
prysm_password_artifact_
uuid = plan.store_service_files(service_id, PRYSM_PASSWORD_FILEPATH_ON_GENERATOR
)
prysm_password_artifact_
name = plan.store_service_files(service_id, PRYSM_PASSWORD_FILEPATH_ON_GENERATOR, name = "prysm-password"
)
result = keystores_result.new_generate_keystores_result(
result = keystores_result.new_generate_keystores_result(
prysm_password_artifact_
uuid
,
prysm_password_artifact_
name
,
shared_utils.path_base(PRYSM_PASSWORD_FILEPATH_ON_GENERATOR),
shared_utils.path_base(PRYSM_PASSWORD_FILEPATH_ON_GENERATOR),
keystore_files,
keystore_files,
)
)
...
...
src/participant_network/prelaunch_data_generator/el_genesis/el_genesis_data_generator.star
View file @
968f0734
...
@@ -48,14 +48,14 @@ def generate_el_genesis_data(
...
@@ -48,14 +48,14 @@ def generate_el_genesis_data(
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath[GENESIS_CONFIG_FILENAME] = genesis_config_file_template_and_data
template_and_data_by_rel_dest_filepath[GENESIS_CONFIG_FILENAME] = genesis_config_file_template_and_data
genesis_generation_config_artifact_
uuid = plan.render_templates(template_and_data_by_rel_dest_filepath
)
genesis_generation_config_artifact_
name = plan.render_templates(template_and_data_by_rel_dest_filepath, name="genesis-generation-config-el"
)
# TODO(old) Make this the actual data generator - comment copied from the original module
# TODO(old) Make this the actual data generator - comment copied from the original module
launcher_service_id = prelaunch_data_generator_launcher.launch_prelaunch_data_generator(
launcher_service_id = prelaunch_data_generator_launcher.launch_prelaunch_data_generator(
plan,
plan,
{
{
CONFIG_DIRPATH_ON_GENERATOR: genesis_generation_config_artifact_
uuid
,
CONFIG_DIRPATH_ON_GENERATOR: genesis_generation_config_artifact_
name
,
},
},
)
)
...
@@ -118,10 +118,10 @@ def generate_el_genesis_data(
...
@@ -118,10 +118,10 @@ def generate_el_genesis_data(
jwt_secret_generation_cmd_result = plan.exec(struct(service_id=launcher_service_id, command=jwt_secret_generation_cmd))
jwt_secret_generation_cmd_result = plan.exec(struct(service_id=launcher_service_id, command=jwt_secret_generation_cmd))
plan.assert(jwt_secret_generation_cmd_result["code"], "==", SUCCESSFUL_EXEC_CMD_EXIT_CODE)
plan.assert(jwt_secret_generation_cmd_result["code"], "==", SUCCESSFUL_EXEC_CMD_EXIT_CODE)
el
GenesisDataArtifactUuid = plan.store_service_files(launcher_service_id, OUTPUT_DIRPATH_ON_GENERATOR
)
el
_genesis_data_artifact_name = plan.store_service_files(launcher_service_id, OUTPUT_DIRPATH_ON_GENERATOR, name = "el-genesis-data"
)
result = el_genesis.new_el_genesis_data(
result = el_genesis.new_el_genesis_data(
el
GenesisDataArtifactUuid
,
el
_genesis_data_artifact_name
,
shared_utils.path_join(shared_utils.path_base(OUTPUT_DIRPATH_ON_GENERATOR), JWT_SECRET_FILENAME),
shared_utils.path_join(shared_utils.path_base(OUTPUT_DIRPATH_ON_GENERATOR), JWT_SECRET_FILENAME),
genesis_filename_to_relative_filepath_in_artifact[GETH_GENESIS_FILENAME],
genesis_filename_to_relative_filepath_in_artifact[GETH_GENESIS_FILENAME],
genesis_filename_to_relative_filepath_in_artifact[ERIGON_GENESIS_FILENAME],
genesis_filename_to_relative_filepath_in_artifact[ERIGON_GENESIS_FILENAME],
...
...
src/prometheus/prometheus_launcher.star
View file @
968f0734
...
@@ -25,9 +25,9 @@ def launch_prometheus(plan, config_template, cl_client_contexts):
...
@@ -25,9 +25,9 @@ def launch_prometheus(plan, config_template, cl_client_contexts):
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath[CONFIG_FILENAME] = template_and_data
template_and_data_by_rel_dest_filepath[CONFIG_FILENAME] = template_and_data
config_files_artifact_
uuid = plan.render_templates(template_and_data_by_rel_dest_filepath
)
config_files_artifact_
name = plan.render_templates(template_and_data_by_rel_dest_filepath, "prometheus-config"
)
config = get_config(config_files_artifact_
uuid
)
config = get_config(config_files_artifact_
name
)
prometheus_service = plan.add_service(SERVICE_ID, config)
prometheus_service = plan.add_service(SERVICE_ID, config)
private_ip_address = prometheus_service.ip_address
private_ip_address = prometheus_service.ip_address
...
@@ -36,13 +36,13 @@ def launch_prometheus(plan, config_template, cl_client_contexts):
...
@@ -36,13 +36,13 @@ def launch_prometheus(plan, config_template, cl_client_contexts):
return "http://{0}:{1}".format(private_ip_address, prometheus_service_http_port)
return "http://{0}:{1}".format(private_ip_address, prometheus_service_http_port)
def get_config(config_files_artifact_
uuid
):
def get_config(config_files_artifact_
name
):
config_file_path = shared_utils.path_join(CONFIG_DIR_MOUNTPOINT_ON_PROMETHEUS, shared_utils.path_base(CONFIG_FILENAME))
config_file_path = shared_utils.path_join(CONFIG_DIR_MOUNTPOINT_ON_PROMETHEUS, shared_utils.path_base(CONFIG_FILENAME))
return ServiceConfig(
return ServiceConfig(
image = IMAGE_NAME,
image = IMAGE_NAME,
ports = USED_PORTS,
ports = USED_PORTS,
files = {
files = {
CONFIG_DIR_MOUNTPOINT_ON_PROMETHEUS: config_files_artifact_
uuid
CONFIG_DIR_MOUNTPOINT_ON_PROMETHEUS: config_files_artifact_
name
},
},
cmd = [
cmd = [
# You can check all the cli flags starting the container and going to the flags section
# You can check all the cli flags starting the container and going to the flags section
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment