Skip to content
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

Samples - Add explanation about pipeline failing intentionally #3076

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/apiserver/config/sample_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
{
"name": "[Tutorial] DSL - Control structures",
"description": "[source code](https://github.com/kubeflow/pipelines/tree/master/samples/tutorials/DSL%20-%20Control%20structures) Shows how to use conditional execution and exit handlers.",
"description": "[source code](https://github.com/kubeflow/pipelines/tree/master/samples/tutorials/DSL%20-%20Control%20structures) Shows how to use conditional execution and exit handlers. This pipeline will randomly fail to demonstrate that the exit handler gets executed even in case of failure.",
"file": "/samples/tutorials/DSL - Control structures/DSL - Control structures.py.yaml"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ def flipcoin_pipeline():

# %%
@func_to_container_op
def fail_op():
def fail_op(message):
"""Fails."""
import sys
print(message)
sys.exit(1)


Expand All @@ -114,7 +115,7 @@ def flipcoin_exit_pipeline():
print_op('tails and %s <= 15!' % random_num_tail.output)

with dsl.Condition(flip.output == 'tails'):
fail_op()
fail_op(message="Failing the run to demonstrate that exit handler still gets executed.")


if __name__ == '__main__':
Expand Down