PublishedPipeline class

Definition

A PublishedPipeline enables a Pipeline to be submitted without the Python code which constructed it.

In addition, a PublishedPipeline can be used to resubmit a Pipeline with different PipelineParameter values and inputs.

PublishedPipeline(name, graph_id, description, version, published_pipeline_id, status, endpoint, total_run_steps, workspace, continue_on_step_failure=None, _pipeline_provider=None)
Inheritance
azureml.core._portal.HasWorkspacePortal
azureml.core._portal.HasPipelinePortal
PublishedPipeline

Parameters

name
str

The name of the published pipeline.

graph_id
str

The id of the graph for this published pipeline

description
str

The description of the published pipeline.

version
str

The published pipeline version.

published_pipeline_id
str

The id of the published pipeline.

status
str

Status of the published pipeline ('Active' or 'Disabled')

total_run_steps
int

Number of steps in this pipeline

workspace
Workspace

The Workspace 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.

_pipeline_provider
_PublishedPipelineProvider

The published pipeline provider.

Remarks

A PublishedPipeline can be created from either a Pipeline or a PipelineRun.

An example to publish from a Pipeline is as follows:


   from azureml.pipeline.core import Pipeline

   pipeline = Pipeline(workspace=ws, steps=steps)
   published_pipeline = pipeline.publish(name="My_New_Pipeline",
                                         description="My New Pipeline Description",
                                         version="1.0",
                                         continue_on_step_failure=True)

To publish from a PipelineRun use:


   from azureml.pipeline.core import PipelineRun

   pipeline_run = PipelineRun(experiment=Experiment(ws, "Pipeline_experiment"), run_id="run_id")
   published_pipeline = pipeline_run.publish_pipeline(name="My_New_Pipeline",
                                                      description="My New Pipeline Description",
                                                      version="1.0",
                                                      continue_on_step_failure=True)

Note: the continue_on_step_failure parameter specifies whether the execution of steps in the Pipeline will continue if one step fails. The default value is False, meaning when one step fails, the Pipeline execution will stop, canceling any running steps.

Submit a PublishedPipeline using submit(config, tags=None, **kwargs). When submit is called, a PipelineRun is created which in turn creates StepRun objects for each step in the workflow.

An example to submit a PublishedPipeline is as follows:


   from azureml.pipeline.core import PublishedPipeline

   published_pipeline = PublishedPipeline.get(workspace=ws, id="published_pipeline_id")
   pipeline_run = experiment.submit(published_pipeline)

There are a number of optional settings that can be specified when submitting a PublishedPipeline. These include:

  • continue_on_step_failure: Whether to continue execution of other steps in the PipelineRun

    if a step fails, optional. If provided, will override the setting on the Pipeline.

  • pipeline_parameters: Parameters to pipeline execution, dictionary of {name: value}.

    See PipelineParameter for more details.

  • parent_run_id: You can supply the run id to set the parent run of this pipeline run.

An example to submit a PublishedPipeline using these settings is as follows:


   from azureml.pipeline.core import PublishedPipeline

   published_pipeline = PublishedPipeline.get(workspace=ws, id="published_pipeline_id")
   pipeline_run = experiment.submit(published_pipeline,
                                    continue_on_step_failure=True,
                                    pipeline_parameters={"param1": "value1"},
                                    parent_run_id="<run_id>")

Methods

disable()

Set the published pipeline to be 'Disabled' and unavailable to run.

enable()

Set the published pipeline to be 'Active' and available to run.

get(workspace, id, _workflow_provider=None, _service_endpoint=None)

Get the published pipeline.

get_all(workspace, active_only=True, _service_endpoint=None)

Get all published pipelines in the current workspace.

NOTE: This method is being deprecated in favor of PublishedPipeline.list()

list(workspace, active_only=True, _service_endpoint=None)

Get all published pipelines in the current workspace.

submit(workspace, experiment_name, pipeline_parameters=None, _workflow_provider=None, _service_endpoint=None, parent_run_id=None, continue_on_step_failure=None)

Submit the published pipeline. This is equivalent to using submit(config, tags=None, **kwargs).

Returns the submitted PipelineRun. Use this object to monitor and view details of the run.

disable()

Set the published pipeline to be 'Disabled' and unavailable to run.

disable()

enable()

Set the published pipeline to be 'Active' and available to run.

enable()

get(workspace, id, _workflow_provider=None, _service_endpoint=None)

Get the published pipeline.

get(workspace, id, _workflow_provider=None, _service_endpoint=None)

Parameters

workspace
Workspace

The workspace the published pipeline was created on.

id
str

Id of the published pipeline.

_workflow_provider
_AevaWorkflowProvider object

The workflow provider.

default value: None
_service_endpoint
str

The service endpoint.

default value: None

Returns

PublishedPipeline object

Return type

get_all(workspace, active_only=True, _service_endpoint=None)

Get all published pipelines in the current workspace.

NOTE: This method is being deprecated in favor of PublishedPipeline.list()

get_all(workspace, active_only=True, _service_endpoint=None)

Parameters

workspace
Workspace

The workspace the published pipeline was created on.

active_only
Bool

If true, only return published pipelines which are currently active.

default value: True
_service_endpoint
str

The service endpoint.

default value: None

Returns

a list of PublishedPipeline

Return type

<xref:azureml.pipeline.core.list>

list(workspace, active_only=True, _service_endpoint=None)

Get all published pipelines in the current workspace.

list(workspace, active_only=True, _service_endpoint=None)

Parameters

workspace
Workspace

The workspace the published pipeline was created on.

active_only
Bool

If true, only return published pipelines which are currently active.

default value: True
_service_endpoint
str

The service endpoint.

default value: None

Returns

a list of PublishedPipeline

Return type

<xref:azureml.pipeline.core.PublishedPipeline.list>

submit(workspace, experiment_name, pipeline_parameters=None, _workflow_provider=None, _service_endpoint=None, parent_run_id=None, continue_on_step_failure=None)

Submit the published pipeline. This is equivalent to using submit(config, tags=None, **kwargs).

Returns the submitted PipelineRun. Use this object to monitor and view details of the run.

submit(workspace, experiment_name, pipeline_parameters=None, _workflow_provider=None, _service_endpoint=None, parent_run_id=None, continue_on_step_failure=None)

Parameters

workspace
Workspace

The workspace to submit the published pipeline on.

experiment_name
str

The name of the experiment to submit to.

pipeline_parameters
dict

Dictionary of parameters to assign new values {param name, param value}. See PipelineParameter for more details.

default value: None
_workflow_provider
_AevaWorkflowProvider

The workflow provider.

default value: None
_service_endpoint
str

The service endpoint.

default value: None
parent_run_id
str

The parent pipeline run id, optional

default value: None
continue_on_step_failure
bool

Whether to continue execution of other steps in the PipelineRun if a step fails, optional. If provided, will override the setting on the Pipeline.

default value: None

Returns

The submitted pipeline run.

Return type

Attributes

continue_on_step_failure

Get the value of the continue_on_step_failure setting.

Returns

The value of the continue_on_step_failure setting

Return type

description

Get the description of the published pipeline.

Returns

The description string.

Return type

str

endpoint

Get REST endpoint url for running a published pipeline.

Returns

REST endpoint for running the published pipeline

Return type

str

graph_id

Get the id of the graph for this published pipeline.

Returns

The id of the graph.

Return type

str

id

Get the Published pipeline id.

Returns

The id of the published pipeline.

Return type

str

name

Name of the published pipeline.

Returns

The published pipeline name.

Return type

str

status

Status of the published pipeline.

Returns

The status.

Return type

str

total_run_steps

Get the number of steps in this pipeline.

Returns

Number of steps

Return type

int

version

Version of the published pipeline.

Returns

The version.

Return type

str