Skip to content

Fix Cromwell submit-docker: remove the brace group that truncated the command - #193

Merged
kennedydane merged 1 commit into
masterfrom
fix/cromwell_2
Oct 2, 2026
Merged

kennedydane merged 1 commit into
masterfrom
fix/cromwell_2

Conversation

@kennedydane

Copy link
Copy Markdown
Collaborator

What does this PR do?

Fixes docker-attribute tasks failing under the Cromwell 92 install (#189) with:

Error parsing generated wdl
WdlParser$SyntaxError: Unrecognized token:
            sbatch

Cromwell does not run submit-docker as a plain shell script. It wraps the string in a
generated draft-2 WDL task as command { ... }, and that lexer ends the command block at the
first closing brace that is not closing one of its own ${...} references. The
|| { echo ...; exit 1; } group after the image-pull lock therefore ended the command early,
and the sbatch \ call further down was parsed as task-level WDL.

Changes, both in ansible/roles/compiled/templates/cromwell_slurm.conf:

  • Report a failed pull with if [ $? -ne 0 ]; then ... fi instead of the brace group. Same
    behaviour: message to stderr, exit 1.
  • Extend the comment above submit-docker to state the constraint (no bare closing brace
    anywhere in the string, shell comments included) and name the error it causes.

The plain submit block was not affected.

Checklist

  • Linters pass locally: cd ansible && uv run yamllint . && uv run ansible-lint
    (ansible-lint reaches Profile 'production' ... passed).
  • CI is green on this PR.

Notes for the maintainer

  • Not reproduced against a running Cromwell. The cause was confirmed from the Cromwell 92
    source (ConfigWdlNamespace.makeWdlSource and the draft-2 lexer's command rules), and a
    script applying that lexer rule flags the old line and finds nothing in the fixed template;
    bash -n passes on both submit strings. The linters do not cover .conf templates.
  • The installed slurm.conf needs re-rendering on the cluster:
    ansible-playbook site.yaml -t cromwell,cromwell92, then submit a task with a docker
    runtime attribute to confirm.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XvF1yXCjHTqxTHuLLtYmPi

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XvF1yXCjHTqxTHuLLtYmPi
Copilot AI balanced review requested due to automatic review settings October 2, 2026 09:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused change preserves failure behavior and removes all bare closing braces from submit-docker.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes Cromwell Docker submissions by avoiding a brace group that prematurely terminates generated WDL.

Changes:

  • Replaces brace-group error handling with if/fi.
  • Documents the WDL brace constraint.
File Description
ansible/​roles/​compiled/​templates/​cromwell_slurm.conf Corrects image-pull failure handling and documents WDL parsing constraints.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@kennedydane
kennedydane requested a review from MikeCTZA October 2, 2026 09:17
@kennedydane
kennedydane merged commit f85b722 into master Oct 2, 2026
2 checks passed
@kennedydane
kennedydane deleted the fix/cromwell_2 branch October 2, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants