Marek Grzenkowicz
Marek Grzenkowicz

Reputation: 17383

Start execution of existing SageMaker pipeline using Python SDK

SageMaker documentatin explains how to run a pipeline, but it assumes I have just defined it and I have the object pipeline available.

How can I run an existing pipeline with Python SDK?

I know how to read a pipeline with AWS CLI (i.e. aws sagemaker describe-pipeline --pipeline-name foo). Can the same be done with Python code? Then I would have pipeline object ready to use.

Upvotes: 3

Views: 1290

Answers (1)

Marc Karp
Marc Karp

Reputation: 1314

If the Pipeline has been created, you can use the Python Boto3 SDK to make the StartPipelineExecution API call.

response = client.start_pipeline_execution(
    PipelineName='string',
    PipelineExecutionDisplayName='string',
    PipelineParameters=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    PipelineExecutionDescription='string',
    ClientRequestToken='string',
    ParallelismConfiguration={
        'MaxParallelExecutionSteps': 123
    }
)

If you prefer AWS CLI, the most basic call is:

aws sagemaker start-pipeline-execution --pipeline-name <name-of-the-pipeline>

Upvotes: 5

Related Questions