-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Proposal: Task execution graph #26
Comments
Included: - Add deps task option for declaring dependencies on other tasks - Add uses task option for declaring a task dependency where the output of the upstream task should be captured and made available as an environment variable. - Add TaskExecutionGraph for planning execution of tasks with dependencies - modify PoeExecutor to support stdout capture - Add capture_stdout task option to redirect task output to a file. Still to do: - Feature tests for new features
Included: - Add deps task option for declaring dependencies on other tasks - Add uses task option for declaring a task dependency where the output of the upstream task should be captured and made available as an environment variable. - Add TaskExecutionGraph for planning execution of tasks with dependencies - modify PoeExecutor to support stdout capture - Add capture_stdout task option to redirect task output to a file. Still to do: - Feature tests for new features
Included: - Add deps task option for declaring dependencies on other tasks - Add uses task option for declaring a task dependency where the output of the upstream task should be captured and made available as an environment variable. - Add TaskExecutionGraph for planning execution of tasks with dependencies - modify PoeExecutor to support stdout capture - Add capture_stdout task option to redirect task output to a file. Still to do: - Feature tests for new features - Document new features
@kikohs I prototyped a solution and made a beta release: https://pypi.org/project/poethepoet/0.11.0b2/ (also includes experimental implementation of named arguments). It hasn't been extensively tested, but I'm keen to get feedback on how well it works for your use case, and whether you encounter any issues. |
Hi Nat, I didn't forget your message. Just a swarmed at the moment. Thanks for implementing this, I'll let you know. |
Experimental (but reasonably complete) task execution graph released in v0.11.0. |
Another model for task composition (in addition to sequence tasks) would be to support declaring dependencies between tasks, such that invoking a task with dependencies would first run all its dependencies (and their dependencies and so on).
Thus an execution DAG of tasks could easily be defined as in the following
Config proposal A
Config proposal B
Note that in this example scenario the dependency on the test task demonstrates that dep tasks could be passed arguments (or even env vars).
This example also demonstrates the output of one task being captured and made available to the dependant task as an env var hence addressing #21. Since this required silencing (capturing) the output of the dependency, this could allow for multiple tasks to be run in parallel if their dependencies are all satisfied at the same time and neither of them will write to the console (related #24).
This could be particularly powerful if combined with #12 , getting us closer to the power of make.
I've started prototyping this already, but comments are more than welcome.
The text was updated successfully, but these errors were encountered: