Cloud Deployment Guide
The supervaizer deploy command builds your Supervaizer agent as a Docker image. It pushes the image to the registry of the platform and starts the service.
Install the Supervaizer integration skill in your coding agent, open your agent project and ask:
Deploy this controller to the cloud.
The skill asks you the design questions, then follows this guide and the Hello World example, with tests. The rest of this page is what it reads.
Overview
The deployment CLI supports three cloud platforms:
- GCP Cloud Run - Serverless container platform
- AWS App Runner - Fully managed container service
- DigitalOcean App Platform - Container-based app hosting
The workflow has five steps:
Test Locally - Run your agent with Docker before you deploy
Deploy - Build, push, and deploy the service
Monitor - Check the status and the health
Cleanup - Remove the deployment
Prerequisites
Install the deploy extra
The deploy commands need the deploy extra of the package.
pip install "supervaizer[deploy]"
Run the commands in a directory that has a pyproject.toml file. A parent directory up to three levels above also works. Declare the Python dependencies of your agent in this file.
Cloud Provider Setup
Before you use the deployment CLI, complete the setup for your platform.
- GCP Cloud Run
- AWS App Runner
- DigitalOcean App Platform
Install and Authenticate
# Install Google Cloud CLI
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
# Authenticate
gcloud auth login
gcloud auth application-default login
# Set project
gcloud config set project YOUR_PROJECT_ID
# Enable required APIs
gcloud services enable run.googleapis.com
gcloud services enable secretmanager.googleapis.com
gcloud services enable artifactregistry.googleapis.com
Required Permissions
Your account needs these IAM roles:
Cloud Run AdminSecret Manager AdminArtifact Registry WriterService Account User
Install and Authenticate
# Install AWS CLI
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
# Configure credentials
aws configure
# Enter: Access Key ID, Secret Access Key, Region, Output format
Required Permissions
Your account needs these IAM permissions:
apprunner:*ecr:*secretsmanager:*iam:PassRole
Install and Authenticate
# Install doctl
snap install doctl
# Authenticate
doctl auth init
# Enter your DigitalOcean API token
Create a container registry
DigitalOcean allows one container registry for each account. The CLI uses this registry. Create it once.
doctl registry create <registry-name>
Required Permissions
Your API token needs these scopes:
read- Read access to resourceswrite- Write access to resources
Local Requirements
# Docker must be installed and running
docker --version
docker ps
# Git repository (for image tagging)
git status
Commands
Plan Deployment
Preview what the CLI will deploy:
# Plan deployment to GCP Cloud Run
supervaizer deploy plan --platform cloud-run --name my-agent --env prod
# Plan with more options
supervaizer deploy plan \
--platform aws-app-runner \
--name email-agent \
--env staging \
--region us-east-1 \
--project-id my-aws-account
The command prints the platform, the region, and the target image. It also prints a table of actions with type, resource, action, and description.
Deploy Application
Deploy your Supervaizer agent:
# Deploy to GCP Cloud Run
supervaizer deploy up --platform cloud-run --name my-agent
# Deploy with more options
supervaizer deploy up \
--platform do-app-platform \
--name email-agent \
--env prod \
--region nyc3 \
--port 8000 \
--generate-api-key \
--generate-rsa
Deployment Process:
- Build - Build the Docker image from your code.
- Push - Push the image to the registry of the platform.
- Secrets - Store the API keys as secrets of the platform.
- Deploy - Create or update the service.
- Configure - Set
SUPERVAIZER_PUBLIC_URLto the service URL. - Verify - Check the health of the service.
The command prints the service URL, the documentation URLs, the revision, the status, and the health.
Image name
The --image option takes name[:tag]. The CLI adds the registry of the platform. A value with / is not valid.
The default image is {name}-{env}:{git-sha}.
| Platform | Registry |
|---|---|
cloud-run | Artifact Registry of your project |
aws-app-runner | Amazon ECR of your account |
do-app-platform | Container registry of your account |
The CLI does not put credentials in the image. It gives them to the service at runtime.
Check Status
Check the status and the health of your deployment:
supervaizer deploy status --platform cloud-run --name my-agent --env prod
The command prints the local state from .deployment/state.json. It then prints the live status from the platform.
Remove Deployment
Remove the service and its resources:
# Ask for confirmation
supervaizer deploy down --platform cloud-run --name my-agent --env prod
# Skip the confirmation
supervaizer deploy down --platform aws-app-runner --name email-agent --yes
Cleanup Process:
- Confirm - The CLI asks for confirmation. The
--yesoption skips it. - Delete - The CLI deletes the service.
- Secrets - On Cloud Run and AWS, the CLI deletes the secrets of the service.
- State - The CLI removes the local deployment state.
On AWS, the command also deletes the ECR repository of the service. On Cloud Run and DigitalOcean, the images stay in the registry. DigitalOcean keeps the registry because the whole account shares it.
Test Locally
Test your agent with Docker before you deploy:
# Test locally with the default settings
supervaizer deploy local --name my-agent
# Test with more options
supervaizer deploy local \
--name email-agent \
--env dev \
--port 8000 \
--generate-api-key \
--generate-rsa \
--timeout 60 \
--verbose
Local Testing Process:
- Docker Check - Check that Docker runs.
- Secrets - Set the test API key and the optional RSA key.
- Generate Files - Create the Dockerfile,
docker-compose.yml, and.dockerignore. - Build Image - Build the image with the
local-testtag. - Start - Start the service with Docker Compose.
- Wait - Wait for the service to answer.
- Health Check - Call
/.well-known/healthand/docs. - Display Info - Show the service URL and the access information.
The command prints the service URL, the /docs URL, and the /redoc URL.
Local Testing Options:
| Option | Description | Default |
|---|---|---|
--name | Service base name (required, the CLI asks for it) | none |
--env | Environment (dev, staging, prod) | dev |
--port | Application port | 8000 |
--generate-api-key | Create a random API key for the test | false |
--generate-rsa | Generate an RSA private key for the test | false |
--timeout | Seconds to wait for the service | 300 |
--verbose | Show the Docker Compose output | false |
--docker-files-only | Generate the Docker files and do not run them | false |
--controller-file | Controller file name | supervaizer_control.py |
Without --generate-api-key, the test API key is test-api-key-local.
Docker Files Only Mode:
Use --docker-files-only to generate the Docker files and not start the services:
supervaizer deploy local --docker-files-only --name my-agent
This mode is useful for:
- CI/CD pipelines - Generate the files for an external Docker step
- Custom Docker setups - Use the files in your own workflow
- File inspection - Read the Dockerfile before you run it
Generated Files:
.deployment/Dockerfile- Container image definition.deployment/docker-compose.yml- Service orchestration.deployment/.dockerignore- Docker build exclusions
The docker-compose.yml file holds secret values. The CLI sets its mode to 600.
Custom Controller File:
Use --controller-file when your controller has another name:
supervaizer deploy local --controller-file my_controller.py
Cleanup:
# Stop the local services
docker compose -f .deployment/docker-compose.yml down
# Remove the generated files
supervaizer deploy clean
Local testing is fast. It does not need cloud authentication.
Clean Generated Files
Remove the files in .deployment/:
# Remove everything, after confirmation
supervaizer deploy clean
# Skip the confirmation
supervaizer deploy clean --force
# Remove only the Docker files
supervaizer deploy clean --docker-only
# Remove only the deployment state
supervaizer deploy clean --state-only
You cannot use --docker-only and --state-only together. The --verbose option shows more detail.
Configuration Options
Common Options
| Option | Description | Default |
|---|---|---|
--platform | Cloud platform (cloud-run, aws-app-runner, do-app-platform) | required |
--name | Service base name (required, the CLI asks for it) | none |
--env | Environment (dev, staging, prod) | dev |
--region | Provider region | us-central1, us-east-1, or nyc3 |
--project-id | GCP project / AWS account / DO project | none |
--port | Application port (up and local) | 8000 |
--image | Image name[:tag] (up) | {name}-{env}:{git-sha} |
--generate-api-key | Create a secure API key (up and local) | false |
--generate-rsa | Generate an RSA private key (up and local) | false |
--timeout | Timeout in seconds (up and local) | 300 |
--yes | Skip the confirmation prompt (down) | false |
The region default depends on the platform: us-central1 for cloud-run, us-east-1 for aws-app-runner, and nyc3 for do-app-platform.
Environment Variables
The CLI sets these variables in the service.
Standard Variables
| Variable | Value | Description |
|---|---|---|
SUPERVAIZER_ENVIRONMENT | --env value | Environment name |
SUPERVAIZER_HOST | 0.0.0.0 | Bind to all interfaces |
SUPERVAIZER_PORT | --port value | Application port |
SUPERVAIZER_LOG_LEVEL | Your shell value, or INFO | Logging level |
SUPERVAIZER_PUBLIC_URL | Service URL | The CLI sets it after the deployment |
Variables from your shell
The CLI copies these variables into the service when they are set in your shell:
SUPERVAIZE_API_KEYSUPERVAIZE_WORKSPACE_IDSUPERVAIZE_API_URLSUPERVAIZER_SERVER_IDSUPERVAIZER_WORKSPACE_AUTH_REQUIREDSUPERVAIZER_WORKSPACE_AUTH_ISSUERSUPERVAIZER_WORKSPACE_AUTH_AUDIENCESUPERVAIZER_WORKSPACE_AUTH_PUBLIC_KEYSUPERVAIZER_WORKSPACE_AUTH_JWKS_URLSUPERVAIZER_WORKSPACE_AUTH_LEEWAY_SECONDS
The command supervaizer login writes the SUPERVAIZE_* and SUPERVAIZER_WORKSPACE_AUTH_* variables to a file. See the quickstart. Load the file in your shell before you run deploy up.
Secret Variables
| Variable | Source | Description |
|---|---|---|
SUPERVAIZER_API_KEY | --generate-api-key | API key for the /api routes |
SUPERVAIZER_PRIVATE_KEY | --generate-rsa | RSA key for encryption |
SUPERVAIZE_API_KEY | Your shell | Studio API key |
The CLI stores these values in the secret manager of the platform.
Generated Files
The CLI writes its files in the .deployment/ directory:
.deployment/
├── Dockerfile # Generated Docker image
├── .dockerignore # Docker ignore rules
├── docker-compose.yml # Local testing
├── do-app-spec.yaml # DigitalOcean app spec
├── state.json # Deployment state
└── logs/ # Deployment logs
The CLI adds .deployment/ to .gitignore. The docker-compose.yml and do-app-spec.yaml files hold secret values and have mode 600.
Admin Interface
The admin interface is at /manage. You can open it only from a Tailscale network. In local mode, loopback also works. A public service URL does not give access to it.
See the Admin Documentation.
Health Verification
The CLI checks the service at the /.well-known/health path:
curl https://your-service-url/.well-known/health
This route belongs to the A2A routes of the server. Enable A2A endpoints in your Server.
The CLI retries the check with increasing delays until the service answers or the timeout ends.
Troubleshooting
Common Issues
Authentication Errors
# GCP: Re-authenticate
gcloud auth login
gcloud auth application-default login
# AWS: Check credentials
aws sts get-caller-identity
# DigitalOcean: Re-authenticate
doctl auth init
Permission Errors
Make sure your account has the permissions for your platform. See Prerequisites.
Docker Build Failures
# Check that Docker runs
docker ps
# Read the generated Dockerfile
cat .deployment/Dockerfile
Health Check Timeouts
# Check the status
supervaizer deploy status --platform cloud-run --name my-agent
# Test the health endpoint
curl https://your-service-url/.well-known/health
# Increase the timeout
supervaizer deploy up --platform cloud-run --name my-agent --timeout 600
DigitalOcean: No container registry
Create the registry with doctl registry create <registry-name>. Then run the command again.
Debug
Read the deployment state:
cat .deployment/state.json
Best Practices
Security
- API Keys - Use
--generate-api-keyfor production. - Secrets - Never commit secrets to version control.
- Permissions - Use least-privilege IAM roles.
- Networking - Configure VPC and firewall rules as needed.
Performance
- Image Size - Keep the Docker image small.
- Dependencies - Declare only the dependencies that you need in
pyproject.toml.
What's Next?
- Monitor your deployment with the Admin Interface at
/manage. - Integrate the commands in your CI/CD pipeline.
Need Help?
- Check the Troubleshooting Guide for common issues
- Review the CLI Documentation for command-line options
- See the REST API reference for detailed endpoint information
- Visit the GitHub repository for support