Skip to content

Commit

Permalink
Fix WDL, add debugging prints
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCreosote committed Oct 8, 2024
1 parent 6f89023 commit 7453600
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
32 changes: 20 additions & 12 deletions quast.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ task quast {
command <<<
# Not calling any services so no config file needed
export KBASE_ENDPOINT="http://fakeendpointthatdoesntexist.com"

# Hack to allow the code to run scripts, mounting output could fix this
cp -R /kb/module/scripts scripts
cp /kb/module/deploy.cfg deploy.cfg

# Hack to make the code not write in /kb/module/work, mounting output to work would work here
mkdir work
Expand All @@ -32,29 +36,33 @@ task quast {
# This is an insane hack to make the quast input JSON. It's as minimal as possible here,
# but this isn't workable in general - we need input/output mounting so we can predict the file
# paths and create the JSON serverside at submit time
export quote="\""
echo "quote=$quote"
export file1=~{files[0]}
export file1name=$(basename file1)
QUOTE="\""
echo "quote=$QUOTE"
FILE1=~{files[0]}
export FILE1NAME=$(basename $FILE1)

echo "{\"files\": [" > input.json
echo -n " {\"path\": \"$file1\"," >> input.json
echo -n " {\"path\": \"$FILE1\"," >> input.json
echo -n " \"label\": \"" >> input.json
echo -n $file1name >> input.json
echo -n $quote} >> input.json
echo -n $FILE1NAME >> input.json
echo -n $QUOTE} >> input.json

FILES=('~{sep="' '" files}')
for (( c = 1; c < ~{total}; c++ )); do
FILE=$FILES[$c]
FILE=${FILES[$c]}
FILENAME=$(basename $FILE)
echo , >> input.json
echo -n " {"\path\": \"$FILE\", \"label\": \"$FILENAME\"}">>input.json
echo -n " {\"path\": \"$FILE\", \"label\": \"$FILENAME\"}" >> input.json
done
echo "\n ],\n \"quast_path\": \"$(pwd)/__output__\"">>input.json

echo "" >> input.json
echo " ]," >> input.json
echo " \"quast_path\": \"$(pwd)/__output__\"" >> input.json
echo "}">>input.json

/kb/module/scripts/entrypoint.sh async
# hack to use the copied scripts dir rather than the linked one.
# if work can be mounted as writeable to output I think this isn't needed
./scripts/entrypoint.sh async
EC=$?

echo "Entrypoint exit code: $EC"
Expand Down
3 changes: 3 additions & 0 deletions scripts/run_async.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
script_dir=$(dirname "$(readlink -f "$0")")
echo "script: $0"
echo "script_dir: $script_dir"
export KB_DEPLOYMENT_CONFIG=$script_dir/../deploy.cfg
echo "KB DEPLOY: $KB_DEPLOYMENT_CONFIG"
# Would need input mounting to make this work in JAWS, allowing setting it for now
# WD=/kb/module/work
if [ -f $WD/token ]; then
Expand Down

0 comments on commit 7453600

Please sign in to comment.