From 2ea29717bbc15ee0478a0b29c486292b520c917a Mon Sep 17 00:00:00 2001 From: Alexey Volkov <alexey.volkov@ark-kun.com> Date: Thu, 13 Feb 2020 17:17:19 -0800 Subject: [PATCH 1/2] Samples - Add explanation about pipeline failing intentionally --- backend/src/apiserver/config/sample_config.json | 2 +- .../DSL - Control structures/DSL - Control structures.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/src/apiserver/config/sample_config.json b/backend/src/apiserver/config/sample_config.json index c02a79f149a..c536cf29419 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 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__': From 312d1055c98375ef8da7cc845afef55cf2600673 Mon Sep 17 00:00:00 2001 From: Alexey Volkov <alexey.volkov@ark-kun.com> Date: Thu, 13 Feb 2020 17:46:02 -0800 Subject: [PATCH 2/2] Fixed grammar --- backend/src/apiserver/config/sample_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/apiserver/config/sample_config.json b/backend/src/apiserver/config/sample_config.json index c536cf29419..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. This pipeline will randomly fail to demonstrate that exit handler gets executed even in case of failure.", + "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" } ]