From f5dd585d1eeaddfa8a2282b6a70cc9696ec01904 Mon Sep 17 00:00:00 2001
From: khalid belkhir <khalid.belkhir@univ-montp2.fr>
Date: Mon, 16 Dec 2019 09:06:17 +0100
Subject: [PATCH] Only One file to run workflow in cmdline

---
 deployBigMemCmdLine.sh => RunCmdLine.sh | 15 ++++++++++-----
 deployBigMemInterface.sh                | 11 ++++++++---
 2 files changed, 18 insertions(+), 8 deletions(-)
 rename deployBigMemCmdLine.sh => RunCmdLine.sh (79%)

diff --git a/deployBigMemCmdLine.sh b/RunCmdLine.sh
similarity index 79%
rename from deployBigMemCmdLine.sh
rename to RunCmdLine.sh
index 5afa552..ce90d95 100644
--- a/deployBigMemCmdLine.sh
+++ b/RunCmdLine.sh
@@ -1,17 +1,22 @@
 #!/bin/bash
-#This script will help a deployment of a docker image on an MBB bigmem machine
-
-
+#This script will help to run a workflow in a docker image. 
 
+if [ $# -lt 4 ]
+then
+  echo usage : $0 dataDir resultsDir configFile nbCores '[dockerHub|local]'
+  exit
+fi
 # Docker volumes
 # MBB Workflows reads data from /Data and write results to /Results
 
-
 Data=$1
 Results=$2
 
+if [ ! -d "$Data" ]; then
+  echo "can't find $Data directory !"
+  exit;
+fi
 
-mkdir -p $Data
 mkdir -p $Results
 
 DOCK_VOL+=" --mount type=bind,src=$Data,dst=/Data"
diff --git a/deployBigMemInterface.sh b/deployBigMemInterface.sh
index f416066..11b6bf4 100644
--- a/deployBigMemInterface.sh
+++ b/deployBigMemInterface.sh
@@ -1,7 +1,11 @@
 #!/bin/bash
 #This script will help a deployment of a docker image on an MBB bigmem machine
 
-
+if [ $# -lt 2 ]
+then
+  echo usage : $0 dataDir resultsDir '[dockerHub|local]'
+  exit
+fi
 #nginx 
 ##### nginx install #####
 #sudo apt-get install -y nginx
@@ -81,12 +85,13 @@ CONTAINER_ID=$( docker run --rm -d -p $APP_PORT:3838 $DOCK_VOL $APP_IMG )
 if [ $CONTAINER_ID ]
 then
     echo " "
-    echo You have to put your Data on  : $2
+    echo You have to put your Data on  : $1
     echo " "
-    echo Results will be written to    : $3
+    echo Results will be written to    : $2
     echo " "
     hostname -I | awk -v port=$APP_PORT '{print "You can access the workflow interface at :  http://"$1":"port}'
     echo " "
+    echo To start a Bash session inside the container : docker exec -it $CONTAINER_ID /bin/bash
 else
     echo Failed to run the docker container  !!
 fi
-- 
GitLab