Skip to content

Commit

Permalink
Switch the template dir to reuse common scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyaenr committed Jul 23, 2023
1 parent 9d9fab0 commit 09d55d5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions prow/cpu-hog/prow_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ for node in $(oc get nodes | awk 'NR!=1{print $1}'); do oc get node/$node -o yam
# Label the nodes to target
for node in $(oc get nodes --selector="node-role.kubernetes.io/worker=" | awk ' NR>1 {print $1}'); do oc label node/$node chaos-hog=true; done

# Copy config to kraken
cp node-cpu-hog/input.yaml.template $SCENARIO_FOLDER/input.yaml.template

source node-cpu-hog/env.sh
source env.sh
source common_run.sh
Expand All @@ -33,11 +36,12 @@ checks
config_setup

# Substitute config with environment vars defined
envsubst < node-cpu-hog/input.yaml.template> node-cpu-hog/cpu_hog_scenario.yaml
export SCENARIO_FILE="node-cpu-hog/cpu_hog_scenario.yaml"
#envsubst < node-cpu-hog/input.yaml.template> node-cpu-hog/cpu_hog_scenario.yaml
#export SCENARIO_FILE="node-cpu-hog/cpu_hog_scenario.yaml"
export SCENARIO_FILE="$SCENARIO_FOLDER/input.yaml"
envsubst < config.yaml.template > cpu_hog_config.yaml

# Run Kraken
cat cpu_hog_config.yaml
cat node-cpu-hog/cpu_hog_scenario.yaml
cat $SCENARIO_FOLDER/input.yaml
python3.9 $krkn_loc/run_kraken.py --config=cpu_hog_config.yaml
10 changes: 7 additions & 3 deletions prow/memory-hog/prow_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ for node in $(oc get nodes | awk 'NR!=1{print $1}'); do oc get node/$node -o yam
# Label the nodes to target
for node in $(oc get nodes --selector="node-role.kubernetes.io/worker=" | awk ' NR>1 {print $1}'); do oc label node/$node chaos-hog=true; done

# Copy config to kraken
cp node-memory-hog/input.yaml.template $SCENARIO_FOLDER/input.yaml.template

source node-memory-hog/env.sh
source env.sh
source common_run.sh
Expand All @@ -33,11 +36,12 @@ checks
config_setup

# Substitute config with environment vars defined
envsubst < node-memory-hog/input.yaml.template> node-memory-hog/memory_hog_scenario.yaml
export SCENARIO_FILE="node-memory-hog/memory_hog_scenario.yaml"
#envsubst < node-memory-hog/input.yaml.template> node-memory-hog/memory_hog_scenario.yaml
#export SCENARIO_FILE="node-memory-hog/memory_hog_scenario.yaml"
export SCENARIO_FILE="$SCENARIO_FOLDER/input.yaml"
envsubst < config.yaml.template > memory_hog_config.yaml

# Run Kraken
cat memory_hog_config.yaml
cat node-memory-hog/memory_hog_scenario.yaml
cat $SCENARIO_FOLDER/input.yaml
python3.9 $krkn_loc/run_kraken.py --config=memory_hog_config.yaml

0 comments on commit 09d55d5

Please sign in to comment.