AWS Elastic Container Registry (ECR)
AWS supports OIDC, service accounts, and access tokens for container registry authentication.AWS OIDC (Recommended)
OIDC provides short-lived, narrowly scoped tokens for secure authentication without managing long-lived credentials.- Configure AWS to trust the Baseten OIDC provider and create an IAM role with ECR permissions.
-
Add the OIDC configuration to your
config.yaml:
config.yaml
No secrets needed! The
aws_oidc_role_arn and aws_oidc_region are not sensitive and can be committed to your repository.AWS IAM Service accounts
To use an IAM service account for long-lived access, use theAWS_IAM
authentication method in Truss.
-
Get an
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYfrom the AWS dashboard. -
Add these as secrets in Baseten. Name them
aws_access_key_idandaws_secret_access_key. -
Choose the
AWS_IAMauthentication method when setting up your Truss. Theconfig.yamlfile should look like this:
config.yaml
aws_access_key_id_secret_name and aws_secret_access_key_secret_name options
under docker_auth:
Access Token
- Get the Base64-encoded secret:
-
Add a new secret to Baseten named
DOCKER_REGISTRY_<aws-account-id>.dkr.ecr.<region>.amazonaws.comwith the Base64-encoded secret as the value. -
Add the secret name to the
secretssection ofconfig.yamlto allow this model to access the secret when pushed.
config.yaml
Google Cloud Artifact Registry
GCP supports OIDC, service accounts, and access tokens for container registry authentication.This method also works with Google Container Registry (
gcr.io, <region>.gcr.io).GCP OIDC (Recommended)
OIDC provides short-lived, narrowly scoped tokens for secure authentication without managing long-lived credentials.- Configure GCP Workload Identity to trust the Baseten OIDC provider and grant Artifact Registry permissions.
-
Add the OIDC configuration to your
config.yaml:
config.yaml
No secrets needed! The service account and workload identity provider are not sensitive and can be committed to your repository.
Service Account
- Get your service account key as a JSON key blob.
-
Add a new secret to Baseten named
gcp-service-account(or similar) with the JSON key blob as the value. -
Add the secret name to the
secretssection ofconfig.yamlto allow this model to access the secret when pushed.
config.yaml
- Configure the
docker_authsection of yourbase_imageto use service account authentication:
secret_name must match the secret you created in step 2.
Access Token
- Get your access token.
-
Add a new secret to Baseten named
DOCKER_REGISTRY_<region>-docker.pkg.devwith the Base64-encoded secret as the value. -
Add the secret name to the
secretssection ofconfig.yamlto allow this model to access the secret when pushed.
config.yaml
Docker Hub
- Get the Base64-encoded secret:
- Add a new secret to Baseten named
DOCKER_REGISTRY_https://index.docker.io/v1/with the Base64-encoded secret as the value.
- Add the secret name to the
secretssection ofconfig.yaml:
config.yaml
GitHub Container Registry (GHCR)
-
Create a GitHub Personal Access Token with the
read:packagesscope. Use a classic token, not fine-grained. - Get the Base64-encoded secret:
- Add a new secret to Baseten named
DOCKER_REGISTRY_ghcr.iowith the Base64-encoded secret as the value.
- Add the secret name to the
secretssection ofconfig.yaml:
config.yaml
NVIDIA NGC
- Generate an NGC API Key from your NVIDIA NGC account.
- Get the Base64-encoded secret:
The username
$oauthtoken is a literal string, not a variable. Use it exactly as shown.- Add a new secret to Baseten named
DOCKER_REGISTRY_nvcr.iowith the Base64-encoded secret as the value.
- Add the secret name to the
secretssection ofconfig.yaml:
config.yaml