StepSequence Class
Represents a list of steps in a Pipeline and the order in which to execute them.
Use a StepSequence when initializing a pipeline to create a workflow that contains steps to run in a specific order.
Initialize StepSequence.
- Inheritance
-
builtins.objectStepSequence
Constructor
StepSequence(steps=None)
Parameters
Name | Description |
---|---|
steps
|
The steps for StepSequence. Default value: None
|
steps
Required
|
steps for StepSequence. |
Remarks
A StepSequence can be used to easily run steps in a specific order, without needing to specify data dependencies through the use of PipelineData.
An example to build a Pipeline using StepSequence is as follows:
from azureml.pipeline.core import Pipeline, StepSequence
from azureml.pipeline.steps import PythonScriptStep
prepare_step = PythonScriptStep(
name='prepare data step',
script_name="prepare_data.py",
compute_target=compute
)
train_step = PythonScriptStep(
name='train step',
script_name="train.py",
compute_target=compute
)
step_sequence = StepSequence(steps=[prepare_step, train_step])
pipeline = Pipeline(workspace=ws, steps=step_sequence)
In this example train_step will only run after prepare_step has successfully completed execution.
To run three steps in parallel and then feed them into a fourth step, do the following:
initial_steps = [step1, step2, step3]
all_steps = StepSequence(steps=[initial_steps, step4])
pipeline = Pipeline(workspace=ws, steps=all_steps)