From 61a6fefc513cce7536902b04f817831fa9f08a80 Mon Sep 17 00:00:00 2001 From: Alexander Fillbrunn Date: Mon, 29 Oct 2018 10:20:06 +0100 Subject: [PATCH 1/4] Fixed access to the features file when calling --info --- run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.sh b/run.sh index da589d4..796de21 100755 --- a/run.sh +++ b/run.sh @@ -27,7 +27,7 @@ elif [ "$workflow" = "--info" ]; then echo "-----------------------------------------------------" echo "Installed features:" echo "-----------------------------------------------------" - cat features + cat /payload/meta/features execute=0 elif [ "$workflow" = "--help" ]; then echo "Help:" From a473a8cb602fa1e8f840541e9ec26eae1e07fd6d Mon Sep 17 00:00:00 2001 From: Alexander Fillbrunn Date: Mon, 29 Oct 2018 10:22:56 +0100 Subject: [PATCH 2/4] Fixed some error messages. --- run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index 796de21..7fc1ecb 100755 --- a/run.sh +++ b/run.sh @@ -47,7 +47,7 @@ n=$(find /payload/workflow -name "dockermeta.knime" |wc -l) #check for amount of workspace if [ $n == 0 ]; then - echo "NON WORKSPACE FOUND. Check if the workflow directory is correctly specified" + echo "No workflow found. Check if the workflow directory was correctly specified during the build." elif [ $n == 1 ]; then wrk="${@:1}" workflow="" @@ -59,7 +59,7 @@ elif [ $n -gt 1 ]; then # Check if file exists if [[ $execute == 1 && ! -f "/payload/workflow/$workflow/dockermeta.knime" ]] then - >&2 echo "Workflow not found. Check the name of the workflow." + >&2 echo "Workflow not found. Check the workflow name. Run the image with --info to see the contained workflows." n=0 fi fi From 643412e834365cc4daaf790d2030b502270fbb3d Mon Sep 17 00:00:00 2001 From: Alexander Fillbrunn Date: Mon, 29 Oct 2018 10:36:50 +0100 Subject: [PATCH 3/4] Removed the "/payload/" prefix in --info and --vars The user should not specify this when running a workflow. When it is shown in the info, it is confusing. --- run.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/run.sh b/run.sh index 7fc1ecb..4e8ba25 100755 --- a/run.sh +++ b/run.sh @@ -12,7 +12,9 @@ if [ "$workflow" = "--vars" ]; then echo "Workflow variables needed for executing the workflows:" echo "-----------------------------------------------------" while IFS= read -r -d $'\0'; do - echo "$(dirname ${REPLY#./workflow/})" + # Cut off the "/payload/"" part because the user does not have to specify it + name="$(dirname ${REPLY#./workflow/})" + echo "${name:9}" echo -e 'Name\tType\tDefault Value' cat "$REPLY" | tr ':' '\t' echo "========" @@ -22,7 +24,8 @@ elif [ "$workflow" = "--info" ]; then echo "Workflows:" echo "-----------------------------------------------------" while IFS= read -r -d $'\0'; do - echo "$(dirname ${REPLY#./workflow/})" + name="$(dirname ${REPLY#./workflow/})" + echo "${name:9}" done < <(find "/payload/workflow" -name dockermeta.knime -print0) echo "-----------------------------------------------------" echo "Installed features:" @@ -64,7 +67,6 @@ elif [ $n -gt 1 ]; then fi fi - if [[ $execute == 1 && $n -gt 0 ]] ; then for var in $wrk do From 3998a8ac776c4b272ce5b5609aec44fee420045e Mon Sep 17 00:00:00 2001 From: Alexander Fillbrunn Date: Mon, 29 Oct 2018 11:17:16 +0100 Subject: [PATCH 4/4] Fixed workflow paths When there are multiple workflows the whole "/payload/workflow/" prefix has to be removed from the --vars and --info output. Additionally, adjusted help text to display correct instructions for the single workflow case. --- run.sh | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/run.sh b/run.sh index 4e8ba25..ed89e96 100755 --- a/run.sh +++ b/run.sh @@ -7,26 +7,31 @@ args=() workflow=$1 declare -i multi_wrk=0 declare -i execute=1 +n=$(find /payload/workflow -name "dockermeta.knime" |wc -l) if [ "$workflow" = "--vars" ]; then echo "Workflow variables needed for executing the workflows:" echo "-----------------------------------------------------" while IFS= read -r -d $'\0'; do - # Cut off the "/payload/"" part because the user does not have to specify it - name="$(dirname ${REPLY#./workflow/})" - echo "${name:9}" + # Cut off the "/payload/workflow/" part because the user does not have to specify it. + if [ $n -gt 1 ]; then + name="$(dirname ${REPLY#./workflow/})" + echo "${name:18}" + fi echo -e 'Name\tType\tDefault Value' cat "$REPLY" | tr ':' '\t' echo "========" done < <(find "/payload/workflow" -name dockermeta.knime -print0) execute=0 elif [ "$workflow" = "--info" ]; then - echo "Workflows:" - echo "-----------------------------------------------------" - while IFS= read -r -d $'\0'; do - name="$(dirname ${REPLY#./workflow/})" - echo "${name:9}" - done < <(find "/payload/workflow" -name dockermeta.knime -print0) + if [ $n -gt 1 ]; then + echo "Workflows:" + echo "-----------------------------------------------------" + while IFS= read -r -d $'\0'; do + name="$(dirname ${REPLY#./workflow/})" + echo "${name:18}" + done < <(find "/payload/workflow" -name dockermeta.knime -print0) + fi echo "-----------------------------------------------------" echo "Installed features:" echo "-----------------------------------------------------" @@ -35,19 +40,26 @@ elif [ "$workflow" = "--info" ]; then elif [ "$workflow" = "--help" ]; then echo "Help:" echo "To run the image and mount a folder in the container:" - echo "docker run -v : =" - echo "Eg: docker run -v /User/MyUser/Documents/Data:/data myworkflowGroup mySubGroup/myworkflow input_file=test.csv" + if [ $n -gt 1 ]; then + echo "docker run -v : =" + echo "Eg: docker run -v /User/MyUser/Documents/Data:/data myworkflowGroup mySubGroup/myworkflow input_file=test.csv" + echo "" + echo "To list contained workflows and installed features:" + echo "docker run -rm --info" + elif [ $n == 1 ]; then + echo "docker run -v : =" + echo "Eg: docker run -v /User/MyUser/Documents/Data:/data myworkflowGroup input_file=test.csv" + echo "" + echo "To list installed features:" + echo "docker run -rm --info" + fi echo "" echo "To list the workflows' variables:" echo "docker run -rm --vars" - echo "" - echo "To list contained workflows and installed features:" - echo "docker run -rm --info" + execute=0 fi -n=$(find /payload/workflow -name "dockermeta.knime" |wc -l) - #check for amount of workspace if [ $n == 0 ]; then echo "No workflow found. Check if the workflow directory was correctly specified during the build."