-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
169 lines (160 loc) · 3.78 KB
/
docker-compose.yml
File metadata and controls
169 lines (160 loc) · 3.78 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
version: '3.8'
services:
# Training service
grpo-training:
build:
context: .
target: training
image: hanzoai/grpo:training
container_name: grpo-training
runtime: nvidia
environment:
- CUDA_VISIBLE_DEVICES=0
- WANDB_API_KEY=${WANDB_API_KEY}
- HANZO_API_KEY=${HANZO_API_KEY}
volumes:
- ./data:/app/data
- ./models:/app/models
- ./outputs:/app/outputs
- ./config:/app/config
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
command: >
python3 src/train.py
--config /app/config/grpo_config.yaml
--hanzo
# Development environment
grpo-dev:
build:
context: .
target: development
image: hanzoai/grpo:dev
container_name: grpo-dev
runtime: nvidia
environment:
- JUPYTER_ENABLE_LAB=yes
- CUDA_VISIBLE_DEVICES=0
volumes:
- .:/app
- ~/.cache:/root/.cache
ports:
- "8888:8888" # Jupyter
- "6006:6006" # TensorBoard
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
command: >
jupyter lab
--ip=0.0.0.0
--port=8888
--no-browser
--allow-root
--NotebookApp.token=''
# Inference API service
grpo-inference:
build:
context: .
target: inference
image: hanzoai/grpo:inference
container_name: grpo-inference
runtime: nvidia
environment:
- MODEL_PATH=/app/models/production/latest
- CUDA_VISIBLE_DEVICES=0
volumes:
- ./models:/app/models:ro
ports:
- "8000:8000"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Daily training cron job
grpo-daily-training:
build:
context: .
target: training
image: hanzoai/grpo:training
container_name: grpo-daily-training
runtime: nvidia
environment:
- CUDA_VISIBLE_DEVICES=0
- HANZO_API_KEY=${HANZO_API_KEY}
volumes:
- ./data:/app/data
- ./models:/app/models
- ./config:/app/config
- ./logs:/app/logs
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
command: >
sh -c "while true; do
echo 'Running daily training at' $$(date);
python3 scripts/daily_training.py --config config/daily_training.yaml;
echo 'Sleeping for 24 hours...';
sleep 86400;
done"
# Redis for caching
redis:
image: redis:7-alpine
container_name: grpo-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
command: redis-server --appendonly yes
# PostgreSQL for metadata
postgres:
image: postgres:15-alpine
container_name: grpo-postgres
environment:
- POSTGRES_DB=grpo
- POSTGRES_USER=grpo
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-grpo123}
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
# MinIO for model storage
minio:
image: minio/minio:latest
container_name: grpo-minio
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-minioadmin}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-minioadmin}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio-data:/data
command: server /data --console-address ":9001"
volumes:
redis-data:
postgres-data:
minio-data:
networks:
default:
name: grpo-network