From 788f03393d1dc429061c714d93c28ac7c5d3a0c7 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 26 Oct 2023 12:07:04 +0200 Subject: [PATCH] feat: add custom labels --- src/cl/lighthouse/lighthouse_launcher.star | 14 ++++++++++++++ src/cl/lodestar/lodestar_launcher.star | 14 ++++++++++++++ src/cl/nimbus/nimbus_launcher.star | 6 ++++++ src/cl/prysm/prysm_launcher.star | 16 ++++++++++++++++ src/cl/teku/teku_launcher.star | 6 ++++++ src/el/besu/besu_launcher.star | 10 ++++++++++ src/el/erigon/erigon_launcher.star | 10 ++++++++++ src/el/ethereumjs/ethereumjs_launcher.star | 10 ++++++++++ src/el/geth/geth_launcher.star | 10 ++++++++++ src/el/nethermind/nethermind_launcher.star | 10 ++++++++++ src/el/reth/reth_launcher.star | 10 ++++++++++ 11 files changed, 116 insertions(+) diff --git a/src/cl/lighthouse/lighthouse_launcher.star b/src/cl/lighthouse/lighthouse_launcher.star index 3348c2e66..beed369cd 100644 --- a/src/cl/lighthouse/lighthouse_launcher.star +++ b/src/cl/lighthouse/lighthouse_launcher.star @@ -165,6 +165,7 @@ def launch( image, log_level, beacon_http_url, + el_client_context, node_keystore_files, v_min_cpu, v_max_cpu, @@ -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, + }, ) @@ -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, @@ -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, + }, ) diff --git a/src/cl/lodestar/lodestar_launcher.star b/src/cl/lodestar/lodestar_launcher.star index ec2eee590..3f10af268 100644 --- a/src/cl/lodestar/lodestar_launcher.star +++ b/src/cl/lodestar/lodestar_launcher.star @@ -141,6 +141,7 @@ def launch( image, log_level, beacon_http_url, + el_client_context, node_keystore_files, v_min_cpu, v_max_cpu, @@ -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, + }, ) @@ -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, @@ -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, + }, ) diff --git a/src/cl/nimbus/nimbus_launcher.star b/src/cl/nimbus/nimbus_launcher.star index 2ac6b0a5e..bf47368bf 100644 --- a/src/cl/nimbus/nimbus_launcher.star +++ b/src/cl/nimbus/nimbus_launcher.star @@ -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, + }, ) diff --git a/src/cl/prysm/prysm_launcher.star b/src/cl/prysm/prysm_launcher.star index c5184ba32..552cba7e6 100644 --- a/src/cl/prysm/prysm_launcher.star +++ b/src/cl/prysm/prysm_launcher.star @@ -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, @@ -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, + }, ) @@ -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, @@ -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, + }, ) diff --git a/src/cl/teku/teku_launcher.star b/src/cl/teku/teku_launcher.star index d60da16e9..76b1db0ce 100644 --- a/src/cl/teku/teku_launcher.star +++ b/src/cl/teku/teku_launcher.star @@ -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, + }, ) diff --git a/src/el/besu/besu_launcher.star b/src/el/besu/besu_launcher.star index 5130232e9..6381f1b9c 100644 --- a/src/el/besu/besu_launcher.star +++ b/src/el/besu/besu_launcher.star @@ -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, @@ -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, @@ -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, + }, ) diff --git a/src/el/erigon/erigon_launcher.star b/src/el/erigon/erigon_launcher.star index 420825f0e..c8603b179 100644 --- a/src/el/erigon/erigon_launcher.star +++ b/src/el/erigon/erigon_launcher.star @@ -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, @@ -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, @@ -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, + }, ) diff --git a/src/el/ethereumjs/ethereumjs_launcher.star b/src/el/ethereumjs/ethereumjs_launcher.star index e6c968be8..c346df1fd 100644 --- a/src/el/ethereumjs/ethereumjs_launcher.star +++ b/src/el/ethereumjs/ethereumjs_launcher.star @@ -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, @@ -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, @@ -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, + }, ) diff --git a/src/el/geth/geth_launcher.star b/src/el/geth/geth_launcher.star index ad887301c..054dc46f3 100644 --- a/src/el/geth/geth_launcher.star +++ b/src/el/geth/geth_launcher.star @@ -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, @@ -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, @@ -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, + }, ) diff --git a/src/el/nethermind/nethermind_launcher.star b/src/el/nethermind/nethermind_launcher.star index 04ff6bcc7..566e5b7da 100644 --- a/src/el/nethermind/nethermind_launcher.star +++ b/src/el/nethermind/nethermind_launcher.star @@ -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, @@ -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, @@ -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, + }, ) diff --git a/src/el/reth/reth_launcher.star b/src/el/reth/reth_launcher.star index 14fa06098..826bc01b5 100644 --- a/src/el/reth/reth_launcher.star +++ b/src/el/reth/reth_launcher.star @@ -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, @@ -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, @@ -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, + }, )