-
Notifications
You must be signed in to change notification settings - Fork 735
Typed processes #6368
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
base: master
Are you sure you want to change the base?
Typed processes #6368
Conversation
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
f7dd01a
to
71526ad
Compare
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.
Looking really good. I like the tutorial in particular. I think it's clear and includes the right amount of detail. Also, the order makes sense and it's a good length.
I will take a second pass and nit pick the language. In the meantime, I've added two high level comments. They are very minor.
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.
This a too big change compared to current syntax. I do not support this approach
25a80b1
to
0e7be56
Compare
Updated to use "phase 1" syntax, i.e. support for multiple input channels and tuple inputs |
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.
@bentsherman - I went through the tutorial in detail focusing on the language. I split everything into separate comments to hopefully make it easier to accept/reject.
I found some of the code blocks confusing as when I went into the example repo the code blocks didn't match what was in master branch. I'm fine with using the rnaseq-nf
example and a little bit of difference is okay, but if anyone does what I tried to do it's hard to follow. Can we better align this? Alternatively, can we peel off this example from rnaseq-nf
and start building an repo full of examples specifically for the docs? If might give a little more latitude for v1, v2, v3 of tutorials like this and allow better synergy between what is written and what's in the repo. Happy to hear your thoughts
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
af09783
to
814d40c
Compare
This PR introduces a new syntax for process which uses typed inputs and outputs. The existing syntax is still supported.
This PR refactors several large classes -- namely
ProcessConfig
andTaskProcessor
-- to better separate concerns and enable a v1 / v2 model for process inputs/outputs. When moving existing code to new files, I try to change it as little as possible to not break anything.ProcessConfig refactor
The following new classes were spun out of
ProcessConfig
:ProcessConfigV1
/ProcessConfigV2
extendProcessConfig
with the declared inputs / outputs based on legacy (v1) or typed (v2) semanticsProcessDslV1
/ProcessDslV2
are builder DSLs for legacy / typed process definitionsProcessConfigBuilder
is an adapter for applying process configuration to a process definitionProcessBuilder
is the base builder class used by the above buildersTaskProcessor refactor
The following new classes were spun out of
TaskProcessor
:TaskInputResolver
implements the input file resolution frommakeTaskContextStage2()
TaskOutputResolver
implements the task output resolution logic for typed processesTaskEnvCollector
implements the output env/eval resolution fromcollectOutEnvMap()
TaskFileCollector
implements the output file resolution fromcollectOutFiles()
Typed inputs / outputs
The following new classes implement the new behavior for typed inputs / outputs:
ProcessInputs
andProcessOutputs
replaceInputsList
andOutputsList
from the v1 modelProcessInput
andProcessOutput
replace allInParam
andOutParam
classes from the v1 modelProcessFileInput
andProcessFileOutput
replaceFileInParam
andFileOutParam
in the v1 modelBackwards compatibility
The runtime supports both legacy (v1) and typed (v2) processes by creating the ProcessDef with either a ProcessConfigV1 or ProcessConfigV2.
ProcessDef, TaskProcessor, and TaskRun check this type to determine whether to use v1 or v2 semantics. An
instanceof
check is performed at these decision points:Based on initial work in #4553
TODO: