diff --git a/backend/src/apiserver/config/sample_config.json b/backend/src/apiserver/config/sample_config.json index c02a79f149a..de71d94174a 100644 --- a/backend/src/apiserver/config/sample_config.json +++ b/backend/src/apiserver/config/sample_config.json @@ -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" } ] diff --git a/samples/tutorials/DSL - Control structures/DSL - Control structures.py b/samples/tutorials/DSL - Control structures/DSL - Control structures.py index 0c69a27234f..66ff726eca8 100644 --- a/samples/tutorials/DSL - Control structures/DSL - Control structures.py +++ b/samples/tutorials/DSL - Control structures/DSL - Control structures.py @@ -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) @@ -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__':