diff --git a/.github/tests/mix-with-tools-mev.yaml b/.github/tests/mix-with-tools-mev.yaml index 728fb31a5..5ed9e9bb8 100644 --- a/.github/tests/mix-with-tools-mev.yaml +++ b/.github/tests/mix-with-tools-mev.yaml @@ -26,6 +26,7 @@ additional_services: - blutgang - apache - tracoor + - cadvisor ethereum_metrics_exporter_enabled: true snooper_enabled: true mev_type: flashbots diff --git a/.github/tests/mix-with-tools-minimal.yaml b/.github/tests/mix-with-tools-minimal.yaml index 695c4a9dd..723f74f38 100644 --- a/.github/tests/mix-with-tools-minimal.yaml +++ b/.github/tests/mix-with-tools-minimal.yaml @@ -28,6 +28,7 @@ additional_services: - blutgang - apache - tracoor + - cadvisor ethereum_metrics_exporter_enabled: true snooper_enabled: true keymanager_enabled: true diff --git a/.github/tests/mix-with-tools.yaml b/.github/tests/mix-with-tools.yaml index ed4fc57e5..5056dbbaf 100644 --- a/.github/tests/mix-with-tools.yaml +++ b/.github/tests/mix-with-tools.yaml @@ -28,6 +28,7 @@ additional_services: - blutgang - apache - tracoor + - cadvisor ethereum_metrics_exporter_enabled: true snooper_enabled: true keymanager_enabled: true diff --git a/main.star b/main.star index 9dce197c9..da4994113 100644 --- a/main.star +++ b/main.star @@ -33,6 +33,7 @@ full_beaconchain_explorer = import_module( blockscout = import_module("./src/blockscout/blockscout_launcher.star") prometheus = import_module("./src/prometheus/prometheus_launcher.star") grafana = import_module("./src/grafana/grafana_launcher.star") +cadvisor = import_module("./src/cadvisor/cadvisor_launcher.star") mev_rs_mev_boost = import_module("./src/mev/mev-rs/mev_boost/mev_boost_launcher.star") mev_rs_mev_relay = import_module("./src/mev/mev-rs/mev_relay/mev_relay_launcher.star") mev_rs_mev_builder = import_module( @@ -625,6 +626,15 @@ def run(plan, args={}): args_with_right_defaults.custom_flood_params, global_node_selectors, ) + elif additional_service == "cadvisor": + plan.print("Launching cadvisor") + cadvisor.launch_cadvisor( + plan, + args_with_right_defaults.port_publisher, + index, + global_node_selectors, + ) + plan.print("Successfully launched cadvisor") else: fail("Invalid additional service %s" % (additional_service)) if launch_prometheus_grafana: diff --git a/src/cadvisor/cadvisor_launcher.star b/src/cadvisor/cadvisor_launcher.star new file mode 100644 index 000000000..c7e2f51a6 --- /dev/null +++ b/src/cadvisor/cadvisor_launcher.star @@ -0,0 +1,39 @@ +shared_utils = import_module("../shared_utils/shared_utils.star") +constants = import_module("../package_io/constants.star") +SERVICE_NAME = "cadvisor" + +HTTP_PORT_NUMBER = 8080 +USED_PORTS = { + constants.HTTP_PORT_ID: shared_utils.new_port_spec( + HTTP_PORT_NUMBER, + shared_utils.TCP_PROTOCOL, + shared_utils.HTTP_APPLICATION_PROTOCOL, + ) +} + +IMAGE_NAME = "gcr.io/cadvisor/cadvisor:v0.38.7" + + +def launch_cadvisor( + plan, + port_publisher, + additional_service_index, + global_node_selectors, +): + public_ports = shared_utils.get_additional_service_standard_public_port( + port_publisher, + constants.HTTP_PORT_ID, + additional_service_index, + 0, + ) + files = {"/var/run/docker.sock": "/var/run/docker.sock"} + + config = ServiceConfig( + image=IMAGE_NAME, + ports=USED_PORTS, + public_ports=public_ports, + node_selectors=global_node_selectors, + files=files, + ) + + plan.add_service(SERVICE_NAME, config) diff --git a/src/package_io/sanity_check.star b/src/package_io/sanity_check.star index b8d10c8f8..815d80b31 100644 --- a/src/package_io/sanity_check.star +++ b/src/package_io/sanity_check.star @@ -231,6 +231,7 @@ ADDITIONAL_SERVICES_PARAMS = [ "forky", "apache", "tracoor", + "cadvisor", ] ADDITIONAL_CATEGORY_PARAMS = {