Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track input json filename in workflows table (as alias) #129

Open
wants to merge 1 commit into
base: legacy_cromshell
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions cromshell
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ function populateLastWorkflowId()

function aliasExists(){
alias_name=${1}
grep -q "\\t${alias_name}\$" ${CROMWELL_SUBMISSIONS_FILE}
grep -P -q "\\t${alias_name}\$" ${CROMWELL_SUBMISSIONS_FILE}
}

function alias_workflow()
Expand Down Expand Up @@ -730,14 +730,18 @@ function waitOnSubmittedStatus()
function submit()
{
local doWait=false
local saveInputJsonAsAlias=false

# Handle Arguments:
local OPTIND
while getopts "w" opt ; do
while getopts "wa" opt ; do
case ${opt} in
w)
doWait=true
;;
a)
saveInputJsonAsAlias=true
;;
*)
invalidSubCommand submit flag ${OPTARG}
;;
Expand All @@ -763,6 +767,14 @@ function submit()
assertRequiredFileIsNonEmpty "${json}" "Input JSON"

# At this point, we should validate our inputs if we can:
if $saveInputJsonAsAlias; then
local workflowAlias=$(basename ${json})
if aliasExists ${workflowAlias}; then
echo -e "Alias ${workflowAlias} is already in use. Please pick a new alias."
exit 8
fi
fi

which womtool &> /dev/null
local r=$?
if [[ ${r} -eq 0 ]] ; then
Expand Down Expand Up @@ -825,7 +837,11 @@ function submit()

cp ${1} ${2} ${3} ${4} ${runDir}/

echo -e "$(date +%Y%m%d_%H%M%S)\t${CROMWELL_URL}\t${id}\t$(basename ${1})\tSubmitted" >> ${CROMWELL_SUBMISSIONS_FILE}
if $saveInputJsonAsAlias ; then
workflowAlias="\t${workflowAlias}"
fi

echo -e "$(date +%Y%m%d_%H%M%S)\t${CROMWELL_URL}\t${id}\t$(basename ${1})\tSubmitted${workflowAlias}" >> ${CROMWELL_SUBMISSIONS_FILE}

# Now that we've submitted our task, we should see if we have to wait:
if ${doWait} ; then
Expand Down