-
Notifications
You must be signed in to change notification settings - Fork 306
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
clarify namespacing #340
clarify namespacing #340
Conversation
Hi @DavyCats, thanks for pushing this forward! To be clear, is this saying the JSON key for a subworkflow input should not include the subworkflow name following the call name (as Cromwell currently expects)? If so, I like that on first principles but we probably need to talk about how breaking this is for Cromwell and existing input JSON files. |
@DavyCats I like this as well. The namespacing has always felt a little weird. There are a considerable number of breaking changes currently in the propsosed spec, I wonder if we could do this in a non-breaking way: ie Propose that |
Generally sounds reasonable to me. There might be some dumb corner cases to worry about, for example if the subworkflow has a call given the same name as the subworkflow itself:
Then with the aliasing, |
@mlin I feel like that should be a name collision:
|
Hey @mlin, in the example you gave, wouldnt |
@patmagee I made some adjustments based on your comment. Is this what you had in mind? |
My crappy example #340 (comment) currently validates with both womtool and miniwdl. I'm open to simply declaring them both in spec violation 😎 The section @DavyCats cited might be clarified
Def interested in Cromwell team input here |
Nice work @DavyCats!
Should we also specify inputs here? For example version 1.0
import foo_workflows.wdl as foo_wf
workflow DirtyNamespace {
input {
String foo
}
call foo_wf.foo as foo {
input:
foo=foo
}
}
|
After some consideration of @rhpvorderman's comment and reading the namespaces section a few times, I found that it was a bit hard to follow (it doesn't clearly define what a namespace is) and thus decided to rewrite it entirely. It also contained some notes about imports, which seemed redundant and out of place, which I have now removed. My intend is for the specifications to be the same as before, just spelled out a bit more clearly. Please let me know if this should be changed (or reverted). |
There's a branch on miniwdl which (i) prevents calls from having the same name as their containing workflow and (ii) attempts to delete the subworkflow name from the input JSON keys. Seems OK so far |
To supply an optional input for a subworkflow call, Cromwell input JSON expects the key to include (i) the workflow name, (ii) the call name, (iii) the subworkflow name, and finally (iv) the input name. The need to include (iii) the subworkflow name is questionable, as discussed on openwdl/wdl#340 This change makes miniwdl accept such inputs either with or without the subworkflow name, by removing it if it's present. To ensure unambiguous resolution, also forbids collision between a call's name and that of its containing workflow. #193
Sorry that I didn't spot this PR earlier - what you found in Cromwell looks like a bug rather than intended design since Cromwell (and WDL!) never intentionally allowed passing inputs through to subworkflow calls from input json. Since #347 is addressing that - and in theory we'll be "adding" it for the first time, I'd be inclined to remove the "backwards-compatible-with-a-bug" option and define this as the only logical (at least to me...) syntax of |
Thanks @cjllanwarne, I guess it was a common misconception that inputs could be passed to sub workflows through the inputs json. I have removed the "backwards-compatible-with-a-bug" option. |
Can #347 be closed if this is accepted? I think so. @DavyCats what do you think? Also. I think we should get this into voting. I believe Cromwell EDIT: Cromwell 48 has already been released yesterday. |
I'm not sure, the changes in #347 should still be made I think but we could fold it into this PR. This PR doesn't (in its current state) alter the fact that the spec explicitly disallows the provision of inputs to subworkflows by the end-user. |
Well in that case we can also take the time to carefully evaluate this PR and make sure #347 is merged quickly. |
@DavyCats is this ready for voting? |
@patmagee Yes, I believe so |
👍 |
@mlin @cjllanwarne @jdidion before I pass this and merge, can you please give your final thoughts on it |
versions/development/SPEC.md
Outdated
@@ -185,7 +185,7 @@ workflow wf { | |||
|
|||
This describes a task, called 'hello', which has two parameters (`String pattern` and `File in`). A `task` definition is a way of **encapsulating a UNIX command and environment and presenting them as functions**. Tasks have both inputs and outputs. Inputs are declared as declarations at the top of the `task` definition, while outputs are defined in the `output` section. | |||
|
|||
The user must provide a value for these two parameters in order for this task to be runnable. Implementations of WDL should accept their [inputs as JSON format](#specifying-workflow-inputs-in-json). For example, the above task needs values for two parameters: `String pattern` and `File in`: | |||
The user must provide a value for these two parameters in order for this task to be runnable. Implementations of WDL should accept their [inputs as JSON format](#specifying-workflow-inputs-in-json). The inputs described in such a JSON file should be fully qualified according to the namespacing rules described in the [Fully Qualified Names & Namespaced Identifiers](#fully-qualified-names--namespaced-identifiers) section. For example, the above task needs values for two parameters: `String pattern` and `File in`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/should/must/
versions/development/SPEC.md
Outdated
} | ||
``` | ||
The following namespaces exist: | ||
* A WDL file: When imported the name equals that of the basename of the file by default, but may be aliased using the `as identifier` syntax. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add link to relevant place in the spec
* A WDL file: When imported the name equals that of the basename of the file by default, but may be aliased using the `as identifier` syntax. | ||
* May contain namespaces, tasks, structs (please see the notes at [Importing Structs](#importing-structs)) and at most one workflow. | ||
* A call (of a task or workflow): The name equals that of the called task or workflow by default, but may be aliased using the `as identifier` syntax. | ||
* May contain inputs, outputs, runtime_attributes (if the call is to a task), variables (accessibility limited by [scope](#scope)) and calls (if the call is to a workflow). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add link to relevant place in the spec
👍 with minor comments |
LGTM, my only comment re @jdidion on the JSON is that the first namespace -- the name of the top-level workflow being run -- doesn't constrain or disambiguate anything, so I think it's nice to leave a little wiggle room to omit it from the JSON keys. |
I addressed your comments @jdidion. |
This is in v1.1 and will be propagated to development. |
This PR aims to clarify the namespacing of calls to workflows. Currently miniwdl and cromwell handle this differently (at least in the input JSON; see also #329), so some clarification seems to be needed in the spec.
Pinging @mlin and @cjllanwarne as engine implementers.