AWS Elastic Container Registry (ECR)
AWS supports three authentication methods: OIDC (recommended), IAM service accounts, and access tokens.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. -
Configure
docker_authin yourconfig.yaml:
config.yaml
registry value must match the hostname portion of the image URL.
To use different secret names, configure the
aws_access_key_id_secret_name and aws_secret_access_key_secret_name options
under docker_auth:
config.yaml
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.yaml:
config.yaml
Google Cloud Artifact Registry
GCP supports three authentication methods: OIDC (recommended), service accounts, and access tokens.All three methods also work 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.yaml:
config.yaml
- Configure the
docker_authsection of yourbase_imageto use service account authentication:
config.yaml
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.yaml:
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