PipelineRun class

Definition

Represents a run of a Pipeline.

This class can be used to manage, check status, and retrieve run details once a pipeline run is submitted. Use get_steps() to retrieve the StepRun objects which are created by the pipeline run. Other uses include retrieving the Graph object associated with the pipeline run, fetching the status of the pipeline run, and waiting for run completion.

PipelineRun(experiment, run_id, _service_endpoint=None)
Inheritance
azureml._run_impl.run_base._RunBase
PipelineRun

Parameters

experiment
Experiment

The experiment object associated with the pipeline run.

run_id
str

The run ID of the pipeline run.

_service_endpoint
str

The endpoint to connect to.

Remarks

A PipelineRun object is returned when submitting a Pipeline through the submit(config, tags=None, **kwargs). method of an Experiment. For more information on how to create and submit a Pipeline see: https://aka.ms/pl-first-pipeline.

A PipelineRun can also be instantiated with the Experiment the run was submitted to and the PipelineRun ID as follows:


   from azureml.core import Experiment
   from azureml.pipeline.core import PipelineRun

   experiment = Experiment(workspace, "<experiment_name>")
   pipeline_run = PipelineRun(experiment, "<pipeline_run_id>")

When working with PipelineRun use:

Methods

cancel()

Cancel the ongoing run.

child_run(name=None, run_id=None, outputs=None)

Create a child run for the pipeline run.

complete()

Mark the pipeline run as complete.

This method is not supported for pipelines; completion/failed status is managed by the Azure ML backend.

fail()

Mark the the pipeline run as failed.

This method is not supported for pipelines; completion/failed status is managed by the Azure ML backend.

find_step_run(name)

Find a step run in the pipeline by name.

get(workspace, run_id, _service_endpoint=None)

Fetch a pipeline run based on a run ID.

get_graph()

Get the graph of the pipeline run.

get_pipeline_output(pipeline_output_name)

Get the PortDataReference for the given pipeline output.

get_pipeline_runs(workspace, pipeline_id, _service_endpoint=None)

Fetch the pipeline runs that were generated from a published pipeline.

get_status()

Get the current status of the pipeline run.

get_steps()

Get the step runs for all pipeline steps that have completed or started running.

get_tags()

Get the set of tags for the run.

publish_pipeline(name, description, version, continue_on_step_failure=None, **kwargs)

Publish a pipeline and make it available for rerunning.

The original pipeline associated with the pipeline run is used as the base for the published pipeline.

save(path=None)

Save the pipeline YAML to a file.

wait_for_completion(show_output=True, timeout_seconds=9223372036854775807, raise_on_error=True)

Wait for the completion of this pipeline run.

Returns the status after the wait.

cancel()

Cancel the ongoing run.

cancel()

child_run(name=None, run_id=None, outputs=None)

Create a child run for the pipeline run.

child_run(name=None, run_id=None, outputs=None)

Parameters

name
str

Optional name for the child.

default value: None
run_id
str

Optional run ID for the child, otherwise uses default.

default value: None
outputs
str

Optional outputs directory to track for the child.

default value: None

Returns

The child run.

Return type

Run

complete()

Mark the pipeline run as complete.

This method is not supported for pipelines; completion/failed status is managed by the Azure ML backend.

complete()

fail()

Mark the the pipeline run as failed.

This method is not supported for pipelines; completion/failed status is managed by the Azure ML backend.

fail()

find_step_run(name)

Find a step run in the pipeline by name.

find_step_run(name)

Parameters

name
str

The name of the step to find.

Returns

List of StepRun objects with the provided name.

Return type

get(workspace, run_id, _service_endpoint=None)

Fetch a pipeline run based on a run ID.

get(workspace, run_id, _service_endpoint=None)

Parameters

workspace
Workspace

The workspace associated with the pipeline.

run_id
str

The ID of the pipeline run.

_service_endpoint
str

The endpoint to connect to.

default value: None

Returns

The PipelineRun object.

Return type

get_graph()

Get the graph of the pipeline run.

get_graph()

Returns

The graph.

Return type

get_pipeline_output(pipeline_output_name)

Get the PortDataReference for the given pipeline output.

get_pipeline_output(pipeline_output_name)

Parameters

pipeline_output_name
str

The name of the pipeline output to get.

Returns

The PortDataReference representing the pipeline output data.

Return type

get_pipeline_runs(workspace, pipeline_id, _service_endpoint=None)

Fetch the pipeline runs that were generated from a published pipeline.

get_pipeline_runs(workspace, pipeline_id, _service_endpoint=None)

Parameters

workspace
Workspace

The workspace associated with the pipeline.

pipeline_id
str

The ID of the published pipeline.

_service_endpoint
str

The endpoint to connect to.

default value: None

Returns

A list of PipelineRun objects.

Return type

get_status()

Get the current status of the pipeline run.

get_status()

Returns

The run status.

Return type

str

get_steps()

Get the step runs for all pipeline steps that have completed or started running.

get_steps()

Returns

A list of StepRun objects.

Return type

get_tags()

Get the set of tags for the run.

get_tags()

Returns

The dictionary of tags for the run.

Return type

publish_pipeline(name, description, version, continue_on_step_failure=None, **kwargs)

Publish a pipeline and make it available for rerunning.

The original pipeline associated with the pipeline run is used as the base for the published pipeline.

publish_pipeline(name, description, version, continue_on_step_failure=None, **kwargs)

Parameters

name
str

The name of the published pipeline.

description
str

The description of the published pipeline.

version
str

The version of the published pipeline.

continue_on_step_failure
bool

Whether to continue execution of other steps in the PipelineRun if a step fails. The default is False.

default value: None
kwargs
dict

Custom keyword arguments, reserved for future development

Returns

Created published pipeline.

Return type

save(path=None)

Save the pipeline YAML to a file.

save(path=None)

Parameters

path
str

The path to save the YAML to. If the path is a directory, the pipeline YAML file is saved at /<pipeline_name>.yml. If path is none, the current directory is used.

default value: None

Return type

wait_for_completion(show_output=True, timeout_seconds=9223372036854775807, raise_on_error=True)

Wait for the completion of this pipeline run.

Returns the status after the wait.

wait_for_completion(show_output=True, timeout_seconds=9223372036854775807, raise_on_error=True)

Parameters

show_output
bool

Indicates whether to show the pipeline run status on sys.stdout.

default value: True
timeout_seconds
int

The number of seconds to wait before timing out.

default value: 9223372036854775807
raise_on_error
bool

Indicates whether to raise an error when the run is in a failed state.

default value: True

Returns

The final status.

Return type

str