From 229d1e5e31a0e631a142a8a62d11a3838f550f5d Mon Sep 17 00:00:00 2001 From: lb584 <lb584@cam.ac.uk> Date: Fri, 19 May 2023 16:00:26 +0100 Subject: [PATCH] modifying docker launch script to pass through optional args from command line --- configs/docker/run/runDockerEWS.sh | 16 ++++++++++------ tests/integration/full/run_tests.sh | 3 ++- tests/integration/partial/run_test_suite.sh | 8 ++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/configs/docker/run/runDockerEWS.sh b/configs/docker/run/runDockerEWS.sh index c293d67..ac41884 100755 --- a/configs/docker/run/runDockerEWS.sh +++ b/configs/docker/run/runDockerEWS.sh @@ -1,10 +1,12 @@ #!/bin/bash set -e +upload='' +islive='' +clearup='' component='not_set' config='/storage/app/EWS_prod/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json' # default rundate=$(date '+%Y%m%d') # default today -optionalArgs="" SHORT=p:c:s:h @@ -29,15 +31,15 @@ do shift 2 ;; --noupload ) - optionalArgs="$optionalArgs --noupload" + upload="--noupload" shift 2; ;; --islive ) - optionalArgs="$optionalArgs --islive" + islive="--islive" shift 2; ;; --clearup ) - optionalArgs="$optionalArgs --clearup" + clearup="--clearup" shift 2; ;; -h | --help) @@ -58,7 +60,7 @@ done function run_coordinator() { printf "component: %s\nconfig: %s\nrundate: %s\n" "$component" "$config" "$rundate" - printf "optional args:\n%s\n" "$optionalArgs" + printf "optional args:\n%s\n" "$upload $islive $clearup" docker container ls; docker exec \ ews_runner \ @@ -66,7 +68,9 @@ function run_coordinator() { -p "$component" \ -c "$config" \ -s "$rundate" \ - "$optionalArgs" + $upload \ + $islive \ + $clearup } run_coordinator diff --git a/tests/integration/full/run_tests.sh b/tests/integration/full/run_tests.sh index dcba288..818284f 100755 --- a/tests/integration/full/run_tests.sh +++ b/tests/integration/full/run_tests.sh @@ -4,7 +4,8 @@ source /storage/app/miniconda3/bin/activate /storage/app/EWS_prod/envs/conda/py3EWS/ -PACKAGES_DIR="../../../../" # assumes run from the tests/integration/partial dir +# assumes run from the tests/integration/full dir, and that all necessary packages are checked out alongside +PACKAGES_DIR="../../../../" flagdir=$PACKAGES_DIR/flagdir epimodel=$PACKAGES_DIR/epimodel diff --git a/tests/integration/partial/run_test_suite.sh b/tests/integration/partial/run_test_suite.sh index 4c57e09..a735b55 100755 --- a/tests/integration/partial/run_test_suite.sh +++ b/tests/integration/partial/run_test_suite.sh @@ -4,7 +4,8 @@ source /storage/app/miniconda3/bin/activate /storage/app/EWS_prod/envs/conda/py3EWS/ -PACKAGES_DIR="../../../../" # assumes run from the tests/integration/partial dir +# assumes run from the tests/integration/partial dir, and that all necessary packages are checked out alongside +PACKAGES_DIR="../../../../" flagdir=$PACKAGES_DIR/flagdir epimodel=$PACKAGES_DIR/epimodel @@ -22,8 +23,3 @@ export PYTHONPATH=$PYTHONPATH:$flagdir:$epimodel:$advisory:$met_processing:$met_ echo $PYTHONPATH python3 -m coverage run run_test_suite.py -#python3 -m unittest test_advisory.py -#python3 -m unittest test_deposition.py -#python3 -m unittest test_env_suit.py -#python3 -m unittest test_epi.py -#python3 -m unittest test_survey.py -- GitLab