-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.mirror.yml
325 lines (304 loc) · 9.52 KB
/
compose.mirror.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
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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
services:
nginx-mirror:
image: nginx
volumes:
- "./conf/mirror/nginx.conf:/etc/nginx/nginx.conf:ro"
ports:
- "80"
# create a dedicated db for the mirror
swh-mirror-storage-db:
image: postgres:16
environment:
POSTGRES_DB: swh-mirror-storage
POSTGRES_PASSWORD: testpassword
# and an RPC server
swh-mirror-storage:
image: swh/stack:${SWH_IMAGE_TAG:-latest}
build: ./
depends_on:
- swh-mirror-storage-db
- swh-mirror-objstorage
- prometheus-statsd-exporter
- nginx-mirror
env_file:
- ./env/common_python.env
environment:
DB_FLAVOR: mirror
POSTGRES_DB: swh-mirror-storage
RPC_PORT: 5002
command: rpc
healthcheck:
test: curl -f http://localhost:5002 || exit 1
retries: 6
volumes:
- "./conf/mirror/storage.yml:/srv/softwareheritage/config.yml:ro"
- "./services/swh-storage/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
# Mirror storage for public access (masking applied)
swh-mirror-masking-db:
image: postgres:16
environment:
POSTGRES_DB: swh-mirror-masking
POSTGRES_PASSWORD: testpassword
volumes:
- "./services/initdb.d:/docker-entrypoint-initdb.d"
- mirror-masking-data:/var/lib/postgresql
swh-mirror-storage-public:
image: swh/stack
build: ./
depends_on:
- swh-mirror-storage
- swh-mirror-masking-db
command: rpc
environment:
POSTGRES_DB: swh-mirror-masking
RPC_PORT: 5002
healthcheck:
test: curl -f http://localhost:5002 || exit 1
retries: 6
volumes:
- "./conf/mirror/storage-public.yml:/srv/softwareheritage/config.yml:ro"
- "./services/swh-storage/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
# Object storage
swh-mirror-objstorage:
build: ./
image: swh/stack:${SWH_IMAGE_TAG:-latest}
env_file:
- ./env/common_python.env
depends_on:
- prometheus-statsd-exporter
environment:
RPC_PORT: 5003
command: rpc
healthcheck:
test: curl -f http://localhost:5003 || exit 1
retries: 6
volumes:
- "./conf/objstorage.yml:/srv/softwareheritage/config.yml:ro"
- "./services/swh-objstorage/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
- /srv/softwareheritage/objects
# a dedicated swh-web db
swh-mirror-web-db:
image: postgres:16
environment:
POSTGRES_DB: swh-mirror-web
POSTGRES_PASSWORD: testpassword
volumes:
- "./services/initdb.d:/docker-entrypoint-initdb.d"
# a dedicated swh-web
swh-mirror-web:
build: ./
image: swh/stack:${SWH_IMAGE_TAG:-latest}
depends_on:
- swh-mirror-storage-public
- swh-mirror-web-db
- prometheus-statsd-exporter
- nginx-mirror
env_file:
- ./env/common_python.env
environment:
POSTGRES_DB: swh-mirror-web
VERBOSITY: 3
DJANGO_SETTINGS_MODULE: swh.web.settings.production
healthcheck:
test: curl -f http://localhost:5004 || exit 1
retries: 6
volumes:
- "./conf/mirror/web.yml:/srv/softwareheritage/config.yml:ro"
- "./services/swh-web/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
- "./assets/mirror/:/mirror/:ro"
# and the background processes that keeps the mirror in sync with the
# main graph
swh-mirror-storage-replayer:
image: swh/stack:${SWH_IMAGE_TAG:-latest}
build: ./
depends_on:
- kafka
- swh-mirror-storage
- prometheus-statsd-exporter
- nginx-mirror
env_file:
- ./env/common_python.env
environment:
SWH_LOG_LEVELS: debug
command: replayer
volumes:
- "./conf/mirror/replayer.yml:/srv/softwareheritage/config.yml:ro"
- "./services/swh-storage/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
deploy:
mode: replicated
replicas: 2
swh-mirror-objstorage-replayer:
image: swh/stack:${SWH_IMAGE_TAG:-latest}
build: ./
depends_on:
- kafka
- prometheus-statsd-exporter
- swh-objstorage
- swh-mirror-objstorage
- nginx
- nginx-mirror
env_file:
- ./env/common_python.env
environment:
SWH_LOG_LEVELS: debug
command: replayer
volumes:
- "./conf/mirror/content-replayer.yml:/srv/softwareheritage/config.yml:ro"
- "./services/swh-objstorage/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
deploy:
mode: replicated
replicas: 4
# and a vault full-stack
swh-mirror-vault-db:
image: postgres:16
environment:
POSTGRES_DB: swh-mirror-vault
POSTGRES_PASSWORD: testpassword
volumes:
- "./services/initdb.d:/docker-entrypoint-initdb.d"
swh-mirror-vault:
image: swh/stack:${SWH_IMAGE_TAG:-latest}
build: ./
env_file:
- ./env/common_python.env
environment:
POSTGRES_DB: swh-mirror-vault
RPC_PORT: 5005
command: rpc
healthcheck:
test: curl -f http://localhost:5005 || exit 1
retries: 6
depends_on:
- swh-mirror-vault-db
- swh-mirror-objstorage
- swh-mirror-storage-public
- swh-mirror-scheduler
- prometheus-statsd-exporter
- nginx-mirror
volumes:
- "./conf/mirror/vault.yml:/srv/softwareheritage/config.yml:ro"
- "./services/swh-vault/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
swh-mirror-vault-worker:
image: swh/stack:${SWH_IMAGE_TAG:-latest}
build: ./
command: worker
env_file:
- ./env/common_python.env
- ./env/workers.env
environment:
SWH_SCHEDULER_HOST: swh-mirror-scheduler
SWH_SCHEDULER_INSTANCE: http://nginx-mirror/rpc/scheduler
depends_on:
- swh-mirror-vault
- swh-mirror-storage
- prometheus-statsd-exporter
- nginx-mirror
volumes:
- "./conf/mirror/vault-worker.yml:/srv/softwareheritage/config.yml:ro"
- "./services/swh-vault/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
swh-mirror-scheduler-db:
image: postgres:16
environment:
POSTGRES_DB: swh-mirror-scheduler
POSTGRES_PASSWORD: testpassword
volumes:
- "./services/initdb.d:/docker-entrypoint-initdb.d"
swh-mirror-scheduler:
image: swh/stack:${SWH_IMAGE_TAG:-latest}
build: ./
env_file:
- ./env/common_python.env
environment:
POSTGRES_DB: swh-mirror-scheduler
# this is required because currently the 'swh scheduler' does not honor
# the SWH_CONFIG_FILENAME env var...
SWH_SCHEDULER_CONFIG_FILE: /srv/softwareheritage/config.yml
RPC_PORT: 5008
BROKER_URL: amqp://amqp-mirror/
command: rpc
healthcheck:
test: curl -f http://localhost:5008 || exit 1
retries: 6
depends_on:
- swh-mirror-scheduler-db
- amqp-mirror
- prometheus-statsd-exporter
volumes:
- "./conf/mirror/scheduler.yml:/srv/softwareheritage/config.yml:ro"
- "./services/swh-scheduler/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
swh-mirror-scheduler-listener:
image: swh/stack:${SWH_IMAGE_TAG:-latest}
build: ./
env_file:
- ./env/common_python.env
environment:
POSTGRES_DB: swh-mirror-scheduler
SWH_LOG_LEVELS: info
SWH_SCHEDULER_CONFIG_FILE: /srv/softwareheritage/config.yml
BROKER_URL: amqp://amqp-mirror/
WORKER_INSTANCES: vault
APP: swh.scheduler.celery_backend.config.app
command: worker start-listener
depends_on:
- swh-mirror-scheduler
- amqp-mirror
- prometheus-statsd-exporter
volumes:
- "./conf/mirror/scheduler.yml:/srv/softwareheritage/config.yml:ro"
- "./services/swh-scheduler/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
swh-mirror-scheduler-runner:
image: swh/stack:${SWH_IMAGE_TAG:-latest}
build: ./
env_file:
- ./env/common_python.env
environment:
POSTGRES_DB: swh-mirror-scheduler
SWH_LOG_LEVELS: info
SWH_SCHEDULER_CONFIG_FILE: /srv/softwareheritage/config.yml
BROKER_URL: amqp://amqp-mirror/
WORKER_INSTANCES: vault
APP: swh.scheduler.celery_backend.config.app
command: worker start-runner --period 10
depends_on:
- swh-mirror-scheduler
- amqp-mirror
- prometheus-statsd-exporter
volumes:
- "./conf/mirror/scheduler.yml:/srv/softwareheritage/config.yml:ro"
- "./services/swh-scheduler/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
amqp-mirror:
image: rabbitmq:3.13-management
swh-mirror-notification-watcher:
image: swh/stack
build: ./
env_file:
- ./env/common_python.env
environment:
SWH_LOG_LEVELS: info
PGCFG_0: swh-mirror-storage
PGCFG_1: swh-mirror-masking
command: run-mirror-notification-watcher
depends_on:
- kafka
- kafka-create-topics
- swh-mirror-storage
- swh-mirror-masking-db
- smtp
volumes:
- "./conf/mirror/alter.yml:/srv/softwareheritage/config.yml:ro"
- "./conf/mirror/age-identities.txt:/srv/softwareheritage/age-identities.txt:ro"
- "./services/swh-alter/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
# the alter service for the main archive side
swh-alter:
image: swh/stack:${SWH_IMAGE_TAG:-latest}
build: ./
environment:
POSTGRES_DB: swh-storage
command: mock-graph
volumes:
- "./tests/alter_companion.py:/src/alter_companion.py:ro"
- "./services/swh-alter/entrypoint.sh:/srv/softwareheritage/entrypoint.sh:ro"
- "./conf/mirror/alter-main.yml:/srv/softwareheritage/config.yml:ro"
- "./conf/alter/age-identities.txt:/srv/softwareheritage/age-identities.txt:ro"
volumes:
mirror-masking-data: