Explorar el Código

Ensure each container gets correct config file

Vecna hace 1 mes
padre
commit
dc42213aec
Se han modificado 3 ficheros con 7 adiciones y 5 borrados
  1. 4 2
      scripts/gen-configs.sh
  2. 2 2
      scripts/run-container.sh
  3. 1 1
      scripts/run-experiments.sh

+ 4 - 2
scripts/gen-configs.sh

@@ -6,10 +6,12 @@ exp_num="$1"
 secrecy="$2"
 harshness="$3"
 prob="$4"
+uuid="$5"
 
-f1="configs/troll_patrol_config.json"
+mkdir -p "configs/${uuid}"
+f1="configs/${uuid}/troll_patrol_config.json"
 cp "${f1}.template" "${f1}"
-f2="configs/simulation_config.json"
+f2="configs/${uuid}/simulation_config.json"
 cp "${f2}.template" "${f2}"
 
 # Troll Patrol config

+ 2 - 2
scripts/run-container.sh

@@ -9,9 +9,9 @@ container=$(docker run --rm -d -i $img)
 # Create results directory if it doesn't already exist
 mkdir -p results/${exp_num}
 
-docker cp configs/troll_patrol_config.json $container:/home/user/troll-patrol/
+docker cp configs/${uuid}/troll_patrol_config.json $container:/home/user/troll-patrol/
 cat configs/troll_patrol_config.json >> "results/${exp_num}/${uuid}"-troll_patrol_config.json
-docker cp configs/simulation_config.json $container:/home/user/simulation/
+docker cp configs/${uuid}/simulation_config.json $container:/home/user/simulation/
 cat configs/simulation_config.json >> "results/${exp_num}/${uuid}"-simulation_config.json
 
 # Run rdsys to give bridges to LA

+ 1 - 1
scripts/run-experiments.sh

@@ -26,7 +26,7 @@ run_docker() {
     # Get a UUID so each simulation run stores its output in a different file
     uuid=$(cat /proc/sys/kernel/random/uuid)
 
-    ./scripts/gen-configs.sh $1 $2 $3 $4
+    ./scripts/gen-configs.sh $1 $2 $3 $4 $uuid
     ./scripts/run-container.sh $1 $uuid
 
     # If harshness = 2, probability of users submitting reports=0.25,