Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gennet/Kurtosis info into WLS with master changes #97

Merged
merged 118 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
1866577
Deactivated the Store flags, added log level
Feb 2, 2023
6778983
Ignored logs / results
Feb 2, 2023
f49a572
Generates a dictionary of messages sent to be used by wls_analyse.py
Feb 2, 2023
5dbc94e
Typoi
Feb 2, 2023
94f8896
Typo
Feb 2, 2023
2319e94
Activate Waku debug logs
Feb 2, 2023
b465231
Added hash calculaton of the payload
Feb 2, 2023
1020842
Analysis module to be run at the end of a simulation
Feb 2, 2023
1a2ffa1
Prepare environment for run / Delete logs
Feb 10, 2023
e3e10f2
Added prepare environment script
Feb 10, 2023
c807a5c
Minor
Feb 10, 2023
d19f52f
Delete the previous topology
Feb 10, 2023
85cfc22
Merge remote-tracking branch 'origin/master' into Analysis
Feb 10, 2023
30fca82
Fixed issues recovering the WSL UUID from the Kurtosis inspect command
Feb 10, 2023
0e94d2a
Changed log parsing to the new Kurtosis output format
Feb 10, 2023
f8375a7
Added parse unique topics
Feb 10, 2023
8bac04c
Minor
Feb 16, 2023
ee7287c
Merge remote-tracking branch 'origin/master' into Analysis
Feb 16, 2023
5877fa6
Added --log-level=TRACE to NWaku
Feb 16, 2023
af0eaa6
Changed Nwaku imagine to the new message trace image
Feb 16, 2023
e3d4849
Delete previous logs before starting
Feb 16, 2023
86f062f
Rename the analsysis script
Feb 16, 2023
5ebdd58
Added cAdvisor summary stats for each node
Feb 20, 2023
bae5ab8
Updated the docker image of cAdvisor to an explicit version instead o…
Feb 20, 2023
084429b
Minor
Feb 20, 2023
b717993
Minor
Feb 20, 2023
028cfee
Addded violin plots generation
Feb 23, 2023
041a6f4
Minor
Feb 27, 2023
2e16a76
Minor
Feb 27, 2023
035fbc9
Modified runner and wakurtosis to add cadvisor to the enclave. Also u…
AlbertoSoutullo Feb 27, 2023
59689e9
Merge pull request #93 from logos-co/Analysis_cadvisor
AlbertoSoutullo Feb 27, 2023
9022c6d
multiple nodes per containers: done (#89)
0xFugue Feb 22, 2023
974d5f5
WIP: Starting to refactor code so different nodes can be set up per c…
AlbertoSoutullo Feb 16, 2023
b31f087
Pass all necessary information to builder
AlbertoSoutullo Feb 16, 2023
5100214
Changed builder to add several nodes in ServiceConfig
AlbertoSoutullo Feb 16, 2023
315722a
Several nodes starting in same container working
AlbertoSoutullo Feb 16, 2023
154c4f1
Doing packaging inside starlar is wrong. Will start to refactor towar…
AlbertoSoutullo Feb 17, 2023
9bf23fa
Refactor structure so now several nodes can be in same service if gen…
AlbertoSoutullo Feb 17, 2023
51ea8aa
Added new information to topology dict instead of creating a new data…
AlbertoSoutullo Feb 20, 2023
9ce433f
Entire starlark workflow now works with several nodes per container
AlbertoSoutullo Feb 20, 2023
4f7b257
Refactored builders structure
AlbertoSoutullo Feb 21, 2023
5ecf1d7
Moved node builder star files to types folder
AlbertoSoutullo Feb 21, 2023
76275b7
Fixed bug when adding ports
AlbertoSoutullo Feb 21, 2023
01b3985
Refactored more system variables
AlbertoSoutullo Feb 21, 2023
13ebdea
Renamed propperly WSL to WLS to avoid confussions
AlbertoSoutullo Feb 21, 2023
777f67b
Last wsl to wls changes
AlbertoSoutullo Feb 21, 2023
d5b4332
Removed unused system variable
AlbertoSoutullo Feb 21, 2023
d8c3429
Moved send json rpc to a new file
AlbertoSoutullo Feb 21, 2023
e58a7aa
Not having a gennet config should not be considered an error.
AlbertoSoutullo Feb 21, 2023
605eb7f
Fixed typo en config.json and changed gennet output to match what is …
AlbertoSoutullo Feb 22, 2023
2fe5771
Deleted unnecessary variable in config.json
AlbertoSoutullo Feb 22, 2023
76fc0c3
Methods for nomos node interconnection
bacv Feb 7, 2023
552f824
Variable definitions for nomos node
bacv Feb 25, 2023
e93504f
Nomos service initialization and information extraction
bacv Feb 25, 2023
cb81c86
Gennet and WSL changes for nomos node
bacv Feb 25, 2023
2a3b5e5
Update to Kurtosis 66.2
bacv Feb 12, 2023
34d903e
Extend nomos wsl and add visualizations
bacv Feb 25, 2023
2df8153
Simplify dockerfiles and mark files as executable
bacv Feb 25, 2023
b469a63
Make node init code agnostic to the node type
bacv Feb 25, 2023
600c9e9
Interconnect waku and nomos nodes via the same method
bacv Feb 25, 2023
8bbabaf
Remove unused imports
bacv Feb 25, 2023
432889f
Remove inaccurate comment
bacv Feb 17, 2023
5c81b48
Nomos wsl statistics
bacv Feb 25, 2023
de84b28
Remove unused files
bacv Feb 25, 2023
7cda520
Add multiple nomos nodes per container support
bacv Feb 26, 2023
6cffd71
Remove unused variable
bacv Feb 27, 2023
a078908
WIP trying to pass new network information to wls
AlbertoSoutullo Mar 1, 2023
3fdc0f1
Changed wls to work with kurtosis information
AlbertoSoutullo Mar 2, 2023
013a799
WIP: Starting clean code to refactor as it already works for several …
AlbertoSoutullo Mar 3, 2023
db6996d
First refactor after rebase with Analysis
AlbertoSoutullo Mar 3, 2023
1236ae6
Refactor and restructured wls
AlbertoSoutullo Mar 3, 2023
4edd198
More refactor and PEP-8
AlbertoSoutullo Mar 4, 2023
523020c
Fixed logger and wls.py call before starting with tests
AlbertoSoutullo Mar 4, 2023
112ed64
Deleted unnecessary check
AlbertoSoutullo Mar 4, 2023
ca4bb88
Refactored payloads.py to add tests
AlbertoSoutullo Mar 4, 2023
557e149
Added tests for Moved node builder star files to types folder.py
AlbertoSoutullo Mar 4, 2023
18f7f58
Cleaned imports
AlbertoSoutullo Mar 5, 2023
8db84f0
Added exit code to sys.exit
AlbertoSoutullo Mar 5, 2023
d640d97
Added tests for waku messaging
AlbertoSoutullo Mar 5, 2023
7ddbbc2
Added tests for payloads
AlbertoSoutullo Mar 5, 2023
14244a5
Deleted unnecessary wls template.
AlbertoSoutullo Mar 5, 2023
da58f57
Make wls actually take arguments
AlbertoSoutullo Mar 7, 2023
c4ee242
Remove comment in payload and added error
AlbertoSoutullo Mar 7, 2023
1345575
Finished test payloads
AlbertoSoutullo Mar 7, 2023
a774ece
Added tests for wls.py
AlbertoSoutullo Mar 7, 2023
6099858
Bug: Ports shift values are now used
AlbertoSoutullo Mar 8, 2023
d6cc337
Moved dispatchers to other file
AlbertoSoutullo Mar 8, 2023
2686ed8
Made nomos method public by sintax
AlbertoSoutullo Mar 8, 2023
fd45564
Removed unnused method from wls.star
AlbertoSoutullo Mar 8, 2023
0e67be8
Fixed get peers method for multinode approach
AlbertoSoutullo Mar 8, 2023
2e4f8e4
Fixed test_file_helpers.star because new gennet information
AlbertoSoutullo Mar 8, 2023
462b3cb
Added new data and mofified old one for tests
AlbertoSoutullo Mar 8, 2023
21202c0
Moved and changed test_node_builders.star
AlbertoSoutullo Mar 8, 2023
9697972
Fixed tests for test_waku_methods.star
AlbertoSoutullo Mar 8, 2023
1932de5
Added tests for gowaku_builder.star
AlbertoSoutullo Mar 8, 2023
a155da0
Added tests for waku_builder.star
AlbertoSoutullo Mar 8, 2023
de6c75c
Added tests for nwaku_builder.star
AlbertoSoutullo Mar 8, 2023
da8cfe8
Added new tests to main test file and one extra data file for tests
AlbertoSoutullo Mar 8, 2023
f4fb0bd
Removed unnecessary catches
AlbertoSoutullo Mar 9, 2023
01551df
Fixed CMD starlark command to wls
AlbertoSoutullo Mar 9, 2023
1ae60e8
Removed unnecessary init py in wls-module
AlbertoSoutullo Mar 9, 2023
fcd814d
Fixed pythonpath in wls dockerfile
AlbertoSoutullo Mar 9, 2023
e923795
Fixed paths for wls in system_variables.star
AlbertoSoutullo Mar 9, 2023
ca73887
Fixed imports in wls tests
AlbertoSoutullo Mar 9, 2023
fe268b8
Fixed imports in wls main
AlbertoSoutullo Mar 9, 2023
23c6121
Added test for uniform mode in wls and fixed bug
AlbertoSoutullo Mar 9, 2023
5c171eb
Added tests for wls.star
AlbertoSoutullo Mar 10, 2023
f63c3b4
Cleaning
AlbertoSoutullo Mar 10, 2023
5f45ae4
Deleted old wls
AlbertoSoutullo Mar 10, 2023
4e64bfb
Added new test file for wls.star
AlbertoSoutullo Mar 13, 2023
09ee68e
Changed wls payload to base64
AlbertoSoutullo Mar 13, 2023
caaf3f0
Fixed test
AlbertoSoutullo Mar 13, 2023
d40a920
Merge branch 'master' into Alberto/new_info_to_wls
AlbertoSoutullo Mar 13, 2023
aee6a56
Solved conflicts with run.sh
AlbertoSoutullo Mar 13, 2023
41d5f67
Merge branch 'master' into Alberto/new_info_to_wls
AlbertoSoutullo Mar 16, 2023
2b52e68
Added missing "_" separators into system variables
AlbertoSoutullo Mar 16, 2023
8de3cd6
Changed port name to match with kubernetes changes in wls
AlbertoSoutullo Mar 16, 2023
8f34f0c
Updated kurtosis version to 0.67.3
AlbertoSoutullo Mar 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ config/topology_generated/
config/waku_config_files/
kurtosisrun_log.txt
summary.json
wakurtosis_logs/
log_trace_test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ More info about Kurtosis: https://docs.kurtosis.com/

#### Before using this repository note that:

- **You are using Kurtosis version 0.67.0**. This is important, as they are working on it and changes can be huge depending on different versions. You can find all Kurtosis versions [here](https://github.com/kurtosis-tech/kurtosis-cli-release-artifacts/releases).
- **You are using Kurtosis version 0.67.3**. This is important, as they are working on it and changes can be huge depending on different versions. You can find all Kurtosis versions [here](https://github.com/kurtosis-tech/kurtosis-cli-release-artifacts/releases).
- The topology files that will be used by default are defined in `config/topology_generated/`. This topology is created with the [gennet](gennet-module/Readme.md) module.
- Kurtosis can set up services in a parallel manner, defined in the `config.json` file (see below).
- Only `kurtosis` and `docker` are needed to run this.
Expand Down
388 changes: 388 additions & 0 deletions analysis.py

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

apt-get install -y jq

# Install the suitable kurtosis-cli
kurtosis_version=0.67.0
kurtosis_version=0.67.3
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt-mark unhold kurtosis-cli
Expand Down
3 changes: 2 additions & 1 deletion config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"benchmark": "False"
},
"wls": {
"simulation_time": 6,
"debug_level": "DEBUG",
"simulation_time": 60,
"message_rate": 10,
"min_packet_size": 2,
"max_packet_size": 1024,
Expand Down
2 changes: 1 addition & 1 deletion config/test_files/nwaku_0.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
topics="test"
topics="test asd"
rpc-admin=true
keep-alive=true
metrics-server=true
Expand Down
5 changes: 5 additions & 0 deletions config/test_files/nwaku_2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
topics="test"
rpc-admin=true
keep-alive=true
metrics-server=true
nodekey="80fb8f9b71c808bc186bc8c6639a12446e667d031e8ac4896efad603e21728b4"
5 changes: 5 additions & 0 deletions config/test_files/nwaku_3.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
topics="test"
rpc-admin=true
keep-alive=true
metrics-server=true
nodekey="80fb8f9b71c808bc186bc8c6639a12446e667d031e8ac4896efad603e21728b5"
14 changes: 14 additions & 0 deletions config/test_files/test_config_file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"general":{
"prng_seed" : 67
},
"kurtosis": {
"enclave_name": "wakurtosis",
},
"gennet": {
"num_nodes": 5
},
"wls": {
"simulation_time": 60
}
}
66 changes: 53 additions & 13 deletions config/test_files/test_network_data.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,58 @@
{
"nwaku_0": {
"static_nodes": [
"nwaku_1"
"containers": {
"container_0": [
"nwaku_0",
"nwaku_2"
],
"subnetwork": "subnetwork_0",
"image": "nim-waku",
"configuration": "nwaku_0.toml"
"container_1": [
"nwaku_1",
"nwaku_3"
]
},
"nwaku_1": {
"static_nodes": [
"nwaku_0"
],
"subnetwork": "subnetwork_0",
"image": "nim-waku",
"configuration": "nwaku_1.toml"
"nodes": {
"nwaku_0": {
"static_nodes": [
"nwaku_1"
],
"subnetwork": "subnetwork_0",
"image": "nim-waku",
"node_config": "nwaku_0.toml",
"node_log": "node_0.log",
"port_shift": 0,
"container_id": "container_0"
},
"nwaku_1": {
"static_nodes": [
"nwaku_0"
],
"subnetwork": "subnetwork_0",
"image": "nim-waku",
"node_config": "nwaku_1.toml",
"node_log": "node_1.log",
"port_shift": 0,
"container_id": "container_1"
},
"nwaku_2": {
"static_nodes": [
"nwaku_3"
],
"subnetwork": "subnetwork_0",
"image": "nim-waku",
"node_config": "nwaku_2.toml",
"node_log": "node_1.log",
"port_shift": 1,
"container_id": "container_0"
},
"nwaku_3": {
"static_nodes": [
"nwaku_2"
],
"subnetwork": "subnetwork_0",
"image": "nim-waku",
"node_config": "nwaku_3.toml",
"node_log": "node_3.log",
"port_shift": 1,
"container_id": "container_1"
}
}
}
42 changes: 29 additions & 13 deletions config/test_files/test_network_data_2.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
{
"nwaku_0_2": {
"static_nodes": [
"nwaku_1_2"
],
"subnetwork": "subnetwork_0",
"image": "nim-waku",
"configuration": "nwaku_0_2.toml"
},
"nwaku_1_2": {
"static_nodes": [
"containers": {
"cid1": [
"nwaku_0_2"
],
"subnetwork": "subnetwork_0",
"image": "nim-waku",
"configuration": "nwaku_1_2.toml"
"cid2": [
"nwaku_1_2"
]
},
"nodes": {
"nwaku_0_2": {
"static_nodes": [
"nwaku_1_2"
],
"subnetwork": "subnetwork_0",
"image": "nim-waku",
"node_config": "nwaku_0_2.toml",
"node_log": "node_0_2.log",
"port_shift": 0,
"container_id": "cid1"
},
"nwaku_1_2": {
"static_nodes": [
"nwaku_0_2"
],
"subnetwork": "subnetwork_0",
"image": "nim-waku",
"node_config": "nwaku_1_2.toml",
"node_log": "node_1_2.log",
"port_shift": 0,
"container_id": "cid2"
}
}
}
3 changes: 1 addition & 2 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def run(plan, args):
config = json.decode(config_json)

kurtosis_config = config[vars.KURTOSIS_KEY]
wls_config = config[vars.WLS_KEY]
interconnection_batch = kurtosis_config[vars.INTERCONNECTION_BATCH_KEY]

# Load network topology
Expand All @@ -35,4 +34,4 @@ def run(plan, args):
nodes.interconnect_nodes(plan, network_topology, interconnection_batch)

# Setup WLS & Start the Simulation
wls_service = wls.init(plan, network_topology, wls_config)
wls_service = wls.init(plan, network_topology, config_file)
6 changes: 5 additions & 1 deletion monitoring/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ scrape_configs:
scrape_interval: 1s
file_sd_configs:
- files:
- '/tmp/targets.json'
- '/tmp/targets.json'
- job_name: 'cadvisor'
scrape_interval: 5s
static_configs:
- targets: ['cadvisor:8080']
15 changes: 15 additions & 0 deletions prepare_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

kurtosis engine stop

ulimit -n $(ulimit -n -H)
ulimit -u $(ulimit -u -H)

sudo sysctl -w net.ipv4.neigh.default.gc_thresh3=4096
sudo sysctl fs.inotify.max_user_instances=1048576
sudo sysctl -w vm.max_map_count=262144

sudo docker container rm -f $(docker container ls -aq)
sudo docker volume rm -f $(docker volume ls -q)

kurtosis engine start
78 changes: 53 additions & 25 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

dir=$(pwd)

# Set up Cadvisor
docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/var/lib/docker/:/var/lib/docker:ro --volume=/dev/disk/:/dev/disk:ro --volume=/sys:/sys:ro --volume=/etc/machine-id:/etc/machine-id:ro --publish=8080:8080 --detach=true --name=cadvisor --privileged --device=/dev/kmsg gcr.io/cadvisor/cadvisor


# Parse arg if any
ARGS1=${1:-"wakurtosis"}
ARGS2=${2:-"config.json"}
Expand All @@ -18,9 +14,45 @@ loglevel="error"
echo "- Enclave name: " $enclave_name
echo "- Configuration file: " $wakurtosis_config_file

# Run Gennet
echo -e "\nRunning Gennet"
# Delete the enclave just in case
echo -e "\nCleaning up Kurtosis environment "$enclave_name
docker container stop cadvisor > /dev/null 2>&1
docker container rm cadvisor > /dev/null 2>&1
kurtosis enclave rm -f $enclave_name > /dev/null 2>&1
# kurtosis clean -a > /dev/null 2>&1 we do not want to delete all enclaves, just the one we will execute

# Delete previous logs
echo -e "\Deleting previous logs in ${enclave_name}_logs"
rm -rf ./${enclave_name}_logs > /dev/null 2>&1
rm ./kurtosisrun_log.txt > /dev/null 2>&1

# Preparing enclave
echo "Preparing enclave..."
kurtosis enclave add --name ${enclave_name}
enclave_preffix="$(kurtosis enclave inspect --full-uuids $enclave_name | grep UUID: | awk '{print $2}')"
echo "Enclave network: "$enclave_preffix

# Get enclave last IP
subnet="$(docker network inspect $enclave_preffix | jq -r '.[].IPAM.Config[0].Subnet')"
echo "Enclave subnetork: $subnet"
last_ip="$(ipcalc $subnet | grep HostMax | awk '{print $2}')"
echo "cAdvisor IP: $last_ip"


# Set up Cadvisor
# docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/var/lib/docker/:/var/lib/docker:ro --volume=/dev/disk/:/dev/disk:ro --volume=/sys:/sys:ro --volume=/etc/machine-id:/etc/machine-id:ro --publish=8080:8080 --detach=true --name=cadvisor --privileged --device=/dev/kmsg gcr.io/cadvisor/cadvisor
docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/var/lib/docker/:/var/lib/docker:ro --volume=/dev/disk/:/dev/disk:ro --volume=/sys:/sys:ro --volume=/etc/machine-id:/etc/machine-id:ro --publish=8080:8080 --detach=true --name=cadvisor --privileged --device=/dev/kmsg --network $enclave_preffix --ip=$last_ip gcr.io/cadvisor/cadvisor:v0.47.0


# Delete topology
rm -rf ./config/topology_generated > /dev/null 2>&1
# Remove previous logs
rm -rf ./$enclave_name_logs > /dev/null 2>&1

# Create and run Gennet docker container
echo -e "\nRunning network generation"
docker rm gennet-container > /dev/null 2>&1 # cleanup the old docker if any

cd gennet-module
docker run --name gennet-container -v ${dir}/config/:/config gennet --config-file /config/${wakurtosis_config_file} --output-dir /config/topology_generated
err=$?
Expand All @@ -34,10 +66,7 @@ fi

docker rm gennet-container > /dev/null 2>&1

# Delete the enclave just in case
kurtosis enclave rm -f $enclave_name > /dev/null 2>&1

# Create a new enclave and run the simulation
# Create the new enclave and run the simulation
jobs=$(cat config/${wakurtosis_config_file} | jq -r ".kurtosis.jobs")

echo -e "\nSetting up the enclave: $enclave_name"
Expand All @@ -54,37 +83,36 @@ wls_service_name=$(kurtosis --cli-log-level $loglevel enclave inspect $enclave_n
# kurtosis service logs $enclave_name $wls_service_name
echo -e "\n--> To see simulation logs run: kurtosis service logs $enclave_name $wls_service_name <--"

# Extract the Grafana host:port
# TODO: needs fixing
grafana_host=$(kurtosis --cli-log-level $loglevel enclave inspect $enclave_name | grep grafana | awk '{print $6}')

# Fetch the Grafana address & port
grafana_host=$(kurtosis enclave inspect $enclave_name | grep grafana | awk '{print $6}')
echo -e "\n--> Statistics in Grafana server at http://$grafana_host/ <--"

# echo "Output of kurtosis run command written in kurtosisrun_log.txt"
echo "Output of kurtosis run command written in kurtosisrun_log.txt"

### Wait for WLS to finish

# Get the container prefix/uffix for the WLS service
enclave_prefix="$(kurtosis --cli-log-level $loglevel enclave inspect --full-uuids $enclave_name | grep UUID: | awk '{print $2}')"
cid_suffix="$(kurtosis --cli-log-level $loglevel enclave inspect --full-uuids $enclave_name | grep $wls_service_name | cut -f 1 -d ' ')"
service_name="$(kurtosis --cli-log-level $loglevel enclave inspect $enclave_name | grep $wls_service_name | awk '{print $2}')"
service_uuid="$(kurtosis --cli-log-level $loglevel enclave inspect --full-uuids $enclave_name | grep $wls_service_name | awk '{print $1}')"

# Construct the fully qualified container name that kurtosis has created
cid="$enclave_prefix--user-service--$cid_suffix"
cid="$service_name--$service_uuid"

# Wait for the container to halt; this will block
echo "Waiting for simulation to finish ..."
echo -e "Waiting for simulation to finish ..."
status_code="$(docker container wait $cid)"

### Logs
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"

END2=$(date +%s)
DIFF2=$(( $END2 - $END1 ))

echo "Simulation took $DIFF1 + $DIFF2 = $(( $END2 - $START)) secs"
# Copy simulation results
#docker cp "$cid:/wls/summary.json" "./"
#echo "Simulation ended with code $status_code Results in ./summary.json"

# Stop and delete the enclave
# kurtosis enclave stop $enclave_name > /dev/null 2>&1
# kurtosis enclave rm -f $enclave_name > /dev/null 2>&1
# echo "Enclave $enclave_name stopped and deleted."
# docker cp "$cid:/wls/summary.json" "./${enclave_name}_logs" > /dev/null 2>&1
docker cp "$cid:/wls/messages.json" "./${enclave_name}_logs"

echo "Done."
Loading