2022-12-23 12:21:42 +00:00
|
|
|
# System Imports
|
2023-02-12 00:57:27 +00:00
|
|
|
vars = import_module("github.com/logos-co/wakurtosis/src/system_variables.star")
|
2022-12-01 16:38:36 +00:00
|
|
|
|
2022-12-23 12:21:42 +00:00
|
|
|
# Module Imports
|
2023-02-12 00:57:27 +00:00
|
|
|
waku = import_module(vars.WAKU_MODULE)
|
|
|
|
prometheus = import_module(vars.PROMETHEUS_MODULE)
|
|
|
|
grafana = import_module(vars.GRAFANA_MODULE)
|
|
|
|
args_parser = import_module(vars.ARGUMENT_PARSER_MODULE)
|
|
|
|
wsl = import_module(vars.WSL_MODULE)
|
|
|
|
nodes = import_module(vars.NODE_BUILDERS_MODULE)
|
2023-01-12 16:22:01 +00:00
|
|
|
|
2022-12-19 16:56:38 +00:00
|
|
|
|
2023-01-19 18:26:34 +00:00
|
|
|
def run(plan, args):
|
2023-01-12 16:22:01 +00:00
|
|
|
|
2023-01-04 13:18:05 +00:00
|
|
|
# Load global config file
|
2023-01-19 18:26:34 +00:00
|
|
|
config_file = args_parser.get_configuration_file_name(plan, args)
|
2023-01-05 17:35:05 +00:00
|
|
|
config_json = read_file(src=config_file)
|
2023-01-04 13:18:05 +00:00
|
|
|
config = json.decode(config_json)
|
2022-12-12 15:23:47 +00:00
|
|
|
|
2023-01-19 18:26:34 +00:00
|
|
|
kurtosis_config = config['kurtosis']
|
|
|
|
wsl_config = config['wsl']
|
2023-02-12 17:48:38 +00:00
|
|
|
interconnection_batch = kurtosis_config['interconnection_batch']
|
2023-01-12 16:22:01 +00:00
|
|
|
|
2023-01-04 13:18:05 +00:00
|
|
|
# Load network topology
|
2023-02-12 00:57:27 +00:00
|
|
|
waku_topology_json = read_file(src=vars.TOPOLOGIES_LOCATION + vars.DEFAULT_TOPOLOGY_FILE)
|
2023-01-18 14:05:44 +00:00
|
|
|
waku_topology = json.decode(waku_topology_json)
|
2022-12-12 15:23:47 +00:00
|
|
|
|
2022-12-23 12:21:42 +00:00
|
|
|
# Set up nodes
|
2023-02-12 00:42:35 +00:00
|
|
|
services = nodes.instantiate_services(plan, waku_topology, False)
|
2022-12-16 12:13:12 +00:00
|
|
|
|
2023-01-12 16:22:01 +00:00
|
|
|
# Set up prometheus + graphana
|
2023-01-19 18:26:34 +00:00
|
|
|
prometheus_service = prometheus.set_up_prometheus(plan, services)
|
|
|
|
grafana_service = grafana.set_up_grafana(plan, prometheus_service)
|
2022-12-01 16:38:36 +00:00
|
|
|
|
2023-02-12 02:01:38 +00:00
|
|
|
waku.interconnect_waku_nodes(plan, waku_topology, services, interconnection_batch)
|
2022-12-15 13:56:59 +00:00
|
|
|
|
2023-02-02 12:41:04 +00:00
|
|
|
# Setup WSL & Start the Simulation
|
2023-01-19 18:26:34 +00:00
|
|
|
wsl_service = wsl.init(plan, services, wsl_config)
|