-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.multi-agent.yml
More file actions
308 lines (293 loc) · 7.29 KB
/
docker-compose.multi-agent.yml
File metadata and controls
308 lines (293 loc) · 7.29 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
version: '3.8'
networks:
agent-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
volumes:
redis-data:
prometheus-data:
grafana-data:
workspace:
artifacts:
services:
# Core Infrastructure
redis:
image: redis:7-alpine
container_name: agent-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- agent-network
command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
# Main Orchestrator
orchestrator:
build: ./orchestrator
container_name: agent-orchestrator
ports:
- "8000:8000"
environment:
- ORCHESTRATOR_MODE=${ORCHESTRATION_MODE:-hybrid}
- REDIS_HOST=redis
- MAX_PARALLEL_AGENTS=4
- LOG_LEVEL=INFO
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./workspace:/workspace
- ./artifacts:/artifacts
- ./config:/config
networks:
- agent-network
depends_on:
redis:
condition: service_healthy
deploy:
resources:
limits:
memory: 1G
cpus: '1.0'
# Claude Agent - Architecture & Design
claude-architect:
image: anthropic/claude-agent:latest
container_name: claude-architect
environment:
- AGENT_ROLE=architect
- CLAUDE_API_KEY_FILE=/run/secrets/claude_api_key
- MODEL=claude-3-opus-20240229
- FOCUS_AREAS=architecture,design,patterns,security
- REDIS_HOST=redis
- MAX_TOKENS=4096
volumes:
- ./workspace:/workspace
- ./artifacts:/artifacts
networks:
- agent-network
secrets:
- claude_api_key
deploy:
replicas: 1
resources:
limits:
memory: 2G
cpus: '1.0'
profiles:
- architects
# Gemini Agent - Implementation
gemini-developer:
image: google/gemini-agent:latest
container_name: gemini-developer
environment:
- AGENT_ROLE=developer
- GEMINI_API_KEY_FILE=/run/secrets/gemini_api_key
- MODEL=gemini-2.5-pro
- FOCUS_AREAS=implementation,optimization,algorithms
- REDIS_HOST=redis
- CONTEXT_WINDOW=1000000
volumes:
- ./workspace:/workspace
- ./artifacts:/artifacts
networks:
- agent-network
secrets:
- gemini_api_key
deploy:
replicas: 1
resources:
limits:
memory: 2G
cpus: '1.0'
profiles:
- developers
# Claude Agent - Testing
claude-tester:
image: anthropic/claude-agent:latest
container_name: claude-tester
environment:
- AGENT_ROLE=tester
- CLAUDE_API_KEY_FILE=/run/secrets/claude_api_key
- MODEL=claude-3-sonnet-20240229
- FOCUS_AREAS=testing,verification,quality
- REDIS_HOST=redis
volumes:
- ./workspace:/workspace
- ./artifacts:/artifacts
networks:
- agent-network
secrets:
- claude_api_key
deploy:
replicas: 1
resources:
limits:
memory: 1G
cpus: '0.5'
profiles:
- testers
# Codeium Agent - Refactoring
codeium-refactorer:
image: codeium/agent:latest
container_name: codeium-refactorer
environment:
- AGENT_ROLE=refactorer
- CODEIUM_API_KEY_FILE=/run/secrets/codeium_api_key
- FOCUS_AREAS=refactoring,cleanup,performance
- REDIS_HOST=redis
volumes:
- ./workspace:/workspace
- ./artifacts:/artifacts
networks:
- agent-network
secrets:
- codeium_api_key
deploy:
replicas: 1
resources:
limits:
memory: 1G
cpus: '0.5'
profiles:
- refactorers
# Monitoring Stack
prometheus:
image: prom/prometheus:latest
container_name: agent-prometheus
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
ports:
- "9090:9090"
networks:
- agent-network
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
profiles:
- monitoring
grafana:
image: grafana/grafana:latest
container_name: agent-grafana
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_INSTALL_PLUGINS=redis-datasource
volumes:
- grafana-data:/var/lib/grafana
- ./monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards
- ./monitoring/grafana/datasources:/etc/grafana/provisioning/datasources
ports:
- "3001:3000"
networks:
- agent-network
depends_on:
- prometheus
profiles:
- monitoring
# Container metrics
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: agent-cadvisor
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
ports:
- "8080:8080"
networks:
- agent-network
privileged: true
devices:
- /dev/kmsg
profiles:
- monitoring
# Resource Manager
resource-manager:
build: ./resource-manager
container_name: agent-resource-manager
environment:
- MAX_TOTAL_MEMORY=16G
- MAX_TOTAL_CPU=8
- REDIS_HOST=redis
- CHECK_INTERVAL=30
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- agent-network
depends_on:
- redis
- orchestrator
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
profiles:
- management
# Persistence Service for Agent Outputs
persistence-service:
build: ./persistence
container_name: agent-persistence
ports:
- "5001:5000"
environment:
- WORKSPACE_DIR=/workspace
- SPECS_DIR=/specs
- OUTPUTS_DIR=/outputs
- VALIDATE_SPECS=true
- AUTO_COMMIT=true
- TDD_MODE=enforced
- REDIS_HOST=redis
volumes:
- ./workspace:/workspace
- ./specs:/specs
- ./outputs:/outputs
- ./artifacts:/artifacts
networks:
- agent-network
depends_on:
redis:
condition: service_healthy
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/status"]
interval: 10s
timeout: 3s
retries: 3
secrets:
claude_api_key:
file: ~/.secrets/claude_api_key
gemini_api_key:
file: ~/.secrets/gemini_api_key
codeium_api_key:
file: ~/.secrets/codeium_api_key
# Usage Examples:
#
# Start core services only:
# docker-compose -f docker-compose.multi-agent.yml up orchestrator redis
#
# Start with monitoring:
# docker-compose -f docker-compose.multi-agent.yml --profile monitoring up
#
# Start all architect agents:
# docker-compose -f docker-compose.multi-agent.yml --profile architects up
#
# Start everything:
# docker-compose -f docker-compose.multi-agent.yml --profile architects --profile developers --profile testers --profile monitoring --profile management up
#
# Scale specific agents:
# docker-compose -f docker-compose.multi-agent.yml up --scale gemini-developer=3