From 731027bf45e1c29d1a6d462f153f9ff242f64ac1 Mon Sep 17 00:00:00 2001 From: Dane Kennedy Date: Fri, 2 Oct 2026 11:05:08 +0200 Subject: [PATCH] Remove the bash brace group that truncated Cromwell's submit-docker Cromwell wraps submit-docker in a draft-2 WDL `command { ... }` block, which ends at the first closing brace that is not closing one of its own references. The `|| { ...; exit 1; }` group after the pull lock therefore ended the command early and left the sbatch call to be parsed as WDL: Error parsing generated wdl WdlParser$SyntaxError: Unrecognized token: sbatch Report the pull failure with if/fi instead, and document the constraint next to the existing note about braced variable references. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01XvF1yXCjHTqxTHuLLtYmPi --- ansible/roles/compiled/templates/cromwell_slurm.conf | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ansible/roles/compiled/templates/cromwell_slurm.conf b/ansible/roles/compiled/templates/cromwell_slurm.conf index 69fcf98..264f321 100644 --- a/ansible/roles/compiled/templates/cromwell_slurm.conf +++ b/ansible/roles/compiled/templates/cromwell_slurm.conf @@ -34,6 +34,10 @@ backend { # pull the image once into the user's Singularity cache, then run the task # inside it. Bash variables are written bare ($IMAGE), never with braces: # Cromwell interpolates the braced form itself before bash sees the script. + # Cromwell also wraps this string in a WDL command block, which the first + # closing brace that does not end one of its own references terminates + # ("Unrecognized token: sbatch"). So no bash brace groups or brace expansion + # anywhere in the string, shell comments included: use if/fi instead. submit-docker = """ # Cache pulled images per user, on scratch rather than quota-limited $HOME. if [ -z "$SINGULARITY_CACHEDIR" ]; then @@ -67,7 +71,11 @@ backend { && mv $IMAGE.tmp $IMAGE \ && echo "successfully pulled ${docker}!" fi - ) 9>$LOCK_FILE || { echo "Failed to pull ${docker}" >&2; exit 1; } + ) 9>$LOCK_FILE + if [ $? -ne 0 ]; then + echo "Failed to pull ${docker}" >&2 + exit 1 + fi # Submit the script to SLURM. `singularity` here and above comes from the # unversioned `singularity` module that cromwell.lua loads; sbatch exports