Skip to content

Commit

Permalink
Added $DEBUG variable and disabled all the debug and cat commands (#230)
Browse files Browse the repository at this point in the history
* added $DEBUG variable and disabled all the debug and cat commands by default

Signed-off-by: Tullio Sebastiani <[email protected]>

* added DEBUG variable to documentation

Signed-off-by: Tullio Sebastiani <[email protected]>

---------

Signed-off-by: Tullio Sebastiani <[email protected]>
  • Loading branch information
tsebastiani authored Nov 26, 2024
1 parent 4568f2f commit c1aef50
Show file tree
Hide file tree
Showing 18 changed files with 128 additions and 87 deletions.
12 changes: 9 additions & 3 deletions application-outages/run.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/bin/bash

set -ex

# Source env.sh to read all the vars
source /home/krkn/main_env.sh
source /home/krkn/env.sh
source /home/krkn/common_run.sh


if [[ $DEBUG == "True" ]];then
set -ex
ls -la /home/krkn/.kube
fi



ls -la /home/krkn/.kube

source /home/krkn/common_run.sh
checks
config_setup

Expand Down
15 changes: 10 additions & 5 deletions container-scenarios/run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/bash

set -ex

# Source env.sh to read all the vars
source /home/krkn/main_env.sh
source /home/krkn/env.sh

source /home/krkn/common_run.sh

if [[ $DEBUG == "True" ]];then
set -ex
fi


checks
config_setup

Expand All @@ -17,9 +20,11 @@ envsubst < /home/krkn/kraken/config/config.yaml.template > /home/krkn/kraken/con
# Run Kraken
cd /home/krkn/kraken

cat config/container_scenario_config.yaml
if [[ $DEBUG == "True" ]];then
cat config/container_scenario_config.yaml
cat scenarios/container_scenario.yaml
fi

cat scenarios/container_scenario.yaml


python3.9 run_kraken.py --config=config/container_scenario_config.yaml
1 change: 1 addition & 0 deletions docs/all_scenarios_env.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ TELEMETRY_FILTER_PATTER | Filter logs based on certain time stamp patterns |["(\
TELEMETRY_CLI_PATH | OC Cli path, if not specified will be search in $PATH | _blank_ |
ELASTIC_SERVER | Be able to track telemtry data in elasticsearch, this is the url of the elasticsearch data storage | _blank_ |
ELASTIC_INDEX | Elastic search index pattern to post results to | _blank_ |
DEBUG| If set to "True" enables krkn Verbose output | "False" |

**NOTE**: For setting the TELEMETRY_ARCHIVE_SIZE,the higher the number of archive files will be produced and uploaded (and processed by backup_thread simultaneously).For unstable/slow connection is better to keep this value low increasing the number of backup_threads, in this way, on upload failure, the retry will happen only on the failed chunk without affecting the whole upload.
1 change: 1 addition & 0 deletions env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ export TELEMETRY_EVENTS_BACKUP=${TELEMETRY_EVENTS_BACKUP:=True}

# Set KUBECONFIG to mounted kubeconfig
export KUBECONFIG=${KRKN_KUBE_CONFIG}
export DEBUG=${DEBUG:="False"}
11 changes: 6 additions & 5 deletions network-chaos/run.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash

set -ex

# Source env.sh to read all the vars
source /home/krkn/main_env.sh
source /home/krkn/env.sh
source /home/krkn/common_run.sh

if [[ $DEBUG == "True" ]];then
set -ex
ls -la /home/krkn/.kube
fi

ls -la /home/krkn/.kube

source /home/krkn/common_run.sh
checks
config_setup

Expand Down
14 changes: 8 additions & 6 deletions node-cpu-hog/run.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!/bin/bash

set -ex

ROOT_FOLDER="/home/krkn"
KRAKEN_FOLDER="$ROOT_FOLDER/kraken"
SCENARIO_FOLDER="$KRAKEN_FOLDER/scenarios/kube/cpu-hog"

# Source env.sh to read all the vars
source $ROOT_FOLDER/main_env.sh
source $ROOT_FOLDER/env.sh

source $ROOT_FOLDER/common_run.sh

if [[ $DEBUG == "True" ]];then
set -ex
fi

setup_arcaflow_env "$SCENARIO_FOLDER"
# Substitute config with environment vars defined
envsubst < $KRAKEN_FOLDER/config/config.yaml.template > $KRAKEN_FOLDER/config/cpu_config.yaml
Expand All @@ -21,9 +22,10 @@ config_setup
# Run Kraken
cd $KRAKEN_FOLDER

cat config/cpu_config.yaml

cat scenarios/kube/cpu-hog/input.yaml
if [[ $DEBUG == "True" ]];then
cat scenarios/kube/cpu-hog/input.yaml
cat config/cpu_config.yaml
fi

python3.9 run_kraken.py --config=config/cpu_config.yaml

Expand Down
14 changes: 8 additions & 6 deletions node-io-hog/run.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!/bin/bash

set -ex

ROOT_FOLDER="/home/krkn"
KRAKEN_FOLDER="$ROOT_FOLDER/kraken"
SCENARIO_FOLDER="$KRAKEN_FOLDER/scenarios/kube/io-hog"

# Source env.sh to read all the vars
source $ROOT_FOLDER/main_env.sh
source $ROOT_FOLDER/env.sh

source $ROOT_FOLDER/common_run.sh

if [[ $DEBUG == "True" ]];then
set -ex
fi

setup_arcaflow_env "$SCENARIO_FOLDER"
# Substitute config with environment vars defined
envsubst < $KRAKEN_FOLDER/config/config.yaml.template > $KRAKEN_FOLDER/config/io_config.yaml
Expand All @@ -21,9 +22,10 @@ config_setup
# Run Kraken
cd $KRAKEN_FOLDER

cat config/io_config.yaml

cat scenarios/kube/io-hog/input.yaml
if [[ $DEBUG == "True" ]];then
cat config/io_config.yaml
cat scenarios/kube/io-hog/input.yaml
fi

python3.9 run_kraken.py --config=config/io_config.yaml

Expand Down
13 changes: 8 additions & 5 deletions node-memory-hog/run.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!/bin/bash

set -ex

ROOT_FOLDER="/home/krkn"
KRAKEN_FOLDER="$ROOT_FOLDER/kraken"
SCENARIO_FOLDER="$KRAKEN_FOLDER/scenarios/kube/memory-hog"

# Source env.sh to read all the vars
source $ROOT_FOLDER/main_env.sh
source $ROOT_FOLDER/env.sh

source $ROOT_FOLDER/common_run.sh

if [[ $DEBUG == "True" ]];then
set -ex
fi

setup_arcaflow_env "$SCENARIO_FOLDER"
# Substitute config with environment vars defined
envsubst < $KRAKEN_FOLDER/config/config.yaml.template > $KRAKEN_FOLDER/config/mem_config.yaml
Expand All @@ -23,8 +24,10 @@ config_setup
# Run Kraken
cd $KRAKEN_FOLDER

cat config/mem_config.yaml
if [[ $DEBUG == "True" ]];then
cat config/mem_config.yaml
cat scenarios/kube/memory-hog/input.yaml
fi

cat scenarios/kube/memory-hog/input.yaml

python3.9 run_kraken.py --config=config/mem_config.yaml
15 changes: 9 additions & 6 deletions node-scenarios/run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash

set -ex

# Source env.sh to read all the vars
source /home/krkn/main_env.sh
source /home/krkn/env.sh

source /home/krkn/common_run.sh

if [[ $DEBUG == "True" ]];then
set -ex
fi

checks

# Substitute config with environment vars defined
Expand Down Expand Up @@ -43,8 +44,10 @@ envsubst < /home/krkn/kraken/config/config.yaml.template > /home/krkn/kraken/con
# Run Kraken
cd /home/krkn/kraken

cat config/node_scenario_config.yaml

cat scenarios/node_scenario.yaml
if [[ $DEBUG == "True" ]];then
cat config/node_scenario_config.yaml
cat scenarios/node_scenario.yaml
fi

python3.9 run_kraken.py --config=config/node_scenario_config.yaml
18 changes: 10 additions & 8 deletions pod-network-chaos/run.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash

set -ex

# Source env.sh to read all the vars
source /home/krkn/main_env.sh
source /home/krkn/env.sh
source /home/krkn/common_run.sh

ls -la /home/krkn/.kube
if [[ $DEBUG == "True" ]];then
set -ex
ls -la /home/krkn/.kube
fi

source /home/krkn/common_run.sh
checks
config_setup

Expand All @@ -18,14 +18,16 @@ envsubst < /home/krkn/kraken/config/config.yaml.template > /home/krkn/kraken/con

# Validate if namespace parameter is set
if [[ -z $NAMESPACE ]]; then
echo "Requires NAMASPACE parameter to be set, please check"
echo "Requires NAMESPACE parameter to be set, please check"
exit 1
fi

# Run Kraken
cd /home/krkn/kraken

cat /home/krkn/kraken/config/pod_network_scenario_config.yaml
cat /home/krkn/kraken/scenarios/pod_network_scenario.yaml
if [[ $DEBUG == "True" ]];then
cat /home/krkn/kraken/config/pod_network_scenario_config.yaml
cat /home/krkn/kraken/scenarios/pod_network_scenario.yaml
fi

python3.9 run_kraken.py --config=/home/krkn/kraken/config/pod_network_scenario_config.yaml
18 changes: 11 additions & 7 deletions pod-scenarios/run.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash

set -ex

# Source env.sh to read all the vars
source /home/krkn/main_env.sh
source /home/krkn/env.sh
source /home/krkn/common_run.sh

ls -la /home/krkn/.kube
if [[ $DEBUG == "True" ]];then
set -ex
ls -la /home/krkn/.kube
fi

source /home/krkn/common_run.sh
checks
config_setup

Expand All @@ -23,7 +23,11 @@ envsubst < /home/krkn/kraken/config/config.yaml.template > /home/krkn/kraken/con
# Run Kraken
cd /home/krkn/kraken

cat /home/krkn/kraken/config/pod_scenario_config.yaml
cat /home/krkn/kraken/scenarios/pod_scenario.yaml

if [[ $DEBUG == "True" ]];then
cat /home/krkn/kraken/config/pod_scenario_config.yaml
cat /home/krkn/kraken/scenarios/pod_scenario.yaml
fi


python3.9 run_kraken.py --config=/home/krkn/kraken/config/pod_scenario_config.yaml
16 changes: 9 additions & 7 deletions power-outages/run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash

set -ex

# Source env.sh to read all the vars
source /home/krkn/main_env.sh
source /home/krkn/env.sh

source /home/krkn/common_run.sh

if [[ $DEBUG == "True" ]];then
set -ex
fi

config_setup
checks

Expand All @@ -17,8 +18,9 @@ envsubst < /home/krkn/kraken/config/config.yaml.template > /home/krkn/kraken/con
# Run Kraken
cd /home/krkn/kraken

cat config/shut_down_config.yaml

cat scenarios/cluster_shut_down_scenario.yml
if [[ $DEBUG == "True" ]];then
cat config/shut_down_config.yaml
cat scenarios/cluster_shut_down_scenario.yml
fi

python3.9 run_kraken.py --config=config/shut_down_config.yaml
10 changes: 5 additions & 5 deletions pvc-scenario/run.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash

set -ex

# Source env.sh to read all the vars
source /home/krkn/main_env.sh
source /home/krkn/env.sh
source /home/krkn/common_run.sh

ls -la /home/krkn/.kube
if [[ $DEBUG == "True" ]];then
set -ex
ls -la /home/krkn/.kube
fi

source /home/krkn/common_run.sh
checks
config_setup

Expand Down
16 changes: 10 additions & 6 deletions service-disruption-scenarios/run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash

set -ex

# Source env.sh to read all the vars
source /home/krkn/main_env.sh
source /home/krkn/env.sh

source /home/krkn/common_run.sh

if [[ $DEBUG == "True" ]];then
set -ex
fi

checks
config_setup

Expand All @@ -17,7 +18,10 @@ envsubst < /home/krkn/kraken/config/config.yaml.template > /home/krkn/kraken/con
# Run Kraken
cd /home/krkn/kraken

cat scenarios/namespace_scenario.yaml
cat config/namespace_config.yaml
if [[ $DEBUG == "True" ]];then
cat scenarios/namespace_scenario.yaml
cat config/namespace_config.yaml
fi


python3.9 run_kraken.py --config=config/namespace_config.yaml
Loading

0 comments on commit c1aef50

Please sign in to comment.