Skip to content

Commit 0b2a2ae

Browse files
authored
feat: add support for pull through cache (ethereum#833)
1 parent 2633d15 commit 0b2a2ae

File tree

53 files changed

+508
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+508
-158
lines changed

.github/tests/mix-with-tools-minimal.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ additional_services:
3131
ethereum_metrics_exporter_enabled: true
3232
snooper_enabled: true
3333
keymanager_enabled: true
34+
docker_cache_params:
35+
enabled: true
36+
url: "docker.ethquokkaops.io"

README.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -637,19 +637,24 @@ additional_services:
637637
# Configuration place for dora the explorer - https://github.com/ethpandaops/dora
638638
dora_params:
639639
# Dora docker image to use
640-
# Leave blank to use the default image according to your network params
641-
image: ""
642-
640+
# Defaults to the latest image
641+
image: "ethpandaops/dora:latest"
643642
# A list of optional extra env_vars the dora container should spin up with
644643
env: {}
645644

646645
# Configuration place for transaction spammer - https://github.com/MariusVanDerWijden/tx-fuzz
647646
tx_spammer_params:
647+
# TX Spammer docker image to use
648+
# Defaults to the latest master image
649+
image: "ethpandaops/tx-fuzz:master"
648650
# A list of optional extra params that will be passed to the TX Spammer container for modifying its behaviour
649651
tx_spammer_extra_args: []
650652

651653
# Configuration place for goomy the blob spammer - https://github.com/ethpandaops/goomy-blob
652654
goomy_blob_params:
655+
# Goomy Blob docker image to use
656+
# Defaults to the latest
657+
image: "ethpandaops/goomy-blob:latest"
653658
# A list of optional params that will be passed to the blob-spammer comamnd for modifying its behaviour
654659
goomy_blob_args: []
655660

@@ -664,6 +669,9 @@ prometheus_params:
664669
max_cpu: 1000
665670
min_mem: 128
666671
max_mem: 2048
672+
# Prometheus docker image to use
673+
# Defaults to the latest image
674+
image: "prom/prometheus:latest"
667675

668676
# Configuration place for grafana
669677
grafana_params:
@@ -676,12 +684,15 @@ grafana_params:
676684
max_cpu: 1000
677685
min_mem: 128
678686
max_mem: 2048
687+
# Grafana docker image to use
688+
# Defaults to the latest image
689+
image: "grafana/grafana:latest"
679690

680691
# Configuration place for the assertoor testing tool - https://github.com/ethpandaops/assertoor
681692
assertoor_params:
682693
# Assertoor docker image to use
683-
# Leave blank to use the default image according to your network params
684-
image: ""
694+
# Defaults to the latest image
695+
image: "ethpandaops/assertoor:latest"
685696

686697
# Check chain stability
687698
# This check monitors the chain and succeeds if:
@@ -771,6 +782,20 @@ disable_peer_scoring: false
771782
# Defaults to false
772783
persistent: false
773784

785+
# Docker cache url enables all docker images to be pulled through a custom docker registry
786+
# Disabled by default
787+
# Defaults to empty cache url
788+
# Images pulled from dockerhub will be prefixed with "/dh/" by default (docker.io)
789+
# Images pulled from github registry will be prefixed with "/gh/" by default (ghcr.io)
790+
# Images pulled from google registory will be prefixed with "/gcr/" by default (gcr.io)
791+
# If you want to use a local image in combination with the cache, do not put "/" in your local image name
792+
docker_cache_params:
793+
enabled: false
794+
url: ""
795+
dockerhub_prefix: "/dh/"
796+
github_prefix: "/gh/"
797+
google_prefix: "/gcr/"
798+
774799
# Supports three valeus
775800
# Default: "null" - no mev boost, mev builder, mev flood or relays are spun up
776801
# "mock" - mock-builder & mev-boost are spun up

main.star

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def run(plan, args={}):
9292
global_node_selectors = args_with_right_defaults.global_node_selectors
9393
keymanager_enabled = args_with_right_defaults.keymanager_enabled
9494
apache_port = args_with_right_defaults.apache_port
95+
docker_cache_params = args_with_right_defaults.docker_cache_params
9596

9697
prefunded_accounts = genesis_constants.PRE_FUNDED_ACCOUNTS
9798
if (
@@ -158,9 +159,8 @@ def run(plan, args={}):
158159
network_id,
159160
) = participant_network.launch_participant_network(
160161
plan,
161-
args_with_right_defaults.participants,
162+
args_with_right_defaults,
162163
network_params,
163-
args_with_right_defaults.global_log_level,
164164
jwt_file,
165165
keymanager_file,
166166
persistent,
@@ -169,10 +169,6 @@ def run(plan, args={}):
169169
global_node_selectors,
170170
keymanager_enabled,
171171
parallel_keystore_generation,
172-
args_with_right_defaults.checkpoint_sync_enabled,
173-
args_with_right_defaults.checkpoint_sync_url,
174-
args_with_right_defaults.port_publisher,
175-
args_with_right_defaults.mev_type,
176172
)
177173

178174
plan.print(
@@ -459,6 +455,7 @@ def run(plan, args={}):
459455
network_params.seconds_per_slot,
460456
network_params.genesis_delay,
461457
global_node_selectors,
458+
args_with_right_defaults.tx_spammer_params,
462459
)
463460
plan.print("Successfully launched blob spammer")
464461
elif additional_service == "goomy_blob":
@@ -488,6 +485,7 @@ def run(plan, args={}):
488485
global_node_selectors,
489486
args_with_right_defaults.port_publisher,
490487
index,
488+
args_with_right_defaults.docker_cache_params,
491489
)
492490
plan.print("Successfully launched execution layer forkmon")
493491
elif additional_service == "beacon_metrics_gazer":
@@ -500,6 +498,7 @@ def run(plan, args={}):
500498
global_node_selectors,
501499
args_with_right_defaults.port_publisher,
502500
index,
501+
args_with_right_defaults.docker_cache_params,
503502
)
504503
)
505504
launch_prometheus_grafana = True
@@ -516,6 +515,7 @@ def run(plan, args={}):
516515
global_node_selectors,
517516
args_with_right_defaults.port_publisher,
518517
index,
518+
args_with_right_defaults.docker_cache_params,
519519
)
520520
plan.print("Successfully launched blockscout")
521521
elif additional_service == "dora":
@@ -550,6 +550,7 @@ def run(plan, args={}):
550550
global_node_selectors,
551551
args_with_right_defaults.port_publisher,
552552
index,
553+
args_with_right_defaults.docker_cache_params,
553554
)
554555
plan.print("Successfully launched dugtrio")
555556
elif additional_service == "blutgang":
@@ -566,6 +567,7 @@ def run(plan, args={}):
566567
global_node_selectors,
567568
args_with_right_defaults.port_publisher,
568569
index,
570+
args_with_right_defaults.docker_cache_params,
569571
)
570572
plan.print("Successfully launched blutgang")
571573
elif additional_service == "blobscan":
@@ -580,6 +582,7 @@ def run(plan, args={}):
580582
global_node_selectors,
581583
args_with_right_defaults.port_publisher,
582584
index,
585+
args_with_right_defaults.docker_cache_params,
583586
)
584587
plan.print("Successfully launched blobscan")
585588
elif additional_service == "forky":
@@ -598,6 +601,7 @@ def run(plan, args={}):
598601
final_genesis_timestamp,
599602
args_with_right_defaults.port_publisher,
600603
index,
604+
args_with_right_defaults.docker_cache_params,
601605
)
602606
plan.print("Successfully launched forky")
603607
elif additional_service == "tracoor":
@@ -616,6 +620,7 @@ def run(plan, args={}):
616620
final_genesis_timestamp,
617621
args_with_right_defaults.port_publisher,
618622
index,
623+
args_with_right_defaults.docker_cache_params,
619624
)
620625
plan.print("Successfully launched tracoor")
621626
elif additional_service == "apache":
@@ -627,6 +632,7 @@ def run(plan, args={}):
627632
all_participants,
628633
args_with_right_defaults.participants,
629634
global_node_selectors,
635+
args_with_right_defaults.docker_cache_params,
630636
)
631637
plan.print("Successfully launched apache")
632638
elif additional_service == "full_beaconchain_explorer":
@@ -673,6 +679,7 @@ def run(plan, args={}):
673679
fuzz_target,
674680
args_with_right_defaults.custom_flood_params,
675681
global_node_selectors,
682+
args_with_right_defaults.docker_cache_params,
676683
)
677684
else:
678685
fail("Invalid additional service %s" % (additional_service))

src/apache/apache_launcher.star

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ APACHE_ENR_LIST_FILENAME = "bootstrap_nodes.txt"
1111

1212
APACHE_CONFIG_MOUNT_DIRPATH_ON_SERVICE = "/usr/local/apache2/htdocs/"
1313

14+
IMAGE_NAME = "library/httpd:latest"
1415
# The min/max CPU/memory that assertoor can use
1516
MIN_CPU = 100
1617
MAX_CPU = 300
@@ -33,6 +34,7 @@ def launch_apache(
3334
participant_contexts,
3435
participant_configs,
3536
global_node_selectors,
37+
docker_cache_params,
3638
):
3739
config_files_artifact_name = plan.upload_files(
3840
src=static_files.APACHE_CONFIG_FILEPATH, name="apache-config"
@@ -93,6 +95,7 @@ def launch_apache(
9395
public_ports,
9496
bootstrap_info_files_artifact_name,
9597
global_node_selectors,
98+
docker_cache_params,
9699
)
97100

98101
plan.add_service(SERVICE_NAME, config)
@@ -104,6 +107,7 @@ def get_config(
104107
public_ports,
105108
bootstrap_info_files_artifact_name,
106109
node_selectors,
110+
docker_cache_params,
107111
):
108112
files = {
109113
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data,
@@ -145,7 +149,10 @@ def get_config(
145149
cmd_str = " ".join(cmd)
146150

147151
return ServiceConfig(
148-
image="httpd:latest",
152+
image=shared_utils.docker_cache_image_calc(
153+
docker_cache_params,
154+
IMAGE_NAME,
155+
),
149156
ports=USED_PORTS,
150157
cmd=[cmd_str],
151158
public_ports=public_ports,

src/assertoor/assertoor_launcher.star

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,10 @@ def get_config(
119119
ASSERTOOR_CONFIG_FILENAME,
120120
)
121121

122-
if assertoor_params.image != "":
123-
IMAGE_NAME = assertoor_params.image
124-
elif network_params.electra_fork_epoch < constants.ELECTRA_FORK_EPOCH:
122+
IMAGE_NAME = assertoor_params.image
123+
124+
if network_params.electra_fork_epoch < constants.ELECTRA_FORK_EPOCH:
125125
IMAGE_NAME = "ethpandaops/assertoor:electra-support"
126-
else:
127-
IMAGE_NAME = "ethpandaops/assertoor:latest"
128126

129127
return ServiceConfig(
130128
image=IMAGE_NAME,

src/beacon_metrics_gazer/beacon_metrics_gazer_launcher.star

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ def launch_beacon_metrics_gazer(
3737
global_node_selectors,
3838
port_publisher,
3939
additional_service_index,
40+
docker_cache_params,
4041
):
4142
config = get_config(
4243
cl_contexts[0].beacon_http_url,
4344
global_node_selectors,
4445
port_publisher,
4546
additional_service_index,
47+
docker_cache_params,
4648
)
4749

4850
beacon_metrics_gazer_service = plan.add_service(SERVICE_NAME, config)
@@ -64,6 +66,7 @@ def get_config(
6466
node_selectors,
6567
port_publisher,
6668
additional_service_index,
69+
docker_cache_params,
6770
):
6871
config_file_path = shared_utils.path_join(
6972
BEACON_METRICS_GAZER_CONFIG_MOUNT_DIRPATH_ON_SERVICE,
@@ -78,7 +81,10 @@ def get_config(
7881
)
7982

8083
return ServiceConfig(
81-
image=IMAGE_NAME,
84+
image=shared_utils.docker_cache_image_calc(
85+
docker_cache_params,
86+
IMAGE_NAME,
87+
),
8288
ports=USED_PORTS,
8389
public_ports=public_ports,
8490
files={

src/blob_spammer/blob_spammer.star

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
IMAGE_NAME = "ethpandaops/tx-fuzz:master"
21
SERVICE_NAME = "blob-spammer"
32

43
ENTRYPOINT_ARGS = ["/bin/sh", "-c"]
@@ -19,6 +18,7 @@ def launch_blob_spammer(
1918
seconds_per_slot,
2019
genesis_delay,
2120
global_node_selectors,
21+
tx_spammer_params,
2222
):
2323
config = get_config(
2424
prefunded_addresses,
@@ -28,6 +28,7 @@ def launch_blob_spammer(
2828
seconds_per_slot,
2929
genesis_delay,
3030
global_node_selectors,
31+
tx_spammer_params.image,
3132
)
3233
plan.add_service(SERVICE_NAME, config)
3334

@@ -40,10 +41,11 @@ def get_config(
4041
seconds_per_slot,
4142
genesis_delay,
4243
node_selectors,
44+
image,
4345
):
4446
dencunTime = (deneb_fork_epoch * 32 * seconds_per_slot) + genesis_delay
4547
return ServiceConfig(
46-
image=IMAGE_NAME,
48+
image=image,
4749
entrypoint=ENTRYPOINT_ARGS,
4850
cmd=[
4951
" && ".join(

0 commit comments

Comments
 (0)