From 728f92dcc764001929bbb062766897d30329082f Mon Sep 17 00:00:00 2001 From: "promptless[bot]" <179508745+promptless[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 14:43:20 +0000 Subject: [PATCH 1/2] Documentation updates from Promptless --- serverless/workers/deploy.mdx | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/serverless/workers/deploy.mdx b/serverless/workers/deploy.mdx index 4a37ca63..54bb8594 100644 --- a/serverless/workers/deploy.mdx +++ b/serverless/workers/deploy.mdx @@ -124,6 +124,48 @@ docker push [DOCKER_USERNAME]/[WORKER_NAME]:v1.0.0 Once your image is in the Docker container registry, you can [create a Serverless endpoint](/serverless/endpoints/manage-endpoints#create-an-endpoint) through the Runpod console. +## 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. + +### Requirements for ECR deployment + +* An AWS account with ECR access. +* ECR repository containing your worker image. +* A Runpod API key. + +### 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 update stored credentials. +3. **Use the GraphQL API** to programmatically update credentials. + +### API-based credential management + +To programmatically update credentials in your Lambda function, use the [Runpod GraphQL API](https://graphql-spec.runpod.io/#mutation-saveRegistryAuth):: + +```graphql +mutation SaveRegistryAuth($input: SaveRegistryAuthInput!) { + saveRegistryAuth(input: $input) { + id + name + username + } +} +``` + +This allows your Lambda function to automatically update stored ECR credentials before they expire. + +### 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 in the format: `[AWS_ACCOUNT_ID].dkr.ecr.[REGION].amazonaws.com/[REPOSITORY_NAME]:[TAG]` + ## Image versioning For production workloads, use SHA tags for absolute reproducibility: From 63f2176172a05111350fea1ca6a39fa32407d80d Mon Sep 17 00:00:00 2001 From: Mo King Date: Tue, 15 Jul 2025 10:58:53 -0400 Subject: [PATCH 2/2] Add section for deploying with AWS ECR --- serverless/workers/deploy.mdx | 69 ++++++++++++++--------------------- 1 file changed, 27 insertions(+), 42 deletions(-) diff --git a/serverless/workers/deploy.mdx b/serverless/workers/deploy.mdx index 54bb8594..54f73123 100644 --- a/serverless/workers/deploy.mdx +++ b/serverless/workers/deploy.mdx @@ -124,48 +124,6 @@ docker push [DOCKER_USERNAME]/[WORKER_NAME]:v1.0.0 Once your image is in the Docker container registry, you can [create a Serverless endpoint](/serverless/endpoints/manage-endpoints#create-an-endpoint) through the Runpod console. -## 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. - -### Requirements for ECR deployment - -* An AWS account with ECR access. -* ECR repository containing your worker image. -* A Runpod API key. - -### 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 update stored credentials. -3. **Use the GraphQL API** to programmatically update credentials. - -### API-based credential management - -To programmatically update credentials in your Lambda function, use the [Runpod GraphQL API](https://graphql-spec.runpod.io/#mutation-saveRegistryAuth):: - -```graphql -mutation SaveRegistryAuth($input: SaveRegistryAuthInput!) { - saveRegistryAuth(input: $input) { - id - name - username - } -} -``` - -This allows your Lambda function to automatically update stored ECR credentials before they expire. - -### 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 in the format: `[AWS_ACCOUNT_ID].dkr.ecr.[REGION].amazonaws.com/[REPOSITORY_NAME]:[TAG]` - ## Image versioning For production workloads, use SHA tags for absolute reproducibility: @@ -195,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: