Azure / Azure/MachineLearningNotebooks

StepRun state management in Pipeline runtime

Open
#1,549 1 comment 0 reactions 0 assignees View on GitHub
ADO Pipelines product-question
Dominant language
Jupyter Notebook
Stars
4.4k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Consider python azureml-sdk Pipeline with three PythonScriptStep [step_1, step_a, step_b] and edges:

step_a.run_after(step_1)
step_b.run_after(step_1)

where in step_1 runtime "a condition" is checked based on which we want to cancel running step_b but want to continue running pipeline (ie. step_b). Please find a graph appended.
![azure-ml-cancel-step-before-running](https://user-images.githubusercontent.com/12672568/125165187-30807100-e196-11eb-8a14-6391b4889b9d.png)
I tried to implement it in two ways:

_from azureml.core import Run
from azureml.pipeline.core.run import PipelineRun_

1) Deleting node in graph (Is this API executed on instance of Graph object for only this Pipeline run?)

_if a_condition:
run = Run.get_context()
pipeline_run = PipelineRun(run.experiment, run.id)
graph=pipeline_run.get_graph()
for n in graph.nodes:
if n.name =='step_1':
graph.delete_node(n.node_id)_

Nonetheless:
azureml/pipeline/core/graph.py in delete_node(self, node_id)
raise NotImplementedError

2) Having some higher level API in the picture of:
_from azureml.core import Run
from azureml.pipeline.core.run import PipelineRun
if a_condition:
run = Run.get_context()
pipeline_run = PipelineRun(run.experiment, run.id)
step_a_run=pipeline_run.find_step_run(step_a_name)
step_a_run.cancel() #alternatively .fail()_
_step_a_run_ is an empty list as _step_a_ have not started to run. Besides _StepRun_ inherits _cancel()_ after _Run_ so I it cancels entire pipeline.

Is there some work planned in Azure ML Python SDK for Pipeline(or its Graph) steps management during its runtime? Especially this scenario to cancel running selected before it starts to run/prepare?

Its useful when you have highly automated pipelines.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.