-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OnFailurePolicy docs & endtoend tests (#356)
* Retryable Workflow * Update image * wip * wip * wip * wip * add run to completion tests * Update deps * Update admin * Update admin * Make kustomize * Really update admin-prop * Update admin * update flytetester * Update flytester * Bigger run-to-completion-wf * wip * Update flytetester * update admin * Update admin * Fix endtoend tests * fix trigger * update propeller and admin * Add docs for OnFailurePolicy
- Loading branch information
Showing
9 changed files
with
75 additions
and
30 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 |
---|---|---|
|
@@ -4,25 +4,24 @@ on: | |
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
end-to-end: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
go-version: [1.10] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Kustomize and diff | ||
run: DELTA_CHECK=true make kustomize | ||
- name: Set up Go@${{ matrix.go-version }} | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Run end-to-end tests | ||
run: make end2end | ||
- uses: engineerd/[email protected] | ||
- name: End2End | ||
env: | ||
DOCKER_USERNAME: ${{ github.actor }} | ||
DOCKER_PASSWORD: "${{ secrets.GITHUB_TOKEN }}" | ||
run: | | ||
kubectl cluster-info | ||
kubectl get pods -n kube-system | ||
echo "current-context:" $(kubectl config current-context) | ||
echo "environment-kubeconfig:" ${KUBECONFIG} | ||
make end2end_execute | ||
docs: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
|
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
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
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 |
---|---|---|
|
@@ -15,3 +15,4 @@ Flyte Features | |
task_cache | ||
roles | ||
single_task_execution | ||
on_failure_policy |
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,45 @@ | ||
.. _on-failuire-policy: | ||
|
||
What is it | ||
========== | ||
|
||
The default behavior for when a node fails in a workflow is to immediately abort the entire workflow. The reasoning behind this thinking | ||
is to avoid wasting resources since the workflow will end up failing anyway. There are certain cases however, when it's desired for the | ||
workflow to carry on executing the branches it can execute. | ||
|
||
For example when the remaining tasks are marked as :ref:`cacheable <features-task_cache>`. | ||
Once the failure has been fixed and the workflow is relaunched, cached tasks will be bypassed quickly. | ||
|
||
How to use it | ||
------------- | ||
|
||
Use on_failure attribute on workflow_class. | ||
|
||
.. code:: python | ||
from flytekit.models.core.workflow import WorkflowMetadata | ||
@workflow_class(on_failure=WorkflowMetadata.OnFailurePolicy.FAIL_AFTER_EXECUTABLE_NODES_COMPLETE) | ||
class RunToCompletionWF(object): | ||
pass | ||
Available values in the policy: | ||
|
||
.. code:: python | ||
class OnFailurePolicy(object): | ||
""" | ||
Defines the execution behavior of the workflow when a failure is detected. | ||
Attributes: | ||
FAIL_IMMEDIATELY Instructs the system to fail as soon as a node fails in the | ||
workflow. It'll automatically abort all currently running nodes and | ||
clean up resources before finally marking the workflow executions as failed. | ||
FAIL_AFTER_EXECUTABLE_NODES_COMPLETE Instructs the system to make as much progress as it can. The system | ||
will not alter the dependencies of the execution graph so any node | ||
that depend on the failed node will not be run. Other nodes that will | ||
be executed to completion before cleaning up resources and marking | ||
the workflow execution as failed. | ||
""" | ||
FAIL_IMMEDIATELY = _core_workflow.WorkflowMetadata.FAIL_IMMEDIATELY | ||
FAIL_AFTER_EXECUTABLE_NODES_COMPLETE = _core_workflow.WorkflowMetadata.FAIL_AFTER_EXECUTABLE_NODES_COMPLETE |