Repository navigation
Implement targeted "overrides" of requirements on specific tools - #440
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.
Can you add an example of an identifier for a workflow step?
There was a problem hiding this comment.
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: |
You can provide an "overrides" section in your document:
cwltool revsort.cwl revsort-ovr-job.jsonYou can also use --overrides to pull in just the overrides section of a document:
cwltool --overrides revsort-ovr-job.json revsort.cwl revsort-job.jsonCurrently only works on leaf nodes (CommandLineTool) but intended to generalize to workflows / workflow steps.