Skip to content

Commit adf775f

Browse files
authored
AWS/Sagemaker dynamic pipelines (#4232)
* First working prototype - no schedules, no isolated steps, duplicated code * Added support to launch dynamic steps * Resolved code duplication and reworked metadata extraction * Fix use of processing jobs * Fix docstrings * Add metadata for sync dynamic pipeline runs * Code review improvements * Add docs
1 parent dbcfe3f commit adf775f

File tree

5 files changed

+762
-327
lines changed

5 files changed

+762
-327
lines changed

docs/book/component-guide/orchestrators/sagemaker.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Create a custom policy for the execution role that SageMaker will assume:
165165

166166
### Client Permissions (for pipeline submission)
167167

168-
Create a custom policy for the client/user submitting pipelines:
168+
Create a custom policy for the client/user submitting pipelines and training/processing jobs:
169169

170170
```json
171171
{
@@ -183,6 +183,12 @@ Create a custom policy for the client/user submitting pipelines:
183183
"sagemaker:ListPipelineExecutionSteps",
184184
"sagemaker:UpdatePipeline",
185185
"sagemaker:DeletePipeline"
186+
"sagemaker:CreateProcessingJob",
187+
"sagemaker:DescribeProcessingJob",
188+
"sagemaker:StopProcessingJob",
189+
"sagemaker:CreateTrainingJob",
190+
"sagemaker:DescribeTrainingJob",
191+
"sagemaker:StopTrainingJob"
186192
],
187193
"Resource": "*"
188194
},
@@ -206,7 +212,7 @@ Replace `ACCOUNT-ID` and `EXECUTION-ROLE-NAME` with your actual values.
206212
ZenML will build a Docker image called `<CONTAINER_REGISTRY_URI>/zenml:<PIPELINE_NAME>` which includes your code and use it to run your pipeline steps in Sagemaker. Check out [this page](https://docs.zenml.io/how-to/customize-docker-builds/) if you want to learn more about how ZenML builds these images and how you can customize them.
207213
{% endhint %}
208214

209-
You can now run any ZenML pipeline using the Sagemaker orchestrator:
215+
You can now run any ZenML static pipeline or dynamic pipeline using the Sagemaker orchestrator:
210216

211217
```shell
212218
python run.py
@@ -237,6 +243,8 @@ Once the Studio UI has launched, click on the 'Pipeline' button on the left side
237243

238244
![Sagemaker Studio Pipelines](../../.gitbook/assets/sagemakerUI.png)
239245

246+
If you are running dynamic pipelines, you can access the training/processing jobs in the SageMaker UI by clicking on the 'Jobs' button on the left side. From there you can view the jobs that have been launched via ZenML. A training job will be created for each dynamic pipeline run and for each step in the dynamic pipeline marked to run as an isolated step.
247+
240248
### Debugging SageMaker Pipelines
241249

242250
If your SageMaker pipeline encounters an error before the first ZenML step starts, the ZenML run will not appear in the ZenML dashboard. In such cases, use the [SageMaker UI](sagemaker.md#sagemaker-ui) to review the error message and logs. Here's how:
@@ -470,6 +478,10 @@ Note that if you wish to use this orchestrator to run steps on a GPU, you will n
470478

471479
### Scheduling Pipelines
472480

481+
{% hint style="warning" %}
482+
The SageMaker orchestrator does not support scheduling for dynamic pipelines yet.
483+
{% endhint %}
484+
473485
The SageMaker orchestrator supports running pipelines on a schedule using SageMaker's native scheduling capabilities. You can configure schedules in three ways:
474486

475487
* Using a cron expression

0 commit comments

Comments
 (0)