-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathdocker-compose-dataset-viewer.yml
267 lines (267 loc) · 11.2 KB
/
docker-compose-dataset-viewer.yml
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
services:
reverse-proxy:
image: docker.io/nginx:1.25.3
volumes:
- ../services/reverse-proxy/nginx-templates/:/etc/nginx/templates:ro
- storage:${STORAGE_DIRECTORY-/storage}:ro
ports:
- "${PORT_REVERSE_PROXY-8000}:80"
environment:
ASSETS_STORAGE_ROOT: ${REVERSE_PROXY_ASSETS_STORAGE_ROOT-false} # <- if not set, returns 404 on /assets
CACHED_ASSETS_STORAGE_ROOT: ${REVERSE_PROXY_CACHED_ASSETS_STORAGE_ROOT-false} # <- if not set, returns 404 on /cached-assets
OPENAPI_FILE: ${OPENAPI_FILE-docs/source/openapi.json}
HOST: localhost
PORT: 80
URL_ADMIN: http://admin:${ADMIN_UVICORN_PORT-8081}
URL_API: http://api:${API_UVICORN_PORT-8080}
URL_ROWS: http://rows:${ROWS_UVICORN_PORT-8082}
URL_SEARCH: http://search:${SEARCH_UVICORN_PORT-8083}
URL_SSE_API: http://sse-api:${SSE_API_UVICORN_PORT-8085}
URL_WEBHOOK: http://webhook:${WEBHOOK_UVICORN_PORT-8087}
depends_on:
admin:
condition: service_started
api:
condition: service_started
rows:
condition: service_started
search:
condition: service_started
admin:
build:
context: ..
dockerfile: services/admin/Dockerfile
volumes:
- storage:${STORAGE_DIRECTORY-/storage}:rw
- parquet-metadata:${PARQUET_METADATA_STORAGE_DIRECTORY-/parquet_metadata}:ro
extends:
file: docker-compose-base.yml
service: libapi
environment:
# service
ADMIN_HF_ORGANIZATION: ${ADMIN_HF_ORGANIZATION-huggingface}
ADMIN_CACHE_REPORTS_NUM_RESULTS: ${ADMIN_CACHE_REPORTS_NUM_RESULTS-100}
ADMIN_CACHE_REPORTS_WITH_CONTENT_NUM_RESULTS: ${ADMIN_CACHE_REPORTS_WITH_CONTENT_NUM_RESULTS-100}
ADMIN_HF_TIMEOUT_SECONDS: ${ADMIN_HF_TIMEOUT_SECONDS-0.2}
ADMIN_HF_WHOAMI_PATH: ${ADMIN_HF_WHOAMI_PATH-/api/whoami-v2}
ADMIN_MAX_AGE: ${ADMIN_MAX_AGE-10}
# prometheus
PROMETHEUS_MULTIPROC_DIR: ${PROMETHEUS_MULTIPROC_DIR-}
# uvicorn
ADMIN_UVICORN_HOSTNAME: 0.0.0.0 # required for docker compose
ADMIN_UVICORN_NUM_WORKERS: ${ADMIN_UVICORN_NUM_WORKERS-2}
ADMIN_UVICORN_PORT: ${ADMIN_UVICORN_PORT-8081}
PARQUET_METADATA_STORAGE_DIRECTORY: ${PARQUET_METADATA_STORAGE_DIRECTORY-/parquet_metadata}
depends_on:
mongodb:
condition: service_healthy
restart: always
ports:
- ${ADMIN_UVICORN_PORT-8081}:${ADMIN_UVICORN_PORT-8081}
api:
build:
context: ..
dockerfile: services/api/Dockerfile
volumes:
- storage:${STORAGE_DIRECTORY-/storage}:rw
extends:
file: docker-compose-base.yml
service: libapi
environment:
# prometheus
PROMETHEUS_MULTIPROC_DIR: ${PROMETHEUS_MULTIPROC_DIR-}
# uvicorn
API_UVICORN_HOSTNAME: 0.0.0.0 # required for docker compose
API_UVICORN_NUM_WORKERS: ${API_UVICORN_NUM_WORKERS-2}
API_UVICORN_PORT: ${API_UVICORN_PORT-8080}
ports:
- ${API_UVICORN_PORT-8080}:${API_UVICORN_PORT-8080}
depends_on:
mongodb:
condition: service_healthy
restart: unless-stopped
rows:
build:
context: ..
dockerfile: services/rows/Dockerfile
extends:
file: docker-compose-base.yml
service: libapi
volumes:
- storage:${STORAGE_DIRECTORY-/storage}
- parquet-metadata:${PARQUET_METADATA_STORAGE_DIRECTORY-/parquet_metadata}
environment:
PARQUET_METADATA_STORAGE_DIRECTORY: ${PARQUET_METADATA_STORAGE_DIRECTORY-/parquet_metadata}
ROWS_INDEX_MAX_ARROW_DATA_IN_MEMORY: ${ROWS_INDEX_MAX_ARROW_DATA_IN_MEMORY-300_000_000}
# prometheus
PROMETHEUS_MULTIPROC_DIR: ${PROMETHEUS_MULTIPROC_DIR-}
# uvicorn
API_UVICORN_HOSTNAME: 0.0.0.0 # required for docker compose
API_UVICORN_NUM_WORKERS: ${ROWS_UVICORN_NUM_WORKERS-2}
API_UVICORN_PORT: ${ROWS_UVICORN_PORT-8082}
ports:
# for debug
- ${ROWS_UVICORN_PORT-8082}:${ROWS_UVICORN_PORT-8082}
depends_on:
mongodb:
condition: service_healthy
restart: unless-stopped
search:
build:
context: ..
dockerfile: services/search/Dockerfile
extends:
file: docker-compose-base.yml
service: libapi
volumes:
- storage:${STORAGE_DIRECTORY-/storage}
- duckdb-index:${DUCKDB_INDEX_CACHE_DIRECTORY-/duckdb-index}
environment:
DUCKDB_INDEX_CACHE_DIRECTORY: ${DUCKDB_INDEX_CACHE_DIRECTORY-/duckdb-index}
DUCKDB_INDEX_EXTENSIONS_DIRECTORY: ${DUCKDB_INDEX_EXTENSIONS_DIRECTORY-/tmp/duckdb-extensions}
# prometheus
PROMETHEUS_MULTIPROC_DIR: ${PROMETHEUS_MULTIPROC_DIR-}
# uvicorn
API_UVICORN_HOSTNAME: 0.0.0.0 # required for docker compose
API_UVICORN_NUM_WORKERS: ${SEARCH_UVICORN_NUM_WORKERS-2}
API_UVICORN_PORT: ${SEARCH_UVICORN_PORT-8083}
HF_HUB_ENABLE_HF_TRANSFER: 1
ports:
# for debug
- ${SEARCH_UVICORN_PORT-8083}:${SEARCH_UVICORN_PORT-8083}
depends_on:
mongodb:
condition: service_healthy
restart: unless-stopped
sse-api:
build:
context: ..
dockerfile: services/sse-api/Dockerfile
extends:
file: docker-compose-base.yml
service: libapi
environment:
# prometheus
PROMETHEUS_MULTIPROC_DIR: ${PROMETHEUS_MULTIPROC_DIR-}
# uvicorn
API_UVICORN_HOSTNAME: 0.0.0.0 # required for docker compose
API_UVICORN_NUM_WORKERS: ${SSE_API_UVICORN_NUM_WORKERS-2}
API_UVICORN_PORT: ${SSE_API_UVICORN_PORT-8085}
ports:
# for debug
- ${SSE_API_UVICORN_PORT-8085}:${SSE_API_UVICORN_PORT-8085}
depends_on:
mongodb:
condition: service_healthy
restart: unless-stopped
worker:
build:
context: ..
dockerfile: services/worker/Dockerfile
volumes:
- storage:${STORAGE_DIRECTORY-/storage}:rw
- parquet-metadata:${PARQUET_METADATA_STORAGE_DIRECTORY-/parquet_metadata}:rw
- duckdb-index:${DUCKDB_INDEX_CACHE_DIRECTORY-/duckdb-index}:rw
- descriptive-statistics:${DESCRIPTIVE_STATISTICS_CACHE_DIRECTORY-/stats-cache}:rw
extends:
file: docker-compose-base.yml
service: libcommon
environment:
CONFIG_NAMES_MAX_NUMBER: ${CONFIG_NAMES_MAX_NUMBER-3_000}
DESCRIPTIVE_STATISTICS_CACHE_DIRECTORY: ${DESCRIPTIVE_STATISTICS_CACHE_DIRECTORY-/stats-cache}
DESCRIPTIVE_STATISTICS_MAX_SPLIT_SIZE_BYTES: ${DESCRIPTIVE_STATISTICS_MAX_SPLIT_SIZE_BYTES-100_000_000}
DUCKDB_INDEX_CACHE_DIRECTORY: ${DUCKDB_INDEX_CACHE_DIRECTORY-/duckdb-index}
DUCKDB_INDEX_COMMIT_MESSAGE: ${DUCKDB_INDEX_COMMIT_MESSAGE-Update duckdb index file}
DUCKDB_INDEX_COMMITTER_HF_TOKEN: ${DUCKDB_INDEX_COMMITTER_HF_TOKEN-}
DUCKDB_INDEX_TARGET_REVISION: ${DUCKDB_INDEX_TARGET_REVISION-refs/convert/duckdb}
DUCKDB_INDEX_URL_TEMPLATE: ${DUCKDB_INDEX_URL_TEMPLATE-/datasets/%s/resolve/%s/%s}
DUCKDB_INDEX_MAX_SPLIT_SIZE_BYTES: ${DUCKDB_INDEX_MAX_SPLIT_SIZE_BYTES-100_000_000}
FIRST_ROWS_MAX_BYTES: ${FIRST_ROWS_MAX_BYTES-1_000_000}
FIRST_ROWS_MIN_CELL_BYTES: ${FIRST_ROWS_MIN_CELL_BYTES-100}
FIRST_ROWS_MIN_NUMBER: ${FIRST_ROWS_MIN_NUMBER-10}
FIRST_ROWS_COLUMNS_MAX_NUMBER: ${FIRST_ROWS_COLUMNS_MAX_NUMBER-1_000}
HF_HUB_ENABLE_HF_TRANSFER: 1
OPT_IN_OUT_URLS_SCAN_COLUMNS_MAX_NUMBER: ${OPT_IN_OUT_URLS_SCAN_COLUMNS_MAX_NUMBER-10}
OPT_IN_OUT_URLS_SCAN_MAX_CONCURRENT_REQUESTS_NUMBER: ${OPT_IN_OUT_URLS_SCAN_MAX_CONCURRENT_REQUESTS_NUMBER-100}
OPT_IN_OUT_URLS_SCAN_MAX_REQUESTS_PER_SECOND: ${OPT_IN_OUT_URLS_SCAN_MAX_REQUESTS_PER_SECOND-50}
OPT_IN_OUT_URLS_SCAN_ROWS_MAX_NUMBER: ${OPT_IN_OUT_URLS_SCAN_ROWS_MAX_NUMBER-100_000}
OPT_IN_OUT_URLS_SCAN_SPAWNING_TOKEN: ${OPT_IN_OUT_URLS_SCAN_SPAWNING_TOKEN-}
OPT_IN_OUT_URLS_SCAN_URLS_NUMBER_PER_BATCH: ${OPT_IN_OUT_URLS_SCAN_URLS_NUMBER_PER_BATCH-1000}
OPT_IN_OUT_URLS_SCAN_SPAWNING_URL: ${OPT_IN_OUT_URLS_SCAN_SPAWNING_URL-https://opts-api.spawningaiapi.com/api/v2/query/urls}
PARQUET_AND_INFO_COMMIT_MESSAGE: ${PARQUET_AND_INFO_COMMIT_MESSAGE-Update parquet files}
PARQUET_AND_INFO_COMMITTER_HF_TOKEN: ${PARQUET_AND_INFO_COMMITTER_HF_TOKEN-}
PARQUET_AND_INFO_MAX_DATASET_SIZE_BYTES: ${PARQUET_AND_INFO_MAX_DATASET_SIZE_BYTES-100_000_000}
PARQUET_AND_INFO_MAX_ROW_GROUP_BYTE_SIZE_FOR_COPY: ${PARQUET_AND_INFO_MAX_ROW_GROUP_BYTE_SIZE_FOR_COPY-100_000_000}
PARQUET_AND_INFO_SOURCE_REVISION: ${PARQUET_AND_INFO_SOURCE_REVISION-main}
PARQUET_AND_INFO_TARGET_REVISION: ${PARQUET_AND_INFO_TARGET_REVISION-refs/convert/parquet}
PARQUET_AND_INFO_URL_TEMPLATE: ${PARQUET_AND_INFO_URL_TEMPLATE-/datasets/%s/resolve/%s/%s}
PARQUET_METADATA_STORAGE_DIRECTORY: ${PARQUET_METADATA_STORAGE_DIRECTORY-/parquet_metadata}
ROWS_INDEX_MAX_ARROW_DATA_IN_MEMORY: ${ROWS_INDEX_MAX_ARROW_DATA_IN_MEMORY-300_000_000}
# prometheus
PROMETHEUS_MULTIPROC_DIR: ${PROMETHEUS_MULTIPROC_DIR-}
# uvicorn
WORKER_UVICORN_HOSTNAME: 0.0.0.0 # required for docker compose
WORKER_UVICORN_NUM_WORKERS: ${WORKER_UVICORN_NUM_WORKERS-2}
WORKER_UVICORN_PORT: ${WORKER_UVICORN_PORT-8086}
# datasets
DATASETS_BASED_HF_DATASETS_CACHE: ${HF_DATASETS_CACHE-/datasets-cache}
HF_MODULES_CACHE: ${HF_DATASETS_CACHE-/modules-cache}
NUMBA_CACHE_DIR: ${NUMBA_CACHE_DIR-/numba-cache}
# worker
WORKER_CONTENT_MAX_BYTES: ${WORKER_CONTENT_MAX_BYTES-10_000_000}
WORKER_KILL_LONG_JOB_INTERVAL_SECONDS: ${WORKER_KILL_LONG_JOB_INTERVAL_SECONDS-60}
WORKER_KILL_ZOMBIES_INTERVAL_SECONDS: ${WORKER_KILL_ZOMBIES_INTERVAL_SECONDS-600}
WORKER_MAX_JOB_DURATION_SECONDS: ${WORKER_MAX_JOB_DURATION_SECONDS-1200}
WORKER_MAX_MISSING_HEARTBEATS: ${WORKER_MAX_MISSING_HEARTBEATS-5}
WORKER_MAX_LOAD_PCT: ${WORKER_MAX_LOAD_PCT-70}
WORKER_MAX_MEMORY_PCT: ${WORKER_MAX_MEMORY_PCT-80}
WORKER_SLEEP_SECONDS: ${WORKER_SLEEP_SECONDS-15}
ports:
- ${WORKER_UVICORN_PORT-8086}:${WORKER_UVICORN_PORT-8086}
depends_on:
mongodb:
condition: service_healthy
restart: always
webhook:
build:
context: ..
dockerfile: services/webhook/Dockerfile
volumes:
- storage:${STORAGE_DIRECTORY-/storage}:rw
extends:
file: docker-compose-base.yml
service: libapi
environment:
# prometheus
PROMETHEUS_MULTIPROC_DIR: ${PROMETHEUS_MULTIPROC_DIR-}
# uvicorn
API_UVICORN_HOSTNAME: 0.0.0.0 # required for docker compose
API_UVICORN_NUM_WORKERS: ${WEBHOOK_UVICORN_NUM_WORKERS-2}
API_UVICORN_PORT: ${WEBHOOK_UVICORN_PORT-8087}
ports:
# for debug
- ${WEBHOOK_UVICORN_PORT-8087}:${WEBHOOK_UVICORN_PORT-8087}
depends_on:
mongodb:
condition: service_healthy
restart: unless-stopped
mongodb:
image: "mongo:6.0.9"
ports:
- ${MONGO_PORT:-27017}:${MONGO_PORT:-27017}
command: mongod --port ${MONGO_PORT:-27017} --replSet ${MONGO_REPLICASET:-rs0} --bind_ip_all
volumes:
- mongo:/data/db:rw
healthcheck:
test: test $$(mongosh --port ${MONGO_PORT:-27017} --quiet --eval "try{rs.initiate({_id:'${MONGO_REPLICASET:-rs0}',version:1,members:[{_id:0,host:'mongodb:${MONGO_PORT:-27017}'}]})} catch(e) {rs.status().ok}") -eq 1
interval: 2s
timeout: 20s
retries: 10
start_period: 20s
start_interval: 2s
volumes:
storage:
mongo:
parquet-metadata:
duckdb-index:
descriptive-statistics: