-
Notifications
You must be signed in to change notification settings - Fork 670
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
OnFailurePolicy docs & endtoend tests #356
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
4886f9c
Retryable Workflow
EngHabu 2deac75
Update image
EngHabu 2ba4efb
wip
EngHabu 43ba34c
wip
EngHabu 84233a2
wip
EngHabu 25800c0
wip
EngHabu e147ab4
add run to completion tests
EngHabu 2425284
Update deps
EngHabu eecc31f
Update admin
EngHabu 34ff9d0
Update admin
EngHabu ba568cb
Make kustomize
EngHabu cb8f372
Really update admin-prop
EngHabu 0aeda60
Update admin
EngHabu 90f9bed
update flytetester
EngHabu 9842b45
Update flytester
EngHabu 008fb25
Bigger run-to-completion-wf
EngHabu cf38721
wip
EngHabu c4bf127
Update flytetester
EngHabu 134e4ce
update admin
EngHabu 2ee5061
Update admin
EngHabu f148d37
Fix endtoend tests
EngHabu 9959648
fix trigger
EngHabu a666823
update propeller and admin
EngHabu 7b8568f
Add docs for OnFailurePolicy
EngHabu e5d4d0c
Merge master
EngHabu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
one day we'll figure out how to link to python code... but not this day
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.
Agreed... I really wanted to because I know this will go stale and we will not know