Skip to content

Commit

Permalink
docs: full copy-edit of DAG page (#11943)
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
  • Loading branch information
Anton Gilgur authored Oct 20, 2023
1 parent 3d132d6 commit 0220f4c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
1 change: 0 additions & 1 deletion .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ Dex
EditorConfig
EtcD
EventRouter
FailFast
GitOps
Github
Golang
Expand Down
1 change: 1 addition & 0 deletions docs/doc-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ General guidelines:
* Explain when you would want to use a feature.
* Provide working examples.
* Format code using back-ticks to avoid it being reported as a spelling error.
* Prefer 1 sentence per line of markdown
* Follow the recommendations in the official [Kubernetes Documentation Style Guide](https://kubernetes.io/docs/contribute/style/style-guide/).
* Particularly useful sections include [Content best practices](https://kubernetes.io/docs/contribute/style/style-guide/#content-best-practices) and [Patterns to avoid](https://kubernetes.io/docs/contribute/style/style-guide/#patterns-to-avoid).
* **Note**: Argo does not use the same tooling, so the sections on "shortcodes" and "EditorConfig" are not relevant.
Expand Down
22 changes: 17 additions & 5 deletions docs/walk-through/dag.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# DAG

As an alternative to specifying sequences of steps, you can define the workflow as a directed-acyclic graph (DAG) by specifying the dependencies of each task. This can be simpler to maintain for complex workflows and allows for maximum parallelism when running tasks.
As an alternative to specifying sequences of [steps](steps.md), you can define a workflow as a directed-acyclic graph (DAG) by specifying the dependencies of each task.
DAGs can be simpler to maintain for complex workflows and allow for maximum parallelism when running tasks.

In the following workflow, step `A` runs first, as it has no dependencies. Once `A` has finished, steps `B` and `C` run in parallel. Finally, once `B` and `C` have completed, step `D` can run.
In the following workflow, step `A` runs first, as it has no dependencies.
Once `A` has finished, steps `B` and `C` run in parallel.
Finally, once `B` and `C` have completed, step `D` runs.

```yaml
apiVersion: argoproj.io/v1alpha1
Expand Down Expand Up @@ -43,7 +46,16 @@ spec:
parameters: [{name: message, value: D}]
```
The dependency graph may have [multiple roots](https://github.com/argoproj/argo-workflows/tree/master/examples/dag-multiroot.yaml). The templates called from a DAG or steps template can themselves be DAG or steps templates. This can allow for complex workflows to be split into manageable pieces.
The dependency graph may have [multiple roots](https://github.com/argoproj/argo-workflows/tree/master/examples/dag-multiroot.yaml).
The templates called from a DAG or steps template can themselves be DAG or steps templates, allowing complex workflows to be split into manageable pieces.
The DAG logic has a built-in `fail fast` feature to stop scheduling new steps, as soon as it detects that one of the DAG nodes is failed. Then it waits until all DAG nodes are completed before failing the DAG itself.
The [FailFast](https://github.com/argoproj/argo-workflows/tree/master/examples/dag-disable-failFast.yaml) flag default is `true`, if set to `false`, it will allow a DAG to run all branches of the DAG to completion (either success or failure), regardless of the failed outcomes of branches in the DAG. More info and example about this feature at [here](https://github.com/argoproj/argo-workflows/issues/1442).
## Enhanced Depends
For more complicated, conditional dependencies, you can use the [Enhanced Depends](../enhanced-depends-logic.md) feature.
## Fail Fast
By default, DAGs fail fast: when one task fails, no new tasks will be scheduled.
Once all running tasks are completed, the DAG will be marked as failed.
If [`failFast`](https://github.com/argoproj/argo-workflows/tree/master/examples/dag-disable-failFast.yaml) is set to `false` for a DAG, all branches will run to completion, regardless of failures in other branches.

0 comments on commit 0220f4c

Please sign in to comment.