-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
194 lines (185 loc) · 4.52 KB
/
docker-compose.yml
File metadata and controls
194 lines (185 loc) · 4.52 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
# Docker Configuration for GPU and Multi-Architecture Support
# Based on deploy/docker-compose.yaml patterns
version: '3.8'
services:
ipfs-kit-py:
build:
context: .
dockerfile: Dockerfile
args:
PYTHON_VERSION: 3.11
BUILD_TYPE: production
image: ipfs-kit-py:latest
container_name: ipfs-kit-py-main
restart: unless-stopped
environment:
- PYTHONPATH=/app
- PYTHONUNBUFFERED=1
- LOG_LEVEL=INFO
volumes:
- ./data:/app/data
- ./logs:/app/logs
- ./config:/app/config:ro
ports:
- "8000:8000"
networks:
- ipfs-network
healthcheck:
test: ["CMD", "python", "-c", "import ipfs_kit_py; print('OK')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
ipfs-kit-py-gpu:
build:
context: .
dockerfile: Dockerfile.gpu
args:
CUDA_VERSION: 12.1
PYTHON_VERSION: 3.11
BUILD_TYPE: production
image: ipfs-kit-py:gpu
container_name: ipfs-kit-py-gpu
restart: unless-stopped
environment:
- PYTHONPATH=/app
- PYTHONUNBUFFERED=1
- LOG_LEVEL=INFO
- CUDA_VISIBLE_DEVICES=all
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
volumes:
- ./data:/app/data
- ./logs:/app/logs
- ./config:/app/config:ro
- /tmp/.X11-unix:/tmp/.X11-unix:rw
ports:
- "8001:8000"
networks:
- ipfs-network
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
healthcheck:
test: ["CMD", "python", "-c", "import torch; assert torch.cuda.is_available(); print('GPU OK')"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
ipfs-kit-py-dev:
build:
context: .
dockerfile: Dockerfile.dev
args:
PYTHON_VERSION: 3.11
image: ipfs-kit-py:dev
container_name: ipfs-kit-py-dev
restart: "no"
environment:
- PYTHONPATH=/app
- PYTHONUNBUFFERED=1
- LOG_LEVEL=DEBUG
- DEVELOPMENT=1
volumes:
- .:/app
- ./data:/app/data
- ./logs:/app/logs
ports:
- "8002:8000"
- "5678:5678" # debugpy port
networks:
- ipfs-network
command: ["python", "-m", "debugpy", "--listen", "0.0.0.0:5678", "--wait-for-client", "-m", "ipfs_kit_py"]
# Testing services
ipfs-kit-py-test:
build:
context: .
dockerfile: Dockerfile.test
args:
PYTHON_VERSION: 3.11
image: ipfs-kit-py:test
container_name: ipfs-kit-py-test
environment:
- PYTHONPATH=/app
- PYTHONUNBUFFERED=1
- LOG_LEVEL=DEBUG
volumes:
- .:/app
- ./test-results:/app/test-results
- ./coverage-reports:/app/coverage-reports
networks:
- ipfs-network
command: ["pytest", "tests/", "--verbose", "--cov=ipfs_kit_py", "--cov-report=html:/app/coverage-reports"]
profiles:
- testing
# Benchmark service
ipfs-kit-py-benchmark:
build:
context: .
dockerfile: Dockerfile.gpu
args:
CUDA_VERSION: 12.1
PYTHON_VERSION: 3.11
BUILD_TYPE: benchmark
image: ipfs-kit-py:benchmark
container_name: ipfs-kit-py-benchmark
environment:
- PYTHONPATH=/app
- PYTHONUNBUFFERED=1
- LOG_LEVEL=INFO
- CUDA_VISIBLE_DEVICES=all
volumes:
- ./benchmarks:/app/benchmarks
- ./benchmark-results:/app/benchmark-results
networks:
- ipfs-network
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
command: ["python", "-m", "pytest", "tests/benchmarks/", "--benchmark-only", "--benchmark-json=/app/benchmark-results/results.json"]
profiles:
- benchmarking
# Documentation service
docs:
build:
context: .
dockerfile: Dockerfile.docs
image: ipfs-kit-py:docs
container_name: ipfs-kit-py-docs
ports:
- "8080:8080"
volumes:
- ./docs:/app/docs
- ./docs-build:/app/docs-build
networks:
- ipfs-network
command: ["mkdocs", "serve", "--dev-addr", "0.0.0.0:8080"]
profiles:
- documentation
networks:
ipfs-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
volumes:
ipfs-data:
driver: local
ipfs-logs:
driver: local
test-results:
driver: local
coverage-reports:
driver: local
benchmark-results:
driver: local
docs-build:
driver: local