In some cases, you might want to terminate the pipeline if for example, a metadata value exceeds some set limit. This can be done by using a pipeline property called actions
. The structure for actions
is: when
something happens, check if
the condition is true, and if yes, then
stop the pipeline.
The possible options for when
are:
node-starting
node-complete
node-error
The if
condition can be based either on metadata or a parameter.
Currently, the available option for then
are:
stop-pipeline
to stop the complete pipeline.require-approval
to pause the pipeline until a user goes to manually approve the previous results of the pipeline.
- pipeline:
name: Action pipeline
nodes:
- name: train-model
type: execution
step: Train model
actions:
- when: node-complete
if: metadata.foo >= 0.8
then: stop-pipeline
- name: test-model
type: execution
step: Test model
actions:
- when: node-starting
then: require-approval
edges:
- [train-model.output.model*, test-model.input.model]
Valohai will stop a pipeline if any of the nodes in your pipeline end in error. By default, Tasks will be errored if any of the executions inside it error. You can define a custom on-error behavior for Tasks inside a pipeline. Read more about on-error.
Comments
0 comments
Please sign in to leave a comment.