PipelineDraft Class

Represents a mutable pipeline which can be used to submit runs and create Published Pipelines.

Use PipelineDrafts to iterate on Pipelines. PipelineDrafts can be created from scratch, another PipelineDraft, or existing pipelines: Pipeline, PublishedPipeline, or PipelineRun.

Initialize PipelineDraft.

Inheritance
builtins.object
PipelineDraft

Constructor

PipelineDraft(workspace, id, name=None, description=None, experiment_name=None, tags=None, properties=None, graph_draft_id=None, parent_pipeline_id=None, parent_pipeline_run_id=None, parent_step_run_ids=None, parent_pipeline_draft_id=None, last_submitted_pipeline_run_id=None, _pipeline_draft_provider=None)

Parameters

Name Description
workspace
Required

The workspace object for this PipelineDraft.

id
Required
str

The ID of the PipelineDraft.

name
Required
str

The name of the PipelineDraft.

description
Required
str

The description of the PipelineDraft.

experiment_name
Required
str

The experiment name for the PipelineDraft.

tags
Required

An optional tags dictionary for the PipelineDraft.

properties
Required

An optional properties dictionary for the PipelineDraft.

graph_draft_id
Required
str

The ID of the graph draft associated with the PipelineDraft.

parent_pipeline_id
Required
str

The ID of the parent PublishedPipeline.

parent_pipeline_run_id
Required
str

The ID of the parent PipelineRun.

parent_step_run_ids
Required

A list of the StepRun ID's of the parent PipelineRun.

parent_pipeline_draft_id
Required
str

The ID of the parent PipelineDraft.

last_submitted_pipeline_run_id
Required
str

The ID of the last submitted PipelineRun.

_pipeline_draft_provider
Required
<xref:azureml.pipeline.core._aeva_provider._AevaPipelineDraftProvider>

(Internal use only.) The PipelineDraft provider.

workspace
Required

Workspace object for this PipelineDraft.

id
Required
str

The id of the PipelineDraft.

name
Required
str

The name of the PipelineDraft.

description
Required
str

The description of the PipelineDraft.

experiment_name
Required
str

The experiment name for the PipelineDraft.

tags
Required

Tags dictionary for the PipelineDraft.

properties
Required

Properties dictionary for the PipelineDraft.

graph_draft_id
Required
str

The id of the graph draft associated with the PipelineDraft.

parent_pipeline_id
Required
str

The id of the parent PublishedPipeline.

parent_pipeline_run_id
Required
str

The id of the parent PipelineRun.

parent_step_run_ids
Required

A list of the StepRun id's of the parent PipelineRun.

parent_pipeline_draft_id
Required
str

The id of the parent PipelineDraft.

last_submitted_pipeline_run_id
Required
str

The id of the last submitted PipelineRun.

_pipeline_draft_provider
Required
<xref:azureml.pipeline.core._aeva_provider._AevaPipelineDraftProvider>

The PipelineDraft provider.

Remarks

A PipelineDraft can be created from a Pipeline by using the create function. An example is below:


   from azureml.pipeline.core import Pipeline, PipelineDraft
   from azureml.pipeline.steps import PythonScriptStep

   train_step = PythonScriptStep(name="Training_Step",
                                 script_name="train.py",
                                 compute_target=aml_compute_target,
                                 source_directory=".")
   pipeline = Pipeline(workspace=ws, steps=[train_step])
   pipeline_draft = PipelineDraft.create(workspace=ws,
                                         name="TestPipelineDraft",
                                         description="draft description",
                                         experiment_name="helloworld",
                                         pipeline=pipeline,
                                         continue_on_step_failure=True,
                                         tags={'dev': 'true'},
                                         properties={'train': 'value'})

PipelineDraft.create()'s pipeline parameter can also be a PublishedPipeline, PipelineRun, or another PipelineDraft.

To submit a run from a PipelineDraft use the submit_run method:


   pipeline_run = pipeline_draft.submit_run()

To update a PipelineDraft use the update method. The update() function of a pipeline draft can be used to update the name, description, experiment name, pipeline parameter assignments, continue on step failure setting and Pipeline associated with the PipelineDraft.


   new_train_step = PythonScriptStep(name="New_Training_Step",
                                     script_name="train.py",
                                     compute_target=aml_compute_target,
                                     source_directory=source_directory)

   new_pipeline = Pipeline(workspace=ws, steps=[new_train_step])

   pipeline_draft.update(name="UpdatedPipelineDraft",
                         description="has updated train step",
                         pipeline=new_pipeline)

Methods

create

Create a PipelineDraft.

delete

Delete the PipelineDraft.

get

Get the PipelineDraft with the given ID.

get_graph

Get the graph associated with the PipelineDraft.

list

Get all pipeline drafts in a workspace.

publish

Publish a PublishedPipeline from the PipelineDraft.

save

Save the PipelineDraft YAML to a file.

submit_run

Submit a PipelineRun from the PipelineDraft.

update

Update a PipelineDraft.

The provided fields will be updated.

create

Create a PipelineDraft.

static create(workspace, pipeline, name=None, description=None, experiment_name=None, pipeline_parameters=None, continue_on_step_failure=None, tags=None, properties=None, _workflow_provider=None, _service_endpoint=None)

Parameters

Name Description
workspace
Required

The workspace object this PipelineDraft will belong to.

pipeline
Required

The published pipeline or pipeline.

name
str

The name of the PipelineDraft; only needed when creating from a Pipeline.

default value: None
description
str

The description of the PipelineDraft; only needed when creating from a Pipeline.

default value: None
experiment_name
str

The experiment name for the PipelineDraft; only needed when creating from a Pipeline.

default value: None
pipeline_parameters

An optional dictionary of pipeline parameter assignments for the PipelineDraft; only needed when creating from a Pipeline.

default value: None
continue_on_step_failure

Indicates whether to continue a PipelineRun when a step run fails setting for the PipelineDraft; only needed when creating from a Pipeline.

default value: None
tags

An optional tags dictionary for the PipelineDraft, only needed when creating from a Pipeline.

default value: None
properties

Optional properties dictionary for the PipelineDraft, only needed when creating from a Pipeline.

default value: None
_service_endpoint
str

The service endpoint.

default value: None
_workflow_provider
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>

(Internal use only.) The workflow provider.

default value: None

Returns

Type Description

The created PipelineDraft.

delete

Delete the PipelineDraft.

delete(_workflow_provider=None)

Parameters

Name Description
_workflow_provider
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>

(Internal use only.) The workflow provider.

default value: None

get

Get the PipelineDraft with the given ID.

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

Parameters

Name Description
workspace
Required

The workspace the PipelineDraft was created in.

id
Required
str

The ID of the PipelineDraft.

_workflow_provider
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>

(Internal use only.) The workflow provider.

default value: None
_service_endpoint
str

The service endpoint.

default value: None

Returns

Type Description

PipelineDraft object

get_graph

Get the graph associated with the PipelineDraft.

get_graph(_workflow_provider=None)

Parameters

Name Description
_workflow_provider
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>

(Internal use only.) The workflow provider.

default value: None

Returns

Type Description

The Graph object.

list

Get all pipeline drafts in a workspace.

static list(workspace, tags=None, _workflow_provider=None)

Parameters

Name Description
workspace
Required

The workspace from which to list drafts.

tags

If specified, returns drafts matching specified {"tag": "value"}.

default value: None
_workflow_provider
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>

(Internal use only.) The workflow provider.

default value: None

Returns

Type Description

A list of PipelineDraft objects.

publish

Publish a PublishedPipeline from the PipelineDraft.

publish(_workflow_provider=None)

Parameters

Name Description
_workflow_provider
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>

(Internal use only.) The workflow provider.

default value: None

Returns

Type Description

The created PublishedPipeline.

save

Save the PipelineDraft YAML to a file.

save(path=None, _workflow_provider=None)

Parameters

Name Description
path
str

The path to save the YAML to. If the path is a directory, the PipelineDraft YAML file is saved at path/pipeline_name.yml. If path is None, the current directory is used.

default value: None
_workflow_provider
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>

(Internal use only.) The workflow provider.

default value: None

Returns

Type Description

submit_run

Submit a PipelineRun from the PipelineDraft.

submit_run(_workflow_provider=None)

Parameters

Name Description
_workflow_provider
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>

(Internal use only.) The workflow provider.

default value: None

Returns

Type Description

The submitted PipelineRun.

update

Update a PipelineDraft.

The provided fields will be updated.

update(pipeline=None, name=None, description=None, experiment_name=None, tags=None, pipeline_parameters=None, continue_on_step_failure=None, _workflow_provider=None)

Parameters

Name Description
pipeline

The updated pipeline for the draft.

default value: None
name
str

The name of the PipelineDraft.

default value: None
description
str

The description of the PipelineDraft.

default value: None
experiment_name
str

The experiment name for the PipelineDraft.

default value: None
tags

A tags dictionary for the PipelineDraft.

default value: None
pipeline_parameters

The pipeline parameter assignments for the PipelineDraft.

default value: None
continue_on_step_failure

Whether to continue PipelineRun when a step run fails setting for the PipelineDraft.

default value: None
_workflow_provider
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>

(Internal use only.) The workflow provider.

default value: None

Attributes

description

Get the description of the PipelineDraft.

Returns

Type Description
str

The description string.

id

Get the ID of the PipelineDraft.

Returns

Type Description
str

The id.

last_submitted_pipeline_run_id

Get the ID of the last submitted PipelineRun of the PipelineDraft.

Returns

Type Description
str

The PipelineRun ID.

name

Tet the name of the PipelineDraft.

Returns

Type Description
str

The name.

parent_pipeline_draft_id

Get the ID of the parent PipelineDraft of the PipelineDraft.

Returns

Type Description
str

The PipelineDraft ID.

parent_pipeline_id

Get the ID of the parent PublishedPipeline of the PipelineDraft.

Returns

Type Description
str

The PublishedPipeline ID.

parent_pipeline_run_id

Get the ID of the parent PipelineRun of the PipelineDraft.

Returns

Type Description
str

The PipelineRun ID.

parent_step_run_ids

Get the list of StepRun IDs of the parent PipelineRun of the PipelineDraft.

Returns

Type Description

A list of StepRun IDs.

properties

Get the properties of the PipelineDraft.

Returns

Type Description

The properties dictionary.

tags

Get the tags of the PipelineDraft.

Returns

Type Description

The tags dictionary.