Skip to content

Commit

Permalink
feat: add custom labels
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa committed Oct 26, 2023
1 parent ef2b1d7 commit 788f033
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/cl/lighthouse/lighthouse_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def launch(
image,
log_level,
beacon_http_url,
el_client_context,
node_keystore_files,
v_min_cpu,
v_max_cpu,
Expand Down Expand Up @@ -341,6 +342,12 @@ def get_beacon_config(
max_cpu=bn_max_cpu,
min_memory=bn_min_mem,
max_memory=bn_max_mem,
labels={
"ethereum-package-client": "lighthouse",
"ethereum-package-client-type": "beacon",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-el-client": el_client_context.client_name,
},
)


Expand All @@ -349,6 +356,7 @@ def get_validator_config(
image,
log_level,
beacon_client_http_url,
el_client_context,
node_keystore_files,
v_min_cpu,
v_max_cpu,
Expand Down Expand Up @@ -407,6 +415,12 @@ def get_validator_config(
max_cpu=v_max_cpu,
min_memory=v_min_mem,
max_memory=v_max_mem,
labels={
"ethereum-package-client": "lighthouse",
"ethereum-package-client-type": "validator",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-el-client": el_client_context.client_name,
},
)


Expand Down
14 changes: 14 additions & 0 deletions src/cl/lodestar/lodestar_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def launch(
image,
log_level,
beacon_http_url,
el_client_context,
node_keystore_files,
v_min_cpu,
v_max_cpu,
Expand Down Expand Up @@ -286,6 +287,12 @@ def get_beacon_config(
max_cpu=bn_max_cpu,
min_memory=bn_min_mem,
max_memory=bn_max_mem,
labels={
"ethereum-package-client": "lodestar",
"ethereum-package-client-type": "beacon",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-el-client": el_client_context.client_name,
},
)


Expand All @@ -295,6 +302,7 @@ def get_validator_config(
image,
log_level,
beacon_client_http_url,
el_client_context,
node_keystore_files,
v_min_cpu,
v_max_cpu,
Expand Down Expand Up @@ -351,6 +359,12 @@ def get_validator_config(
max_cpu=v_max_cpu,
min_memory=v_min_mem,
max_memory=v_max_mem,
labels={
"ethereum-package-client": "lodestar",
"ethereum-package-client-type": "validator",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-el-client": el_client_context.client_name,
},
)


Expand Down
6 changes: 6 additions & 0 deletions src/cl/nimbus/nimbus_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ def get_config(
max_cpu=bn_max_cpu,
min_memory=bn_min_mem,
max_memory=bn_max_mem,
labels={
"ethereum-package-client": "nimbus",
"ethereum-package-client-type": "beacon",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-el-client": el_client_context.client_name,
},
)


Expand Down
16 changes: 16 additions & 0 deletions src/cl/prysm/prysm_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def launch(
log_level,
beacon_rpc_endpoint,
beacon_http_endpoint,
el_client_context,
node_keystore_files,
v_min_cpu,
v_max_cpu,
Expand Down Expand Up @@ -315,6 +316,12 @@ def get_beacon_config(
max_cpu=bn_max_cpu,
min_memory=bn_min_mem,
max_memory=bn_max_mem,
labels={
"ethereum-package-client": "prysm",
"ethereum-package-client-type": "beacon",
"ethereum-package-image": beacon_image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-el-client": el_client_context.client_name,
},
)


Expand All @@ -325,6 +332,7 @@ def get_validator_config(
log_level,
beacon_rpc_endpoint,
beacon_http_endpoint,
el_client_context,
node_keystore_files,
v_min_cpu,
v_max_cpu,
Expand Down Expand Up @@ -382,6 +390,14 @@ def get_validator_config(
max_cpu=v_max_cpu,
min_memory=v_min_mem,
max_memory=v_max_mem,
labels={
"ethereum-package-client": "prysm",
"ethereum-package-client-type": "validator",
"ethereum-package-image": validator_image.replace("/", "-").replace(
":", "-"
),
"ethereum-package-connected-el-client": el_client_context.client_name,
},
)


Expand Down
6 changes: 6 additions & 0 deletions src/cl/teku/teku_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ def get_config(
max_cpu=bn_max_cpu,
min_memory=bn_min_mem,
max_memory=bn_max_mem,
labels={
"ethereum-package-client": "teku",
"ethereum-package-client-type": "beacon",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-el-client": el_client_context.client_name,
},
)


Expand Down
10 changes: 10 additions & 0 deletions src/el/besu/besu_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ def launch(
el_min_mem = int(el_min_mem) if int(el_min_mem) > 0 else EXECUTION_MIN_MEMORY
el_max_mem = int(el_max_mem) if int(el_max_mem) > 0 else EXECUTION_MAX_MEMORY

cl_client_name = service_name.split("-")[3]

config = get_config(
launcher.network_id,
launcher.el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
log_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -125,6 +128,7 @@ def get_config(
el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
log_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -197,6 +201,12 @@ def get_config(
min_memory=el_min_mem,
max_memory=el_max_mem,
env_vars=extra_env_vars,
labels={
"ethereum-package-client": "geth",
"ethereum-package-client-type": "execution",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-cl-client": cl_client_name,
},
)


Expand Down
10 changes: 10 additions & 0 deletions src/el/erigon/erigon_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ def launch(
el_min_mem = el_min_mem if int(el_min_mem) > 0 else EXECUTION_MIN_MEMORY
el_max_mem = el_max_mem if int(el_max_mem) > 0 else EXECUTION_MAX_MEMORY

cl_client_name = service_name.split("-")[3]

config = get_config(
launcher.network_id,
launcher.el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
log_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -128,6 +131,7 @@ def get_config(
el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
verbosity_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -209,6 +213,12 @@ def get_config(
min_memory=el_min_mem,
max_memory=el_max_mem,
env_vars=extra_env_vars,
labels={
"ethereum-package-client": "geth",
"ethereum-package-client-type": "execution",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-cl-client": cl_client_name,
},
)


Expand Down
10 changes: 10 additions & 0 deletions src/el/ethereumjs/ethereumjs_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ def launch(
el_min_mem = el_min_mem if int(el_min_mem) > 0 else EXECUTION_MIN_MEMORY
el_max_mem = el_max_mem if int(el_max_mem) > 0 else EXECUTION_MAX_MEMORY

cl_client_name = service_name.split("-")[3]

config = get_config(
launcher.el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
log_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -127,6 +130,7 @@ def get_config(
el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
verbosity_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -189,6 +193,12 @@ def get_config(
min_memory=el_min_mem,
max_memory=el_max_mem,
env_vars=extra_env_vars,
labels={
"ethereum-package-client": "geth",
"ethereum-package-client-type": "execution",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-cl-client": cl_client_name,
},
)


Expand Down
10 changes: 10 additions & 0 deletions src/el/geth/geth_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,14 @@ def launch(
el_min_mem = el_min_mem if int(el_min_mem) > 0 else EXECUTION_MIN_MEMORY
el_max_mem = el_max_mem if int(el_max_mem) > 0 else EXECUTION_MAX_MEMORY

cl_client_name = service_name.split("-")[3]

config = get_config(
launcher.network_id,
launcher.el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
log_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -140,6 +143,7 @@ def get_config(
el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
verbosity_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -259,6 +263,12 @@ def get_config(
min_memory=el_min_mem,
max_memory=el_max_mem,
env_vars=extra_env_vars,
labels={
"ethereum-package-client": "geth",
"ethereum-package-client-type": "execution",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-cl-client": cl_client_name,
},
)


Expand Down
10 changes: 10 additions & 0 deletions src/el/nethermind/nethermind_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,13 @@ def launch(
el_min_mem = el_min_mem if int(el_min_mem) > 0 else EXECUTION_MIN_MEMORY
el_max_mem = el_max_mem if int(el_max_mem) > 0 else EXECUTION_MAX_MEMORY

cl_client_name = service_name.split("-")[3]

config = get_config(
launcher.el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
log_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -123,6 +126,7 @@ def get_config(
el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
log_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -184,6 +188,12 @@ def get_config(
min_memory=el_min_mem,
max_memory=el_max_mem,
env_vars=extra_env_vars,
labels={
"ethereum-package-client": "geth",
"ethereum-package-client-type": "execution",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-cl-client": cl_client_name,
},
)


Expand Down
10 changes: 10 additions & 0 deletions src/el/reth/reth_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ def launch(
el_min_mem = el_min_mem if int(el_min_mem) > 0 else EXECUTION_MIN_MEMORY
el_max_mem = el_max_mem if int(el_max_mem) > 0 else EXECUTION_MAX_MEMORY

cl_client_name = service_name.split("-")[3]

config = get_config(
launcher.el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
log_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -126,6 +129,7 @@ def get_config(
el_cl_genesis_data,
image,
existing_el_clients,
cl_client_name,
verbosity_level,
el_min_cpu,
el_max_cpu,
Expand Down Expand Up @@ -201,6 +205,12 @@ def get_config(
min_memory=el_min_mem,
max_memory=el_max_mem,
env_vars=extra_env_vars,
labels={
"ethereum-package-client": "geth",
"ethereum-package-client-type": "execution",
"ethereum-package-client-image": image.replace("/", "-").replace(":", "-"),
"ethereum-package-connected-cl-client": cl_client_name,
},
)


Expand Down

0 comments on commit 788f033

Please sign in to comment.