Skip to main content

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.

Let a coding agent do it

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​

info

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

Plan - Preview the changes

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.

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 Admin
  • Secret Manager Admin
  • Artifact Registry Writer
  • Service Account User

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:

  1. Build - Build the Docker image from your code.
  2. Push - Push the image to the registry of the platform.
  3. Secrets - Store the API keys as secrets of the platform.
  4. Deploy - Create or update the service.
  5. Configure - Set SUPERVAIZER_PUBLIC_URL to the service URL.
  6. 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}.

PlatformRegistry
cloud-runArtifact Registry of your project
aws-app-runnerAmazon ECR of your account
do-app-platformContainer registry of your account
Credentials stay out of the image

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:

  1. Confirm - The CLI asks for confirmation. The --yes option skips it.
  2. Delete - The CLI deletes the service.
  3. Secrets - On Cloud Run and AWS, the CLI deletes the secrets of the service.
  4. State - The CLI removes the local deployment state.
Registries

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:

  1. Docker Check - Check that Docker runs.
  2. Secrets - Set the test API key and the optional RSA key.
  3. Generate Files - Create the Dockerfile, docker-compose.yml, and .dockerignore.
  4. Build Image - Build the image with the local-test tag.
  5. Start - Start the service with Docker Compose.
  6. Wait - Wait for the service to answer.
  7. Health Check - Call /.well-known/health and /docs.
  8. 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:

OptionDescriptionDefault
--nameService base name (required, the CLI asks for it)none
--envEnvironment (dev, staging, prod)dev
--portApplication port8000
--generate-api-keyCreate a random API key for the testfalse
--generate-rsaGenerate an RSA private key for the testfalse
--timeoutSeconds to wait for the service300
--verboseShow the Docker Compose outputfalse
--docker-files-onlyGenerate the Docker files and do not run themfalse
--controller-fileController file namesupervaizer_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
Test first

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​

OptionDescriptionDefault
--platformCloud platform (cloud-run, aws-app-runner, do-app-platform)required
--nameService base name (required, the CLI asks for it)none
--envEnvironment (dev, staging, prod)dev
--regionProvider regionus-central1, us-east-1, or nyc3
--project-idGCP project / AWS account / DO projectnone
--portApplication port (up and local)8000
--imageImage name[:tag] (up){name}-{env}:{git-sha}
--generate-api-keyCreate a secure API key (up and local)false
--generate-rsaGenerate an RSA private key (up and local)false
--timeoutTimeout in seconds (up and local)300
--yesSkip 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​

VariableValueDescription
SUPERVAIZER_ENVIRONMENT--env valueEnvironment name
SUPERVAIZER_HOST0.0.0.0Bind to all interfaces
SUPERVAIZER_PORT--port valueApplication port
SUPERVAIZER_LOG_LEVELYour shell value, or INFOLogging level
SUPERVAIZER_PUBLIC_URLService URLThe 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_KEY
  • SUPERVAIZE_WORKSPACE_ID
  • SUPERVAIZE_API_URL
  • SUPERVAIZER_SERVER_ID
  • SUPERVAIZER_WORKSPACE_AUTH_REQUIRED
  • SUPERVAIZER_WORKSPACE_AUTH_ISSUER
  • SUPERVAIZER_WORKSPACE_AUTH_AUDIENCE
  • SUPERVAIZER_WORKSPACE_AUTH_PUBLIC_KEY
  • SUPERVAIZER_WORKSPACE_AUTH_JWKS_URL
  • SUPERVAIZER_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​

VariableSourceDescription
SUPERVAIZER_API_KEY--generate-api-keyAPI key for the /api routes
SUPERVAIZER_PRIVATE_KEY--generate-rsaRSA key for encryption
SUPERVAIZE_API_KEYYour shellStudio 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
info

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​

  1. API Keys - Use --generate-api-key for production.
  2. Secrets - Never commit secrets to version control.
  3. Permissions - Use least-privilege IAM roles.
  4. Networking - Configure VPC and firewall rules as needed.

Performance​

  1. Image Size - Keep the Docker image small.
  2. 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?​