Skip to content

Commit 108420a

Browse files
committed
docs(deploy): add deployment strategy decision guide
1 parent 5afafbe commit 108420a

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

docs/deploy/decision-guide.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Deployment Strategy Guide
2+
3+
Choosing the right deployment target for your ADK agents is critical for success. The ADK supports multiple deployment targets, ranging from fully managed serverless environments to custom containerized infrastructure.
4+
5+
This guide helps you choose the right path based on your specific needs.
6+
7+
## Decision Matrix
8+
9+
Use this matrix to quickly identify the best deployment target for your project.
10+
11+
| Feature | **Agent Engine** (Vertex AI) | **Cloud Run** (Serverless Container) | **GKE / Custom VM** |
12+
| :--- | :--- | :--- | :--- |
13+
| **Primary Use Case** | Pure agent logic, rapid prototyping, no-ops | Custom UIs, complex networking, specialized libraries | Enterprise compliance, existing K8s ecosystem |
14+
| **Management Overhead** | **Low** (Fully Managed) | **Medium** (Container configuration) | **High** (Cluster management) |
15+
| **State Management** | **Built-in** (Vertex AI Session Service) | **Ephemeral** (Requires external DB for persistence) | **External** (Requires external DB) |
16+
| **Scaling** | Auto-scaling (Managed) | Auto-scaling (0 to N instances) | Manual or Cluster Autoscaling |
17+
| **Networking** | Public API Endpoint | VPC connectivity, Custom Domains | Full VPC Control, Service Mesh |
18+
| **Cost Model** | Pay-per-use (Token/Request) | Compute-based (vCPU/Memory/Time) | Instance-based (Always on) |
19+
20+
## Deployment Paths
21+
22+
### Path A: Vertex AI Agent Engine (Recommended for most)
23+
**"I just want my agent to run."**
24+
25+
This is the managed service path. You write code, and Google runs it. It supports both the "Accelerated" (Agent Starter Pack) and "Standard" deployment workflows described in the [Agent Engine documentation](./agent-engine.md).
26+
27+
- **Pros**: No Dockerfile needed. No infrastructure config. Built-in conversation history via `VertexAiSessionService`.
28+
- **Cons**: Restricted runtime environment (cannot install system-level packages like `apt-get`).
29+
- **Command**: `adk deploy agent_engine`
30+
31+
### Path B: Cloud Run (Native Deployment)
32+
**"I need a custom UI or specific libraries."**
33+
34+
This acts like "Vercel for Agents". The ADK handles the containerization, but you get a standard Cloud Run service.
35+
- **Pros**: You can deploy a React frontend alongside your agent (`--with_ui`). You can install system dependencies (e.g., `poppler` for PDF parsing) by modifying the generated Dockerfile.
36+
- **Cons**: Session state is **ephemeral** by default (stored in memory). If the container restarts or scales down, conversation history is lost unless you configure an external database (Redis/SQL).
37+
- **Command**: `adk deploy cloud_run` (See [Cloud Run Guide](./cloud-run.md))
38+
39+
### Path C: Container / GKE
40+
**"I have strict enterprise compliance requirements."**
41+
42+
You package the agent as a Docker container yourself and deploy it to your existing infrastructure.
43+
- **Pros**: Complete control. Meets strict IT/Security policies.
44+
- **Cons**: You own the build pipeline, security patching, and orchestration.
45+
- **Guide**: See [GKE Guide](./gke.md)
46+
47+
## Common Deployment Gotchas
48+
49+
### Environment Variables
50+
- **Agent Engine**: The `adk deploy agent_engine` command reads your local `.env` file at **deployment time** to configure the service.
51+
- *Tip*: If you exclude `.env` from version control (recommended), ensure you create one in your deployment environment (e.g., CI/CD pipeline) before running the deploy command.
52+
- **Cloud Run**: Variables can be passed during deployment or updated later on the service.
53+
```bash
54+
adk deploy cloud_run --service_name my-agent
55+
gcloud run services update my-agent --set-env-vars KEY=VALUE
56+
```
57+
58+
### File Uploads
59+
If your agent processes files (PDFs, Images):
60+
- **Agent Engine**: Handles file storage automatically within the managed session context.
61+
- **Cloud Run**: You must implement a mechanism to accept file uploads (e.g., multipart/form-data) and store them (e.g., in Google Cloud Storage) before passing the URI to the agent, as the container's filesystem is ephemeral.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ nav:
250250
- Resume Agents: runtime/resume.md
251251
- Deployment:
252252
- deploy/index.md
253+
- Strategy Guide: deploy/decision-guide.md
253254
- Agent Engine: deploy/agent-engine.md
254255
- Cloud Run: deploy/cloud-run.md
255256
- GKE: deploy/gke.md

0 commit comments

Comments
 (0)