mirror of
https://github.com/vacp2p/wakurtosis.git
synced 2026-01-09 14:58:02 -05:00
Renamed propperly WSL to WLS to avoid confussions
This commit is contained in:
committed by
Alberto Soutullo Rendo
parent
01b398513b
commit
13ebdea853
4
.gitignore
vendored
4
.gitignore
vendored
@@ -16,8 +16,8 @@ node_modules/
|
||||
targets.json
|
||||
data/
|
||||
enclave.dump/
|
||||
wsl-module/requirements.txt
|
||||
wsl-module/__pycache__
|
||||
wls-module/requirements.txt
|
||||
wls-module/__pycache__
|
||||
config/network_topology_auto/
|
||||
config/config.json
|
||||
gennet-module/topology/
|
||||
|
||||
@@ -34,7 +34,7 @@ These are arguments that can be modified:
|
||||
- _jobs_: int. Defines how many services will be instantiated at the same time.
|
||||
- _interconnection_batch_: int. If nodes are being connected by a given topology, this tells kurtosis how many connections will try to set up in the same node at a time. Used to avoid timeouts if a node has a lot of connections.
|
||||
|
||||
- [WLS](wsl-module/README.md) module configuration
|
||||
- [WLS](wls-module/README.md) module configuration
|
||||
- [Gennet](gennet-module/Readme.md) module configuration
|
||||
|
||||
#### What will happen
|
||||
@@ -50,7 +50,7 @@ Once all nodes have been interconnected the simulation starts and will inject tr
|
||||
|
||||
- Simulation log:
|
||||
|
||||
'kurtosis service logs wakurtosis $(kurtosis enclave inspect <enclave-name> | grep wsl- | awk '{print $1}')'
|
||||
'kurtosis service logs wakurtosis $(kurtosis enclave inspect <enclave-name> | grep wls- | awk '{print $1}')'
|
||||
|
||||
- Grafana server:
|
||||
|
||||
|
||||
6
build.sh
6
build.sh
@@ -13,9 +13,9 @@ sudo apt install kurtosis-cli=$kurtosis_version
|
||||
sudo apt-mark hold kurtosis-cli
|
||||
sudo rm /etc/apt/sources.list.d/kurtosis.list
|
||||
|
||||
# Build WSL and Gennet docker image
|
||||
cd wsl-module
|
||||
docker build -t wsl:0.0.1 .
|
||||
# Build WLS and Gennet docker image
|
||||
cd wls-module
|
||||
docker build -t wls:0.0.1 .
|
||||
cd ..
|
||||
|
||||
cd gennet-module
|
||||
|
||||
@@ -6,7 +6,7 @@ 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)
|
||||
wls = import_module(vars.WLS_MODULE)
|
||||
nodes = import_module(vars.NODE_BUILDERS_MODULE)
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ def run(plan, args):
|
||||
config = json.decode(config_json)
|
||||
|
||||
kurtosis_config = config[vars.KURTOSIS_KEY]
|
||||
wsl_config = config[vars.WLS_KEY]
|
||||
wls_config = config[vars.WLS_KEY]
|
||||
interconnection_batch = kurtosis_config[vars.INTERCONNECTION_BATCH_KEY]
|
||||
|
||||
# Load network topology
|
||||
@@ -35,5 +35,5 @@ def run(plan, args):
|
||||
|
||||
waku.interconnect_waku_nodes(plan, network_topology, interconnection_batch)
|
||||
|
||||
# Setup WSL & Start the Simulation
|
||||
wsl_service = wsl.init(plan, network_topology, wsl_config)
|
||||
# Setup WLS & Start the Simulation
|
||||
wls_service = wls.init(plan, network_topology, wls_config)
|
||||
|
||||
18
run.sh
18
run.sh
@@ -72,10 +72,11 @@ kurtosis_cmd="kurtosis run --enclave-id ${enclave_name} . '{\"wakurtosis_config_
|
||||
eval $kurtosis_cmd
|
||||
echo -e "Enclave " $enclave_name " is up and running"
|
||||
|
||||
# Fetch the WSL service id and display the log of the simulation
|
||||
wsl_service_name=$(kurtosis enclave inspect $enclave_name 2>/dev/null | grep wsl | awk '{print $1}')
|
||||
# kurtosis service logs wakurtosis $wsl_service_id
|
||||
echo -e "\n--> To see simulation logs run: kurtosis service logs $enclave_name $wsl_service_name <--"
|
||||
# Fetch the WLS service id and display the log of the simulation
|
||||
wls_service_name=$(kurtosis enclave inspect wakurtosis | grep wls | awk '{print $1}')
|
||||
# kurtosis service logs wakurtosis $wls_service_name
|
||||
echo -e "\n--> To see simulation logs run: kurtosis service logs wakurtosis $wls_service_name <--"
|
||||
|
||||
|
||||
# Fetch the Grafana address & port
|
||||
grafana_host=$(kurtosis enclave inspect $enclave_name | grep grafana | awk '{print $6}')
|
||||
@@ -83,11 +84,11 @@ echo -e "\n--> Statistics in Grafana server at http://$grafana_host/ <--"
|
||||
|
||||
echo "Output of kurtosis run command written in kurtosisrun_log.txt"
|
||||
|
||||
### Wait for WSL to finish
|
||||
### Wait for WLS to finish
|
||||
|
||||
# Get the container suffix for the running service
|
||||
enclave_preffix="$(kurtosis enclave inspect --full-uuids $enclave_name | grep UUID: | awk '{print $2}')"
|
||||
cid_suffix="$(kurtosis enclave inspect --full-uuids $enclave_name | grep $wsl_service_name | cut -f 1 -d ' ')"
|
||||
cid_suffix="$(kurtosis enclave inspect --full-uuids $enclave_name | grep $wls_service_name | cut -f 1 -d ' ')"
|
||||
|
||||
# Construct the fully qualified container name that kurtosis created
|
||||
cid="$enclave_preffix--user-service--$cid_suffix"
|
||||
@@ -101,8 +102,9 @@ kurtosis enclave dump ${enclave_name} ${enclave_name}_logs > /dev/null 2>&1
|
||||
echo -e "Simulation ended with code $status_code Results in ./${enclave_name}_logs"
|
||||
|
||||
# Copy simulation results
|
||||
# docker cp "$cid:/wsl/summary.json" "./${enclave_name}_logs" > /dev/null 2>&1
|
||||
docker cp "$cid:/wsl/messages.json" "./${enclave_name}_logs"
|
||||
# docker cp "$cid:/wls/summary.json" "./${enclave_name}_logs" > /dev/null 2>&1
|
||||
docker cp "$cid:/wls/messages.json" "./${enclave_name}_logs"
|
||||
|
||||
|
||||
# Stop and delete the enclave
|
||||
# kurtosis enclave stop $enclave_name > /dev/null 2>&1
|
||||
|
||||
@@ -72,16 +72,16 @@ PEER_ID_KEY = "peer_id"
|
||||
IP_KEY = "ip_address"
|
||||
PORTS_KEY = "ports"
|
||||
|
||||
# WSL Configuration
|
||||
WSL_IMAGE = "wsl:0.0.1"
|
||||
WSL_SERVICE_NAME = "wsl"
|
||||
WSL_CONFIG_PATH = "/wsl/config"
|
||||
WSL_TARGETS_PATH = "/wsl/targets"
|
||||
WSL_TOMLS_PATH = "/wsl/tomls"
|
||||
WLS_CMD = ["python3", "wsl.py"]
|
||||
# WLS Configuration
|
||||
WLS_IMAGE = "wls:0.0.1"
|
||||
WLS_SERVICE_NAME = "wls"
|
||||
WLS_CONFIG_PATH = "/wls/config"
|
||||
WLS_TARGETS_PATH = "/wls/targets"
|
||||
WLS_TOMLS_PATH = "/wls/tomls"
|
||||
WLS_CMD = ["python3", "wls.py"]
|
||||
|
||||
CONTAINER_WSL_CONFIGURATION_FILE_NAME = "wsl.yml"
|
||||
CONTAINER_TARGETS_FILE_NAME_WSL = "targets.json"
|
||||
CONTAINER_WLS_CONFIGURATION_FILE_NAME = "wls.yml"
|
||||
CONTAINER_TARGETS_FILE_NAME_WLS = "targets.json"
|
||||
|
||||
# Waku RPC methods
|
||||
POST_RELAY_MESSAGE_METHOD = "post_waku_v2_relay_v1_message"
|
||||
@@ -100,7 +100,7 @@ GRAFANA_MODULE = "github.com/logos-co/wakurtosis/src/monitoring/grafana.star"
|
||||
ARGUMENT_PARSER_MODULE = "github.com/logos-co/wakurtosis/src/arguments_parser.star"
|
||||
FILE_HELPERS_MODULE = "github.com/logos-co/wakurtosis/src/file_helpers.star"
|
||||
TEMPLATES_MODULE = "github.com/logos-co/wakurtosis/src/templates.star"
|
||||
WSL_MODULE = "github.com/logos-co/wakurtosis/src/wsl.star"
|
||||
WLS_MODULE = "github.com/logos-co/wakurtosis/src/wls.star"
|
||||
|
||||
TEST_ARGUMENTS_MODULE = "github.com/logos-co/wakurtosis/src/tests/test_arguments_parser.star"
|
||||
TEST_FILES_MODULE = "github.com/logos-co/wakurtosis/src/tests/test_file_helpers.star"
|
||||
|
||||
@@ -33,10 +33,10 @@ def get_prometheus_template():
|
||||
|
||||
return template
|
||||
|
||||
# WSL
|
||||
def get_wsl_template():
|
||||
# WLS
|
||||
def get_wls_template():
|
||||
# Traffic simulation parameters
|
||||
wsl_yml_template = """
|
||||
wls_yml_template = """
|
||||
general:
|
||||
|
||||
debug_level : "DEBUG"
|
||||
@@ -68,4 +68,4 @@ def get_wsl_template():
|
||||
inter_msg_type : {{.inter_msg_type}}
|
||||
"""
|
||||
|
||||
return wsl_yml_template
|
||||
return wls_yml_template
|
||||
|
||||
@@ -8,16 +8,16 @@ templates = import_module(vars.TEMPLATES_MODULE)
|
||||
def create_config(plan, wls_config):
|
||||
|
||||
# Traffic simulation parameters
|
||||
wsl_yml_template = templates.get_wsl_template()
|
||||
wls_yml_template = templates.get_wls_template()
|
||||
|
||||
artifact_id = plan.render_templates(
|
||||
config={
|
||||
vars.CONTAINER_WSL_CONFIGURATION_FILE_NAME: struct(
|
||||
template=wsl_yml_template,
|
||||
vars.CONTAINER_WLS_CONFIGURATION_FILE_NAME: struct(
|
||||
template=wls_yml_template,
|
||||
data=wls_config,
|
||||
)
|
||||
},
|
||||
name="wsl_config"
|
||||
name="wls_config"
|
||||
)
|
||||
|
||||
return artifact_id
|
||||
@@ -34,20 +34,20 @@ def create_targets(plan, services):
|
||||
|
||||
artifact_id = plan.render_templates(
|
||||
config={
|
||||
vars.CONTAINER_TARGETS_FILE_NAME_WSL: struct(
|
||||
vars.CONTAINER_TARGETS_FILE_NAME_WLS: struct(
|
||||
template=template,
|
||||
data=template_data,
|
||||
)
|
||||
},
|
||||
name="wsl_targets"
|
||||
name="wls_targets"
|
||||
)
|
||||
|
||||
return artifact_id
|
||||
|
||||
def init(plan, services, wsl_config):
|
||||
def init(plan, services, wls_config):
|
||||
|
||||
# Generate simulation config
|
||||
wsl_config = create_config(plan, wsl_config)
|
||||
wls_config = create_config(plan, wls_config)
|
||||
|
||||
tomls_artifact = plan.upload_files(
|
||||
src = vars.NODE_CONFIG_FILE_LOCATION,
|
||||
@@ -55,23 +55,23 @@ def init(plan, services, wsl_config):
|
||||
)
|
||||
|
||||
# Create targets.json
|
||||
wsl_targets = create_targets(plan, services)
|
||||
wls_targets = create_targets(plan, services)
|
||||
|
||||
|
||||
add_service_config = ServiceConfig(
|
||||
image=vars.WSL_IMAGE,
|
||||
image=vars.WLS_IMAGE,
|
||||
ports={},
|
||||
files={
|
||||
vars.WSL_CONFIG_PATH: wsl_config,
|
||||
vars.WSL_TARGETS_PATH: wsl_targets,
|
||||
vars.WSL_TOMLS_PATH: tomls_artifact
|
||||
vars.WLS_CONFIG_PATH: wls_config,
|
||||
vars.WLS_TARGETS_PATH: wls_targets,
|
||||
vars.WLS_TOMLS_PATH: tomls_artifact
|
||||
},
|
||||
cmd=vars.WLS_CMD
|
||||
)
|
||||
wsl_service = plan.add_service(
|
||||
service_name=vars.WSL_SERVICE_NAME,
|
||||
wls_service = plan.add_service(
|
||||
service_name=vars.WLS_SERVICE_NAME,
|
||||
config=add_service_config
|
||||
)
|
||||
|
||||
return wsl_service
|
||||
return wls_service
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Wakurtosis Load Simualtor (WSL)
|
||||
Wakurtosis Load Simualtor (WLS)
|
||||
===============================
|
||||
|
||||
Kurtosis: https://docs.kurtosis.com/
|
||||
@@ -8,7 +8,7 @@ Kurtosis: https://docs.kurtosis.com/
|
||||
To build docker image:
|
||||
`sh ./build.sh`
|
||||
|
||||
Name of the image is wsl:0.0.1
|
||||
Name of the image is wls:0.0.1
|
||||
|
||||
### Parameters
|
||||
|
||||
6
wls-module/build.sh
Normal file
6
wls-module/build.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
# pip freeze > requirements.txt
|
||||
image_id=$(docker images -q wls:0.0.1)
|
||||
echo $image_id
|
||||
docker image rm -f $image_id
|
||||
docker image build --progress=plain -t wls:0.0.1 ./
|
||||
@@ -1,7 +1,7 @@
|
||||
FROM python:3.11.0
|
||||
LABEL Maintainer="Daimakaimura"
|
||||
WORKDIR /wsl
|
||||
COPY wsl.py .
|
||||
WORKDIR /wls
|
||||
COPY wls.py .
|
||||
COPY rtnorm.py .
|
||||
COPY requirements.txt ./
|
||||
RUN pip install -r requirements.txt
|
||||
@@ -17,7 +17,7 @@ import rtnorm
|
||||
""" Globals """
|
||||
G_APP_NAME = 'WLS'
|
||||
G_LOG_LEVEL = 'DEBUG'
|
||||
G_DEFAULT_CONFIG_FILE = './config/wsl.yml'
|
||||
G_DEFAULT_CONFIG_FILE = './config/wls.yml'
|
||||
G_LOGGER = None
|
||||
|
||||
""" Custom logging formatter """
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
# pip freeze > requirements.txt
|
||||
image_id=$(docker images -q wsl:0.0.1)
|
||||
echo $image_id
|
||||
docker image rm -f $image_id
|
||||
docker image build --progress=plain -t wsl:0.0.1 ./
|
||||
Reference in New Issue
Block a user