forked from GoogleCloudPlatform/race-condition
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
169 lines (147 loc) · 6.67 KB
/
Copy path.env.example
File metadata and controls
169 lines (147 loc) · 6.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# --- Simulation Ports (Explicit for direct execution) ---
PORT=9100
ADMIN_PORT=9100
GATEWAY_PORT=9101
DASH_PORT=9111
TESTER_PORT=9112
SIMULATOR_PORT=9104
PLANNER_PORT=9105
PLANNER_WITH_EVAL_PORT=9106
SIMULATOR_WITH_FAILURE_PORT=9107
RUNNER_PORT=9108
PLANNER_WITH_MEMORY_PORT=9109
RUNNER_AUTOPILOT_PORT=9110
FRONTEND_APP_PORT=9119
FRONTEND_BFF_PORT=9118
# --- Frontend (Angular) Gateway Connection ---
NG_APP_GATEWAY_URL=ws://127.0.0.1:9101/ws
NG_APP_GATEWAY_ADDR=http://127.0.0.1:9101
# --- Internal Service Addresses ---
GATEWAY_ADDR=127.0.0.1:9101
SIMULATOR_ADDR=127.0.0.1:9104
PLANNER_ADDR=127.0.0.1:9105
PLANNER_WITH_EVAL_ADDR=127.0.0.1:9106
RUNNER_ADDR=127.0.0.1:9108
PLANNER_WITH_MEMORY_ADDR=127.0.0.1:9109
RUNNER_AUTOPILOT_ADDR=127.0.0.1:9110
# --- Dynamic Agent URLs ---
SIMULATOR_URL=http://127.0.0.1:9104
PLANNER_URL=http://127.0.0.1:9105
PLANNER_WITH_EVAL_URL=http://127.0.0.1:9106
SIMULATOR_WITH_FAILURE_URL=http://127.0.0.1:9107
RUNNER_URL=http://127.0.0.1:9108
PLANNER_WITH_MEMORY_URL=http://127.0.0.1:9109
RUNNER_AUTOPILOT_URL=http://127.0.0.1:9110
GATEWAY_URL=http://127.0.0.1:9101
TESTER_URL=http://127.0.0.1:9112
DASH_URL=http://127.0.0.1:9111
ADMIN_URL=http://127.0.0.1:9100
FRONTEND_APP_URL=http://127.0.0.1:9119
FRONTEND_BFF_URL=http://127.0.0.1:9118
# --- Gateway Agent Discovery ---
# Comma-separated list of agent base URLs for dynamic card discovery.
# The gateway fetches /.well-known/agent-card.json from each URL.
AGENT_URLS=http://127.0.0.1:9104,http://127.0.0.1:9105,http://127.0.0.1:9106,http://127.0.0.1:9107,http://127.0.0.1:9108,http://127.0.0.1:9109,http://127.0.0.1:9110
# --- Vite/Frontend Configuration ---
VITE_GATEWAY_URL=ws://127.0.0.1:9101/ws
VITE_GATEWAY_ADDR=http://127.0.0.1:9101
# --- Infrastructure ---
REDIS_ADDR=127.0.0.1:9102
REDIS_MAX_CONNECTIONS=100 # Max connections in shared Redis pool (per process). Cloud Run: 100, Agent Engine: 10 via deploy.py.
REDIS_SESSION_MAX_CONNECTIONS=200 # Max connections for session service Redis pool (per process). Cloud Run: 100 via deploy.py.
REAP_INTERVAL=30m # Background cleanup interval for stale session registry entries
MAX_RUNNERS=100 # Max runners per simulation (local). GCP: 1000 via .env.dev.
# Per-runner-type caps enforced by the simulator's prepare_simulation.
# These differ from the gateway-level MAX_RUNNERS above (which is a
# separate clamp at the spawn API). Local defaults are LLM-friendly;
# GCP overrides (.env.dev) bump these up: autopilot=1000, LLM=100.
MAX_RUNNERS_AUTOPILOT=100
MAX_RUNNERS_LLM=10
# SESSION_STORE_OVERRIDE= # Override session service: "redis" (durable) or "inmemory" (diagnostic). Unset = default chain.
PUBSUB_EMULATOR_HOST=127.0.0.1:9103
# --- GCP Configuration ---
PROJECT_ID=your-gcp-project-id
REGION=us-central1
GOOGLE_CLOUD_PROJECT=your-gcp-project-id
GOOGLE_CLOUD_LOCATION=global
GOOGLE_GENAI_USE_VERTEXAI=TRUE
# --- Telemetry ---
PUBSUB_PROJECT_ID=test-project
PUBSUB_TOPIC_ID=agent-telemetry
ORCHESTRATION_TOPIC_ID=specialist-orchestration
PUBSUB_SUB_ID=router-sub
# Comma-separated PubSub subscription names to seek during environment reset.
# Only used on GCP (when PUBSUB_EMULATOR_HOST is not set).
PUBSUB_RESET_SUBS=router-sub,gateway-push-orchestration
# --- Scaling (Cloud Run / Agent Engine) ---
# Minimum instances per service (used by deploy.py and cloudbuild.yaml)
MIN_INSTANCES=1
# --- VPC (Cloud Run direct VPC egress, used by deploy.py) ---
# Values come from Terraform outputs: vpc_network, vpc_subnet
# VPC_NETWORK=n26-devkey-simulation-vpc
# VPC_SUBNET=serverless-subnet
# --- AlloyDB Mode ---
# USE_ALLOYDB=false means a local Postgres container (default, no GCP needed).
# docker compose up postgres (or: starts automatically via Procfile)
# Password is fixed at "localdev" for the local container.
#
# DATABASE_URL is no longer injected at Cloud Run deploy time -- no Cloud Run
# service uses AlloyDB for sessions anymore (runner-db-cluster was removed).
# The variable is kept here for local development with runtime.py, but setting
# it locally causes runtime.py to select DatabaseSessionService instead of
# InMemorySessionService, which crashes.
USE_ALLOYDB=false
ALLOYDB_SCHEMA=public
# --- AlloyDB (planner_with_memory agent) ---
# OPTION A — Local Postgres container (default):
# The Procfile starts `docker compose up --wait postgres` automatically.
# Route persistence works fully. Regulations vector search returns an error
# (no ai.embedding() locally) but degrades gracefully.
ALLOYDB_HOST=127.0.0.1
ALLOYDB_PORT=9113
ALLOYDB_DATABASE=postgres
ALLOYDB_USER=postgres
ALLOYDB_PASSWORD=localdev
#
# OPTION B — AlloyDB Auth Proxy (real GCP data, needs gcloud auth):
# 1. bash scripts/core/install_alloydb_proxy.sh
# 2. make worktree-env SLOT=N ALLOYDB=true
# (sets USE_ALLOYDB=true and leaves ALLOYDB_PASSWORD empty)
# 3. The planner_with_memory agent fetches the password from Secret Manager
# at runtime via ADC. No need to manually set ALLOYDB_PASSWORD.
# 4. To override: set ALLOYDB_PASSWORD=<value> in .env to skip Secret Manager.
# --- Simulation Defaults ---
# Duration and tick interval for default simulation runs.
# Tick interval is silently adjusted to the nearest clean divisor of duration.
SIM_DEFAULT_DURATION_SECONDS=120
SIM_DEFAULT_TICK_INTERVAL_SECONDS=10
# --- Environment Controls ---
PYTHONPATH=.
GIN_MODE=release
# --- Admin Dashboard ---
AGENT_CATALOG_PATH=agents/catalog.json
# CORS configuration
CORS_ALLOWED_ORIGINS=*
# --- Google Maps MCP ---
# Fetch from Secret Manager: gcloud secrets versions access latest --secret=maps-api-key --project=your-gcp-project-id
GOOGLE_MAPS_API_KEY=
# --- Agent Model Overrides ---
EVALUATOR_MODEL=gemini-3-flash-preview
# RUNNER_MODEL=gemini-3.1-flash-lite-preview # Default (Vertex AI). For local Ollama: ollama_chat/gemma4:e2b
# AGENT_NAME=runner # Default agent identity. Set to "runner_gke" for GKE deployment.
# --- Gemini Retry Configuration ---
# Automatic retry with exponential backoff for transient Gemini API errors
# (429 rate limits, 500/502/503/504 server errors).
# GEMINI_RETRY_ATTEMPTS=5 # Total attempts including initial call
# GEMINI_RETRY_INITIAL_DELAY=1.0 # Seconds before first retry
# GEMINI_RETRY_MAX_DELAY=60.0 # Maximum delay cap between retries
# --- vLLM on GKE (Gemma 4) ---
# Use with kubectl port-forward svc/vllm-service 8080:9100
# See docs/guides/gke-vllm-setup.md for full setup instructions.
# RUNNER_MODEL=openai/gemma-4-E4B-it
# VLLM_API_URL=http://localhost:8080/v1
# --- GKE Runner (runner_gke) ---
# LLM-powered runner deployed on GKE with Internal LoadBalancer.
# Set after deploying: kubectl get svc runner-gke -n runner -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
# See docs/guides/gke-runner-setup.md for setup instructions.
# RUNNER_GKE_INTERNAL_URL=http://<internal-lb-ip>:9108