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
82ec85e8
Unverified
Commit
82ec85e8
authored
Nov 29, 2023
by
Barnabas Busa
Committed by
GitHub
Nov 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add custom label configuration option (#375)
parent
32f862be
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
100 additions
and
10 deletions
+100
-10
README.md
README.md
+12
-0
network_params.yaml
network_params.yaml
+3
-0
lighthouse_launcher.star
src/cl/lighthouse/lighthouse_launcher.star
+8
-0
lodestar_launcher.star
src/cl/lodestar/lodestar_launcher.star
+8
-0
nimbus_launcher.star
src/cl/nimbus/nimbus_launcher.star
+7
-0
prysm_launcher.star
src/cl/prysm/prysm_launcher.star
+8
-0
teku_launcher.star
src/cl/teku/teku_launcher.star
+7
-0
besu_launcher.star
src/el/besu/besu_launcher.star
+4
-0
erigon_launcher.star
src/el/erigon/erigon_launcher.star
+4
-0
ethereumjs_launcher.star
src/el/ethereumjs/ethereumjs_launcher.star
+4
-0
geth_launcher.star
src/el/geth/geth_launcher.star
+4
-0
nethermind_launcher.star
src/el/nethermind/nethermind_launcher.star
+4
-0
reth_launcher.star
src/el/reth/reth_launcher.star
+4
-0
input_parser.star
src/package_io/input_parser.star
+10
-4
participant_network.star
src/participant_network.star
+5
-0
shared_utils.star
src/shared_utils/shared_utils.star
+8
-6
No files found.
README.md
View file @
82ec85e8
...
...
@@ -123,6 +123,10 @@ participants:
# A list of optional extra env_vars the el container should spin up with
el_extra_env_vars
:
{}
# A list of optional extra labels the el container should spin up with
# Example; el_extra_labels: {"ethereum-package.partition": "1"}
el_extra_labels
:
{}
# The type of CL client that should be started
# Valid values are nimbus, lighthouse, lodestar, teku, and prysm
cl_client_type
:
lighthouse
...
...
@@ -147,10 +151,18 @@ participants:
# If the client combines the Beacon & validator nodes (e.g. Teku, Nimbus), then this list will be passed to the combined Beacon-validator node
beacon_extra_params
:
[]
# A list of optional extra labels that will be passed to the CL client Beacon container.
# Example; beacon_extra_labels: {"ethereum-package.partition": "1"}
beacon_extra_labels
:
{}
# A list of optional extra params that will be passed to the CL client validator container for modifying its behaviour
# If the client combines the Beacon & validator nodes (e.g. Teku, Nimbus), then this list will also be passed to the combined Beacon-validator node
validator_extra_params
:
[]
# A list of optional extra labels that will be passed to the CL client validator container.
# Example; validator_extra_labels: {"ethereum-package.partition": "1"}
validator_extra_labels
:
{}
# A set of parameters the node needs to reach an external block building network
# If `null` then the builder infrastructure will not be instantiated
# Example:
...
...
network_params.yaml
View file @
82ec85e8
...
...
@@ -3,11 +3,14 @@ participants:
el_client_image
:
ethereum/client-go:latest
el_client_log_level
:
"
"
el_extra_params
:
[]
el_extra_labels
:
{}
cl_client_type
:
lighthouse
cl_client_image
:
sigp/lighthouse:latest
cl_client_log_level
:
"
"
beacon_extra_params
:
[]
beacon_extra_labels
:
{}
validator_extra_params
:
[]
validator_extra_labels
:
{}
builder_network_params
:
null
validator_count
:
null
snooper_enabled
:
false
...
...
src/cl/lighthouse/lighthouse_launcher.star
View file @
82ec85e8
...
...
@@ -115,6 +115,8 @@ def launch(
snooper_engine_context,
extra_beacon_params,
extra_validator_params,
extra_beacon_labels,
extra_validator_labels,
):
beacon_node_service_name = "{0}".format(service_name)
validator_node_service_name = "{0}-{1}".format(
...
...
@@ -144,6 +146,7 @@ def launch(
snooper_enabled,
snooper_engine_context,
extra_beacon_params,
extra_beacon_labels,
)
beacon_service = plan.add_service(beacon_node_service_name, beacon_config)
...
...
@@ -172,6 +175,7 @@ def launch(
v_min_mem,
v_max_mem,
extra_validator_params,
extra_validator_labels,
)
validator_service = plan.add_service(
...
...
@@ -242,6 +246,7 @@ def get_beacon_config(
snooper_enabled,
snooper_engine_context,
extra_params,
extra_labels,
):
# If snooper is enabled use the snooper engine context, otherwise use the execution client context
if snooper_enabled:
...
...
@@ -347,6 +352,7 @@ def get_beacon_config(
constants.CLIENT_TYPES.cl,
image,
el_client_context.client_name,
extra_labels,
),
)
...
...
@@ -363,6 +369,7 @@ def get_validator_config(
v_min_mem,
v_max_mem,
extra_params,
extra_labels,
):
validator_keys_dirpath = shared_utils.path_join(
VALIDATOR_KEYS_MOUNTPOINT_ON_CLIENTS,
...
...
@@ -420,6 +427,7 @@ def get_validator_config(
constants.CLIENT_TYPES.validator,
image,
el_client_context.client_name,
extra_labels,
),
)
...
...
src/cl/lodestar/lodestar_launcher.star
View file @
82ec85e8
...
...
@@ -91,6 +91,8 @@ def launch(
snooper_engine_context,
extra_beacon_params,
extra_validator_params,
extra_beacon_labels,
extra_validator_labels,
):
beacon_node_service_name = "{0}".format(service_name)
validator_node_service_name = "{0}-{1}".format(
...
...
@@ -119,6 +121,7 @@ def launch(
snooper_enabled,
snooper_engine_context,
extra_beacon_params,
extra_beacon_labels,
)
beacon_service = plan.add_service(beacon_node_service_name, beacon_config)
...
...
@@ -148,6 +151,7 @@ def launch(
v_min_mem,
v_max_mem,
extra_validator_params,
extra_validator_labels,
)
plan.add_service(validator_node_service_name, validator_config)
...
...
@@ -208,6 +212,7 @@ def get_beacon_config(
snooper_enabled,
snooper_engine_context,
extra_params,
extra_labels,
):
el_client_rpc_url_str = "http://{0}:{1}".format(
el_client_context.ip_addr,
...
...
@@ -292,6 +297,7 @@ def get_beacon_config(
constants.CLIENT_TYPES.cl,
image,
el_client_context.client_name,
extra_labels,
),
)
...
...
@@ -309,6 +315,7 @@ def get_validator_config(
v_min_mem,
v_max_mem,
extra_params,
extra_labels,
):
root_dirpath = shared_utils.path_join(
CONSENSUS_DATA_DIRPATH_ON_SERVICE_CONTAINER, service_name
...
...
@@ -364,6 +371,7 @@ def get_validator_config(
constants.CLIENT_TYPES.validator,
image,
el_client_context.client_name,
extra_labels,
),
)
...
...
src/cl/nimbus/nimbus_launcher.star
View file @
82ec85e8
...
...
@@ -93,6 +93,8 @@ def launch(
snooper_engine_context,
extra_beacon_params,
extra_validator_params,
extra_beacon_labels,
extra_validator_labels,
):
log_level = input_parser.get_client_log_level_or_default(
participant_log_level, global_log_level, NIMBUS_LOG_LEVELS
...
...
@@ -113,6 +115,8 @@ def launch(
bn_min_mem = int(v_min_mem) if (int(v_min_mem) > bn_min_mem) else bn_min_mem
bn_max_mem = int(v_max_mem) if (int(v_max_mem) > bn_max_mem) else bn_max_mem
extra_labels = extra_beacon_labels | extra_validator_labels
config = get_config(
launcher.el_cl_genesis_data,
image,
...
...
@@ -127,6 +131,7 @@ def launch(
snooper_enabled,
snooper_engine_context,
extra_params,
extra_labels,
)
nimbus_service = plan.add_service(service_name, config)
...
...
@@ -181,6 +186,7 @@ def get_config(
snooper_enabled,
snooper_engine_context,
extra_params,
extra_labels,
):
# If snooper is enabled use the snooper engine context, otherwise use the execution client context
if snooper_enabled:
...
...
@@ -320,6 +326,7 @@ def get_config(
constants.CLIENT_TYPES.cl,
image,
el_client_context.client_name,
extra_labels,
),
)
...
...
src/cl/prysm/prysm_launcher.star
View file @
82ec85e8
...
...
@@ -104,6 +104,8 @@ def launch(
snooper_engine_context,
extra_beacon_params,
extra_validator_params,
extra_beacon_labels,
extra_validator_labels,
):
split_images = images.split(IMAGE_SEPARATOR_DELIMITER)
if len(split_images) != EXPECTED_NUM_IMAGES:
...
...
@@ -146,6 +148,7 @@ def launch(
snooper_enabled,
snooper_engine_context,
extra_beacon_params,
extra_beacon_labels,
)
beacon_service = plan.add_service(beacon_node_service_name, beacon_config)
...
...
@@ -176,6 +179,7 @@ def launch(
v_min_mem,
v_max_mem,
extra_validator_params,
extra_validator_labels,
launcher.prysm_password_relative_filepath,
launcher.prysm_password_artifact_uuid,
)
...
...
@@ -248,6 +252,7 @@ def get_beacon_config(
snooper_enabled,
snooper_engine_context,
extra_params,
extra_labels,
):
# If snooper is enabled use the snooper engine context, otherwise use the execution client context
if snooper_enabled:
...
...
@@ -321,6 +326,7 @@ def get_beacon_config(
constants.CLIENT_TYPES.cl,
beacon_image,
el_client_context.client_name,
extra_labels,
),
)
...
...
@@ -339,6 +345,7 @@ def get_validator_config(
v_min_mem,
v_max_mem,
extra_params,
extra_labels,
prysm_password_relative_filepath,
prysm_password_artifact_uuid,
):
...
...
@@ -395,6 +402,7 @@ def get_validator_config(
constants.CLIENT_TYPES.validator,
validator_image,
el_client_context.client_name,
extra_labels,
),
)
...
...
src/cl/teku/teku_launcher.star
View file @
82ec85e8
...
...
@@ -95,6 +95,8 @@ def launch(
snooper_engine_context,
extra_beacon_params,
extra_validator_params,
extra_beacon_labels,
extra_validator_labels,
):
log_level = input_parser.get_client_log_level_or_default(
participant_log_level, global_log_level, TEKU_LOG_LEVELS
...
...
@@ -115,6 +117,8 @@ def launch(
bn_min_mem = int(v_min_mem) if (int(v_min_mem) > bn_min_mem) else bn_min_mem
bn_max_mem = int(v_max_mem) if (int(v_max_mem) > bn_max_mem) else bn_max_mem
extra_labels = extra_beacon_labels | extra_validator_labels
config = get_config(
launcher.el_cl_genesis_data,
image,
...
...
@@ -129,6 +133,7 @@ def launch(
snooper_enabled,
snooper_engine_context,
extra_params,
extra_labels,
)
teku_service = plan.add_service(service_name, config)
...
...
@@ -185,6 +190,7 @@ def get_config(
snooper_enabled,
snooper_engine_context,
extra_params,
extra_labels,
):
# If snooper is enabled use the snooper engine context, otherwise use the execution client context
if snooper_enabled:
...
...
@@ -325,6 +331,7 @@ def get_config(
constants.CLIENT_TYPES.cl,
image,
el_client_context.client_name,
extra_labels,
),
)
...
...
src/el/besu/besu_launcher.star
View file @
82ec85e8
...
...
@@ -74,6 +74,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
):
log_level = input_parser.get_client_log_level_or_default(
participant_log_level, global_log_level, BESU_LOG_LEVELS
...
...
@@ -99,6 +100,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
)
service = plan.add_service(service_name, config)
...
...
@@ -136,6 +138,7 @@ def get_config(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
):
cmd = [
"besu",
...
...
@@ -207,6 +210,7 @@ def get_config(
constants.CLIENT_TYPES.el,
image,
cl_client_name,
extra_labels,
),
)
...
...
src/el/erigon/erigon_launcher.star
View file @
82ec85e8
...
...
@@ -75,6 +75,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
):
log_level = input_parser.get_client_log_level_or_default(
participant_log_level, global_log_level, ERIGON_LOG_LEVELS
...
...
@@ -100,6 +101,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
)
service = plan.add_service(service_name, config)
...
...
@@ -139,6 +141,7 @@ def get_config(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
):
network_id = network_id
...
...
@@ -218,6 +221,7 @@ def get_config(
constants.CLIENT_TYPES.el,
image,
cl_client_name,
extra_labels,
),
)
...
...
src/el/ethereumjs/ethereumjs_launcher.star
View file @
82ec85e8
...
...
@@ -79,6 +79,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
):
log_level = input_parser.get_client_log_level_or_default(
participant_log_level, global_log_level, VERBOSITY_LEVELS
...
...
@@ -103,6 +104,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
)
service = plan.add_service(service_name, config)
...
...
@@ -138,6 +140,7 @@ def get_config(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
):
cmd = [
"--gethGenesis="
...
...
@@ -198,6 +201,7 @@ def get_config(
constants.CLIENT_TYPES.el,
image,
cl_client_name,
extra_labels,
),
)
...
...
src/el/geth/geth_launcher.star
View file @
82ec85e8
...
...
@@ -85,6 +85,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
):
log_level = input_parser.get_client_log_level_or_default(
participant_log_level, global_log_level, VERBOSITY_LEVELS
...
...
@@ -109,6 +110,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
launcher.capella_fork_epoch,
launcher.electra_fork_epoch,
launcher.final_genesis_timestamp,
...
...
@@ -151,6 +153,7 @@ def get_config(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
capella_fork_epoch,
electra_fork_epoch,
final_genesis_timestamp,
...
...
@@ -271,6 +274,7 @@ def get_config(
constants.CLIENT_TYPES.el,
image,
cl_client_name,
extra_labels,
),
)
...
...
src/el/nethermind/nethermind_launcher.star
View file @
82ec85e8
...
...
@@ -73,6 +73,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
):
log_level = input_parser.get_client_log_level_or_default(
participant_log_level, global_log_level, NETHERMIND_LOG_LEVELS
...
...
@@ -97,6 +98,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
)
service = plan.add_service(service_name, config)
...
...
@@ -134,6 +136,7 @@ def get_config(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
):
cmd = [
"--log=" + log_level,
...
...
@@ -193,6 +196,7 @@ def get_config(
constants.CLIENT_TYPES.el,
image,
cl_client_name,
extra_labels,
),
)
...
...
src/el/reth/reth_launcher.star
View file @
82ec85e8
...
...
@@ -77,6 +77,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
):
log_level = input_parser.get_client_log_level_or_default(
participant_log_level, global_log_level, VERBOSITY_LEVELS
...
...
@@ -101,6 +102,7 @@ def launch(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
)
service = plan.add_service(service_name, config)
...
...
@@ -137,6 +139,7 @@ def get_config(
el_max_mem,
extra_params,
extra_env_vars,
extra_labels,
):
init_datadir_cmd_str = "reth init --datadir={0} --chain={1}".format(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
...
...
@@ -210,6 +213,7 @@ def get_config(
constants.CLIENT_TYPES.el,
image,
cl_client_name,
extra_labels,
),
)
...
...
src/package_io/input_parser.star
View file @
82ec85e8
...
...
@@ -119,13 +119,16 @@ def input_parser(plan, input_args):
el_client_type=participant["el_client_type"],
el_client_image=participant["el_client_image"],
el_client_log_level=participant["el_client_log_level"],
el_extra_params=participant["el_extra_params"],
el_extra_env_vars=participant["el_extra_env_vars"],
el_extra_labels=participant["el_extra_labels"],
cl_client_type=participant["cl_client_type"],
cl_client_image=participant["cl_client_image"],
cl_client_log_level=participant["cl_client_log_level"],
beacon_extra_params=participant["beacon_extra_params"],
el_extra_params=participant["el_extra_params"],
el_extra_env_vars=participant["el_extra_env_vars"],
beacon_extra_labels=participant["beacon_extra_labels"],
validator_extra_params=participant["validator_extra_params"],
validator_extra_labels=participant["validator_extra_labels"],
builder_network_params=participant["builder_network_params"],
el_min_cpu=participant["el_min_cpu"],
el_max_cpu=participant["el_max_cpu"],
...
...
@@ -405,13 +408,16 @@ def default_participant():
"el_client_type": "geth",
"el_client_image": "",
"el_client_log_level": "",
"el_extra_params": [],
"el_extra_env_vars": {},
"el_extra_labels": {},
"cl_client_type": "lighthouse",
"cl_client_image": "",
"cl_client_log_level": "",
"beacon_extra_params": [],
"el_extra_params": [],
"el_extra_env_vars": {},
"beacon_extra_labels": {},
"validator_extra_params": [],
"validator_extra_labels": {},
"builder_network_params": None,
"el_min_cpu": 0,
"el_max_cpu": 0,
...
...
src/participant_network.star
View file @
82ec85e8
...
...
@@ -215,6 +215,7 @@ def launch_participant_network(
participant.el_max_mem,
participant.el_extra_params,
participant.el_extra_env_vars,
participant.el_extra_labels,
)
# Add participant el additional prometheus metrics
...
...
@@ -331,6 +332,8 @@ def launch_participant_network(
snooper_engine_context,
participant.beacon_extra_params,
participant.validator_extra_params,
participant.beacon_extra_labels,
participant.validator_extra_labels,
)
else:
boot_cl_client_ctx = all_cl_client_contexts
...
...
@@ -356,6 +359,8 @@ def launch_participant_network(
snooper_engine_context,
participant.beacon_extra_params,
participant.validator_extra_params,
participant.beacon_extra_labels,
participant.validator_extra_labels,
)
# Add participant cl additional prometheus labels
...
...
src/shared_utils/shared_utils.star
View file @
82ec85e8
...
...
@@ -62,10 +62,12 @@ def zfill_custom(value, width):
return ("0" * (width - len(str(value)))) + str(value)
def label_maker(client, client_type, image, connected_client):
return
{
"ethereum-package
-
client": client,
"ethereum-package
-
client-type": client_type,
"ethereum-package
-
client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package
-
connected-client": connected_client,
def label_maker(client, client_type, image, connected_client
, extra_labels
):
labels =
{
"ethereum-package
.
client": client,
"ethereum-package
.
client-type": client_type,
"ethereum-package
.
client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package
.
connected-client": connected_client,
}
labels.update(extra_labels) # Add extra_labels to the labels dictionary
return labels
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