diff --git a/serverless/workers/deploy.mdx b/serverless/workers/deploy.mdx index 4a37ca63..54f73123 100644 --- a/serverless/workers/deploy.mdx +++ b/serverless/workers/deploy.mdx @@ -153,6 +153,33 @@ If your worker fails to start or process requests: 4. Check that your Docker image is compatible with the selected GPU type. 5. Verify your input format matches what your handler expects. +## Deploying from AWS ECR + +You can deploy Serverless workers from AWS Elastic Container Registry (ECR), but this requires additional setup due to ECR's credential expiration policy. + + To deploy from ECR, you'll need: + +* An AWS account with ECR access. +* An ECR repository containing your worker image. +* A Runpod account with [API access](/get-started/api-keys). + +### Setting up credential automation + +ECR credentials expire every 12 hours, so you'll need to automate credential updates. The recommended approach is to use an AWS Lambda function that refreshes your Runpod container registry credentials: + +1. **Create an AWS Lambda function** that runs every few hours to refresh ECR credentials. +2. **Configure the Lambda function** to call Runpod's container registry API to programmatically update stored credentials. + +You can use the Runpod GraphQL API [saveRegistryAuth mutation](https://graphql-spec.runpod.io/#mutation-saveRegistryAuth) to programmatically update credentials in your Lambda function. + +### Deploying your ECR image + +Once you have credential automation in place: + +1. **Push your image to ECR** following standard ECR procedures. +2. **Configure container registry credentials** in the Runpod console with your ECR repository URL and current credentials. +3. **Create your Serverless endpoint** using the ECR image URL for the **Container Image** field: `[AWS_ACCOUNT_ID].dkr.ecr.[REGION].amazonaws.com/[REPOSITORY_NAME]:[TAG]` + ## Next steps After successfully deploying your worker, you can: