Skip to main content

Deploy from AWS ECR to VideoSDK Cloud

This guide walks you through building, pushing, and deploying an agent container image stored in AWS Elastic Container Registry (ECR) to VideoSDK Agent Cloud.

You will:

  1. Build your Docker image with the VideoSDK CLI.
  2. Push the image to AWS ECR.
  3. Create an image pull secret in VideoSDK Cloud for ECR.
  4. Deploy your agent using the ECR image and image pull secret.

Prerequisites

  • A working agent project with a Dockerfile.
  • AWS account with permissions to create and push images to ECR.
  • AWS CLI installed and configured (aws configure).
  • VideoSDK CLI installed and authenticated.

1. Build Image with VideoSDK CLI

Use the videosdk agent build command to build your Docker image.

videosdk agent build \
--image 1234567890.dkr.ecr.ap-south-1.amazonaws.com/my-agent:latest

Replace 1234567890 with your AWS account ID, ap-south-1 with your ECR region, and my-agent with your repository name.

2. Push Image to ECR

Authenticate to ECR and push the built image to your ECR repository.

# Login to ECR
aws ecr get-login-password --region ap-south-1 \
| docker login \
--username AWS \
--password-stdin 1234567890.dkr.ecr.ap-south-1.amazonaws.com

# Push using VideoSDK CLI
videosdk agent push \
--image 1234567890.dkr.ecr.ap-south-1.amazonaws.com/my-agent:latest

3. Create Image Pull Secret for ECR

To allow VideoSDK Cloud to pull your private image, you need to create an image pull secret with your ECR credentials.

Obtaining ECR Details

  1. Server URL: Your ECR server URL follows the format: <account-id>.dkr.ecr.<region>.amazonaws.com.
    • Account ID: Find your Account ID in the top-right corner of the AWS Management Console.
    • Region: The Region code (e.g., us-east-1 or ap-south-1) where your ECR repository is located.
  2. Username: Always use AWS for ECR.
  3. Password: This is a temporary authorization token generated by the AWS CLI.

Create the Secret

videosdk agent image-pull-secret my-ecr-secret \
--server 1234567890.dkr.ecr.ap-south-1.amazonaws.com \
-u AWS \
-p $(aws ecr get-login-password --region ap-south-1)

Ensure you have the AWS CLI configured (aws configure) with permissions to access ECR. Replace the account ID and region with your own.

4. Deploy Agent Using ECR Image

Now deploy your agent, referencing both the ECR image and the image pull secret you just created.

videosdk agent deploy \
--image 1234567890.dkr.ecr.ap-south-1.amazonaws.com/my-agent:latest \
--image-pull-secret my-ecr-secret \
--min-replica 1 \
--max-replica 3

Your agent will now run on VideoSDK Cloud using the image stored in AWS ECR.

Got a Question? Ask us on discord