un.py

Read more in the production guide.

CleanupMake sure you no longer need the resources before deleting them. The instructions and commands that follow are DESTRUCTIVE.

Delete any AWS resources you no longer use to avoid additional charges. You'll want to do the following:

# delete the S3 bucket

aws s3 rm s3://your-bucket-name --recursive

aws s3api delete-bucket --bucket your-bucket-name

# delete the SageMaker domain

aws sagemaker delete-domain --domain-id <DOMAIN_ID>

# delete the ECR repository

aws ecr delete-repository --repository-name zenml-repository --force

# detach policies from the IAM role

aws iam detach-role-policy --role-name zenml-role --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess

aws iam detach-role-policy --role-name zenml-role --policy-arn arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryFullAccess

aws iam detach-role-policy --role-name zenml-role --policy-arn arn:aws:iam::aws:policy/AmazonSageMakerFullAccess

# delete the IAM role

aws iam delete-role --role-name zenml-role

Make sure to run these commands in the same AWS region where you created the resources.

By running these cleanup commands, you will delete the S3 bucket, SageMaker domain, ECR repository, and IAM role, along with their associated policies. This will help you avoid any unnecessary charges for resources you no longer need.

Remember to be cautious when deleting resources and ensure that you no longer require them before running the deletion commands.

Conclusion

In this guide, we walked through the process of setting up an AWS stack with ZenML to run your machine learning pipelines in a scalable and production-ready environment. The key steps included:

Setting up credentials and the local environment by creating an IAM role with the necessary permissions.

Creating a ZenML service connector to authenticate with AWS services using the IAM role.

Configuring stack components, including an S3 artifact store, a SageMaker Pipelines orchestrator, and an ECR container registry.