miniwdl icon indicating copy to clipboard operation
miniwdl copied to clipboard

Turning WDL files into executables using shebang

Open prihoda opened this issue 5 years ago • 2 comments

By using a #!/usr/bin/env miniwdl shebang line in our WDL file, we could call simply:

hello.wdl who=Alyssa "who=Ben Bitdiddle" x=41

This gets translated into the following command:

miniwdl hello.wdl who=Alyssa "who=Ben Bitdiddle" x=41

However, miniWDL requires the "cromwell" argument first (miniwdl cromwell hello.wdl). Unfortunately, shebang does not universally support adding another argument, so we cannot do #!/usr/bin/env miniwdl cromwell, we will have to solve it some other way. Personally I think we could create another entrypoint in your setup config, that would create a separate executable (e.g. minicromwell) that would be installed as part of the miniwdl package. The user would use #!/usr/bin/env minicromwell, then the minicromwell executable would only forward all its inputs to miniwdl cromwell.

What do you think? I can create a fork and take a shot at it.

prihoda avatar Jun 14 '19 15:06 prihoda

This is a super neat idea!

| What do you think? I can create a fork and take a shot at it.

Absolutely- I've got a pretty full queue of other development work and community contributions to this project are most welcome. Here are two comments:

  1. miniwdl's own local runner capability will start to come online over the next couple of months, which will have a similar command-line interface under a different subcommand, perhaps miniwdl run. So we should design the new entry point for miniwdl cromwell with an eye to eventually making that available too in some isomorphic way.

  2. I'm also currently hacking on adding tab-completion to miniwdl cromwell using argcomplete, so that the user can get auto-completion both of the available input names and local filesystem paths (for File inputs). I hope we can extend that functionality through this shebang approach too. cc @kislyuk

mlin avatar Jun 14 '19 21:06 mlin

Working draft: https://github.com/chanzuckerberg/miniwdl/pull/164

Not sure if tab completion will work through the shebang approach as well, we can check.

prihoda avatar Jun 17 '19 11:06 prihoda