From efd9728d7d0d13fbb03a66851287dbaa69a172a0 Mon Sep 17 00:00:00 2001
From: lb584 <lb584@cam.ac.uk>
Date: Tue, 9 Jul 2024 11:17:40 +0100
Subject: [PATCH] updating docker run script to work with new config structure

---
 .gitignore                                  |  1 +
 configs/docker/run/launchAndRunDockerEWS.sh | 18 ++++++++++++------
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8e53b5b..223692c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,3 +24,4 @@ dump.csv
 /configs/coordinator/Cred-WRT.json
 /pipeline_resources/SouthAsia/configs/coordinator/an/sys_config_SouthAsia_an_live.json
 /pipeline_resources/SouthAsia/configs/coordinator/fc/sys_config_SouthAsia_fc_live.json
+/pipeline_resources/
diff --git a/configs/docker/run/launchAndRunDockerEWS.sh b/configs/docker/run/launchAndRunDockerEWS.sh
index 9905de1..96565aa 100755
--- a/configs/docker/run/launchAndRunDockerEWS.sh
+++ b/configs/docker/run/launchAndRunDockerEWS.sh
@@ -6,7 +6,8 @@ islive=''
 clearup=''
 component='not_set'
 loglevel='info'
-config='/storage/app/EWS_prod/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json' # default
+sys_config='not_set'
+run_config='not_set'
 rundate=$(date '+%Y%m%d') # default today
 
 
@@ -23,8 +24,12 @@ do
       component="$2"
       shift 2
       ;;
-    -c | --config )
-      config="$2"
+    -sc | --sys_config )
+      sys_config="$2"
+      shift 2
+      ;;
+    -c | --run_config )
+      run_config="$2"
       shift 2
       ;;
     -s | --rundate )
@@ -82,9 +87,9 @@ else
 fi
 
 function run_coordinator() {
-    printf "component: %s\nconfig: %s\nrundate: %s\n" "$component" "$config" "$rundate"
+    printf "component: %s\nconfig: %s\nrundate: %s\n" "$component" "$sys_config" "$run_config" "$rundate"
     printf "optional args:\n%s\n" "$upload $islive $clearup"
-    config_base=`basename $config`
+    config_base=$(basename $run_config)
     printf "%s\n" $config_base
     docker run \
     --rm \
@@ -98,7 +103,8 @@ function run_coordinator() {
     -w "/storage/app/EWS_prod/code" \
     lb584/ews_coordinator \
     "$component_script" \
-    -c "$config" \
+    -sc "$sys_config" \
+    -c "$run_config" \
     -s "$rundate" \
     -l "$loglevel" \
     $upload \
-- 
GitLab