Specify current runtime arguments using wdl?
Hi! I'm a CWL user coming into using WDL.
Is there a way in wdl to specify the runtime arguments like memory, CPU in the command? Like ${runtime.cpu}? Also is there a way to specify the current working directory or output directory or a temporary directory?
For example, in a command
java -Xmx${runtime.memory}m -Djava.io.tmpdir=${runtime.tmpdir}
-
Hey Bryan,
Thanks for writing in - happy to help here! To start, I will point you to the current WDL spec which lives here: https://github.com/openwdl/wdl/blob/main/versions/1.0/SPEC.md
In WDL workflows, you would specify the runtime arguments in the runtime block rather than in the command. Here is some documentation with descriptions and examples: https://cromwell.readthedocs.io/en/stable/RuntimeAttributes/
Additional information: https://github.com/openwdl/wdl/blob/main/versions/1.0/SPEC.md#runtime-section
The current working directory is set to the /cromwell_root/ in the Google VM by default. If you localize directories to the VM, you can cd to those directories within the task block before running the commands.
You set outputs in the outputs block of the workflow, as shown here: https://github.com/openwdl/wdl/blob/main/versions/1.0/SPEC.md#outputs-section
Finally, it may help to review actual WDL code to get a handle on how it works. I recommend checking out the workflows of our Featured workspaces to get a better sense of how these pieces fit together! You can find those here: https://app.terra.bio/#workspaces?tab=featured
If you have any other questions, please let us know.
Kind regards,
Jason
Please sign in to leave a comment.
Comments
4 comments