PipelineRun class

Definition

PipelineRun 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 this 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 PipelineRun.

run_id
str

The run id of the PipelineRun.

Remarks

A PipelineRun object is returned when submitting a Pipeline through submit(config, tags=None, **kwargs). For more information on how to create and submit a Pipeline see the following link: 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>")

Use wait_for_completion(show_output=True, timeout_seconds=9223372036854775807, raise_on_error=True) to monitor the run status and optionally stream run logs.

Use get_status() to fetch the run status.

Use cancel() to cancel an ongoing PipelineRun.

A PipelineRun will generate a StepRun for each step in the Pipeline. Use get_steps() to list the generated StepRuns.

Methods

cancel()

Cancel the ongoing run.

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

Child run for Pipeline run.

complete()

Complete for Pipeline run.

fail()

Fail for Pipeline run.

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)

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.

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)

Child run for 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()

Complete for Pipeline run.

complete()

fail()

Fail for Pipeline run.

fail()

find_step_run(name)

Find a step run in the pipeline by name.

find_step_run(name)

Parameters

name
str

Name of the step to find.

Returns

List of StepRun objects with the provided name.

Return type

<xref:azureml.pipeline.core.list>

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

Run 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

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

Id of the published pipeline

_service_endpoint
str

The endpoint to connect to.

default value: None

Returns

a list of PipelineRun

Return type

<xref:azureml.pipeline.core.list>

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

List of StepRuns

Return type

<xref:azureml.pipeline.core.list>

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)

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)

Parameters

name
str

Name of the published pipeline.

description
str

Description of the published pipeline.

version
str

Version of the published pipeline.

continue_on_step_failure
bool

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

default value: None

Returns

Created published pipeline.

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

show_output=True shows the pipeline run status on sys.stdout.

default value: True
timeout_seconds
int

Number of seconds to wait before timing out.

default value: 9223372036854775807
raise_on_error
bool

raise_on_error=True raises an Error when the Run is in a failed state

default value: True

Returns

The final status.

Return type

str