Streamline container image management with AWS ECR and ZenML
Enhance your machine learning workflows by leveraging the seamless integration between Amazon Elastic Container Registry (ECR) and ZenML. Store and manage your container images efficiently while enjoying the benefits of a robust container registry solution within your ZenML pipelines.
# Step 1: Install the AWS integration
>>> zenml integration install aws
# Step 2: Register the AWS ECR container registry
>>> zenml container-registry register ecr_registry \
--flavor=aws \
--uri="<ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com"
# Step 3: Update your stack to use the new container registry
>>> zenml stack update -c ecr_registry
# Step 4: Set up authentication (choose one method)
# Method 1: Local Authentication
>>> aws ecr get-login-password --region <REGION> | docker login --username AWS --password-stdin <ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com
# Method 2: AWS Service Connector (recommended)
>>> zenml container-registry connect ecr_registry -i
# Step 5: Validate that your stack has a remote orchestrator in it
# Not all orchestrators require a built image, so in order to use the
# container registry you would need a remote orchestrator/step operator
# used in your stack
>>> zenml stack describe
from zenml import pipeline, step
@step
def example_step():
print("This step will be containerized and pushed to ECR")
@pipeline
def my_pipeline():
example_step()
if __name__ == "__main__":
my_pipeline()
Expand your ML pipelines with more than 50 ZenML Integrations