-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from FAST-HEP/kreczko-issue-37
Task Dependencies
- Loading branch information
Showing
14 changed files
with
272 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ repos: | |
args: [] | ||
additional_dependencies: | ||
- dill | ||
- jinja2 | ||
- plumbum | ||
- pytest | ||
- pydantic | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Task Dependencies | ||
|
||
By default all tasks are run in sequence and each task takes the output of the | ||
previous task as input. However, you can specify dependencies between tasks to | ||
run them in parallel. | ||
|
||
```yaml | ||
tasks: | ||
- name: "A" | ||
type: "fasthep_flow.operators.BashOperator" | ||
kwargs: | ||
bash_command: echo "A" | ||
- name: "B" | ||
type: "fasthep_flow.operators.BashOperator" | ||
kwargs: | ||
bash_command: echo "B" | ||
- name: "C" | ||
type: "fasthep_flow.operators.BashOperator" | ||
kwargs: | ||
bash_command: echo "C" | ||
dependencies: | ||
- "A" | ||
- name: "D" | ||
type: "fasthep_flow.operators.BashOperator" | ||
kwargs: | ||
bash_command: echo "D" | ||
dependencies: | ||
- "B" | ||
- name: "Y" | ||
type: "fasthep_flow.operators.BashOperator" | ||
kwargs: | ||
bash_command: echo "Y" | ||
dependencies: | ||
- "C" | ||
- "D" | ||
``` | ||
which will create the following flow: | ||
```{mermaid} | ||
flowchart TD | ||
A["A()"] | ||
B["B()"] | ||
C["C(A, str)"] | ||
D["D(B, str)"] | ||
Y["Y(C, D, str)"] | ||
A --> C --> Y | ||
B --> D --> Y | ||
``` | ||
|
||
## Next steps | ||
|
||
This was a very simple example, but it shows the basic concepts of | ||
`fasthep-flow`. For more realistic examples, see the experiment specific | ||
examples in [Examples](./index.md). For more advanced examples, see | ||
[Advanced Examples](../advanced_examples/index.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""THIS IS A DRAFT | ||
Defines the FAST-HEP flow DSL specification. | ||
The DSL defines how a config is interpreted and how the tasks are resolved. | ||
All implementations have to return a valid fasthep_flow.Workflow object. | ||
A particular DSL can be selected with the `version` key in the config: | ||
```yaml | ||
version: v0 | ||
``` | ||
or more explicitly: | ||
```yaml | ||
version: fasthep_flow.dsl.v0 | ||
``` | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from .default import v0 | ||
|
||
__all__ = ["v0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
from . import _v0 as v0 | ||
|
||
__all__ = ["v0"] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.