This directory contains implementations for deploying Google ADK agents to Google Cloud Run.
Quick Navigation Guide:
-
Start here → This README (
4_adk_deploy_cloudrun/README.md):- Overview and workflow
- Installation instructions (parent directory level)
- Quick start guide for using existing implementation
- Instructions for creating new projects
-
For detailed project info → Child README (
adk_agent_cloudrun_demo/README.md):- Project-specific details
- Detailed deployment steps
- Complete testing examples
- Environment variable configuration
Typical Workflow:
- Read this README for installation and overview
- Navigate to
adk_agent_cloudrun_demo/for deployment - Refer to child README for detailed project-specific instructions
Google Cloud Run is a fully managed serverless platform that automatically scales your applications. These implementations demonstrate how to containerize and deploy Google ADK agents to Cloud Run using Agent Starter Pack (ASP).
If you want to use the existing adk_agent_cloudrun_demo implementation, follow these steps:
- Python 3.11 or later
uvorpippackage manager- Google Cloud Project with billing enabled
- Required APIs enabled (Cloud Run, Cloud Build, Container Registry)
- Docker installed (for local testing)
- Google Cloud SDK installed and authenticated
- Terraform installed (for infrastructure deployment)
- Appropriate IAM permissions
Install dependencies at the parent directory level (4_adk_deploy_cloudrun/):
Using uv (recommended):
# Navigate to parent directory
cd 4_adk_deploy_cloudrun
# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create virtual environment (if needed)
uv venv
# Install dependencies
uv pip install -r requirements.txtUsing pip:
# Navigate to parent directory
cd 4_adk_deploy_cloudrun
# Create and activate virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtNavigate to the implementation directory and deploy:
# Navigate to the agent project
cd adk_agent_cloudrun_demo
# Set up environment variables (create .env from .env.example)
cp .env.example .env
# Edit .env with your configuration
# Set your GCP project
gcloud config set project YOUR_DEV_PROJECT_ID
# Option A: Quick development deployment
make setup-dev-env # Provision GCP resources
make deploy # Deploy to Cloud Run
# Option B: Production CI/CD pipeline (recommended)
uvx agent-starter-pack setup-cicdNote: For detailed deployment instructions, see adk_agent_cloudrun_demo/README.md
After successful deployment, test your agent:
# From the adk_agent_cloudrun_demo directory
jupyter notebook notebooks/adk_app_testing.ipynbTesting Methods:
-
Jupyter Notebook (Recommended): The
notebooks/adk_app_testing.ipynbnotebook provides comprehensive testing capabilities:- Tests the deployed Cloud Run service
- Validates API endpoints
- Tests with streaming queries
- Includes error handling examples
-
Cloud Run Console: Access your service via the Cloud Run console link for monitoring and logs
-
Local Proxy Testing (For Authenticated Services): Use
gcloud run services proxyto create a local proxy that handles authentication automatically -
Direct API Testing: Use curl or Postman to test the deployed service endpoints (for public services)
-
Local Testing: Use
make playgroundormake local-backendto test your agent locally before deployment
If you want to create a NEW agent project, use the Agent Starter Pack CLI tool:
# Using uvx (recommended)
uvx agent-starter-pack create my-cloudrun-agent -a adk_base -d cloud_run
# Or using pip
pip install --upgrade agent-starter-pack
agent-starter-pack create my-cloudrun-agent -a adk_base -d cloud_runThe CLI will guide you through:
- Agent template selection
- Deployment target (Cloud Run)
- CI/CD runner selection (Cloud Build or GitHub Actions)
- GCP project configuration
For more details, see the Agent Starter Pack Documentation.
Complete implementation demonstrating deployment of a Google ADK agent to Google Cloud Run using Agent Starter Pack (ASP).
Key Features:
- Docker containerization
- Cloud Run deployment
- Terraform infrastructure setup
- Automated CI/CD workflows
- Testing and evaluation notebooks
Directory: adk_agent_cloudrun_demo/
See: adk_agent_cloudrun_demo/README.md for detailed project-specific instructions.