AWS Elastic Cloud Registry (ECR)
AWS supports using either service accounts, or access tokens for short-lived container registry authentication.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_<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 access tokens for short-lived access or service accounts for long-lived authentication.This method also works with Google Container Registry (
gcr.io, <region>.gcr.io).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