-
-
Notifications
You must be signed in to change notification settings - Fork 232
Implement targeted "overrides" of requirements on specific tools #440
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
Conversation
So the current implementation works by overriding the behavior of @get_requirement@, but this only works for leaf nodes and not for overrides applied to workflows or workflow steps. So either:
The benefit of the 2nd approach is that you could, in principal, run multiple instances of the same workflow in the same process, but with different overrides, without loading multiple copies of the workflow/tool files. But it isn't clear we need that right now, and the refactoring is kind of annoying and will make this feature take longer. |
@tetron Option two will be useful later -- we've had request for the equivalent of scattering over requirements, for example. Does the current syntax & option one allow for overriding a specific (sub)step (not to be confused with a specific CommandLineTool) ? |
Yea, I was afraid you'd say that. I agree that it's better to apply it at runtime, just more work. But probably better to do it right than do it quick. I hope to incorporate overrides into a future spec revision. That's an interesting idea, it could allow an expression to support the scatter case. |
Well, I'm not saying no to option 1 -- as long as it is forwards compatible with option 2 :-) |
Implementation of proposal common-workflow-language/common-workflow-language#210 |
bccc138
to
34bef35
Compare
34bef35
to
36032fa
Compare
underlying workflow, cwltool supports requirement "overrides". | ||
|
||
The format of the "overrides" object is a mapping of item identifier (workflow, | ||
workflow step, or command line tool) followed by a list of ProcessRequirements |
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.
Can you add an example of an identifier for a workflow step?
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.
Added some discussion. Also made this more complex (but hopefully more useful) by resolving workflow ids relative to the workflow, and everything else relative to the job/--overrides document.
47d6fdd
to
f48d3c7
Compare
f48d3c7
to
0815a40
Compare
…relative to job document.
af8178e
to
53dd06f
Compare
* Apply requirement overrides at load time * Override identifiers are relative to workflow, other identifiers are relative to job document. * Update documentation
uri = urllib.parse.urljoin(uri, workflowobj["https://w3id.org/cwl/cwl#tool"]) | ||
del cast(dict, jobobj)["https://w3id.org/cwl/cwl#tool"] | ||
|
||
if "http://commonwl.org/cwltool#overrides" in jobobj: |
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.
I think this is over-indented
You can provide an "overrides" section in your document:
cwltool revsort.cwl revsort-ovr-job.json
You can also use --overrides to pull in just the overrides section of a document:
cwltool --overrides revsort-ovr-job.json revsort.cwl revsort-job.json
Currently only works on leaf nodes (CommandLineTool) but intended to generalize to workflows / workflow steps.