-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
434 lines (414 loc) · 12.6 KB
/
docker-compose.yaml
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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
version: "3.3"
networks:
cogniplant:
driver: overlay
services:
zookeeper:
hostname: zookeeper
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_MY_ID: 1
ZOOKEEPER_CLIENT_PORT: ${ZOOKEEPER_CLIENT_PORT}
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_SERVERS: ${ZOOKEEPER_SERVERS}
volumes:
- ./cogniplant/zookeeper/data:/var/lib/zookeeper/data
- ./cogniplant/zookeeper/log:/var/lib/zookeeper/log
deploy:
placement:
constraints:
- node.labels.role==master
resources:
limits:
cpus: '0.30'
memory: 4024M
networks:
- cogniplant
kafka:
image: confluentinc/cp-kafka:latest
ports:
- 19092:19092
- 9092:9092
depends_on:
- zookeeper
environment:
KAFKA_LISTENERS: 'INTERNAL://:${KAFKA_INTERNAL},EXTERNAL://:${KAFKA_EXTERNAL}'
KAFKA_ADVERTISED_LISTENERS: 'INTERNAL://kafka:${KAFKA_INTERNAL},EXTERNAL://${HOST}:${KAFKA_EXTERNAL}'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT" #later use SSL
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:${ZOOKEEPER_CLIENT_PORT}'
KAFKA_BROKER_ID: 1
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
volumes:
- ./cogniplant/kafka/data:/var/lib/kafka/data
deploy:
placement:
constraints:
- node.labels.role==master
resources:
limits:
cpus: '0.30'
memory: 4096M
networks:
- cogniplant
kafka-rest-proxy:
image: confluentinc/cp-kafka-rest:latest
depends_on:
- zookeeper
- kafka
- schema-registry
ports:
- 8022:8022
environment:
KAFKA_REST_LISTENERS: 'http://127.0.0.1:8022'
KAFKA_REST_SCHEMA_REGISTRY_URL: 'http://schema-registry:${SCHEMA_REGISTRY_PORT}'
KAFKA_REST_HOST_NAME: kafka-rest-proxy
KAFKA_REST_BOOTSTRAP_SERVERS: 'PLAINTEXT://kafka:${KAFKA_INTERNAL}'
volumes:
- ./cogniplant/kafka-rest-proxy/log:/datalog
deploy:
placement:
constraints:
- node.labels.role==master
resources:
limits:
cpus: '0.10'
memory: 1096M
networks:
- cogniplant
schema-registry:
image: confluentinc/cp-schema-registry:latest
hostname: schema-registry
ports:
- 8081:8081
environment:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'kafka:${KAFKA_INTERNAL}'
volumes:
- ./cogniplant/schema-registry/data:/data
- ./cogniplant/schema-registry/log:/datalog
depends_on:
- zookeeper
- kafka
deploy:
placement:
constraints:
- node.labels.role==master
resources:
limits:
cpus: '0.10'
memory: 512M
networks:
- cogniplant
kafka-connect:
image: confluentinc/cp-kafka-connect:latest
hostname: kafka-connect
ports:
- "8083:8083"
environment:
CONNECT_REST_PORT: ${CONNECT_REST_PORT}
CONNECT_BOOTSTRAP_SERVERS: 'kafka:${KAFKA_INTERNAL}'
# Required. A unique string that identifies the Connect cluster group this worker belongs to.
CONNECT_GROUP_ID: compose-connect-group
# Connect will actually use Kafka topics as a datastore for configuration and other data. #meta
# Required. The name of the topic where connector and task configuration data are stored.
CONNECT_CONFIG_STORAGE_TOPIC: docker-connect-configs
# Required. The name of the topic where connector and task configuration offsets are stored.
CONNECT_OFFSET_STORAGE_TOPIC: docker-connect-offsets
# Required. The name of the topic where connector and task configuration status updates are stored.
CONNECT_STATUS_STORAGE_TOPIC: docker-connect-status
# Required. Converter class for key Connect data. This controls the format of the
# data that will be written to Kafka for source connectors or read from Kafka for sink connectors.
CONNECT_KEY_CONVERTER: io.confluent.connect.avro.AvroConverter
# Allows connect to leverage the power of schema registry. Here we define it for key schemas.
CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: 'http://schema-registry:${SCHEMA_REGISTRY_PORT}'
# Required. Converter class for value Connect data. This controls the format of the
# data that will be written to Kafka for source connectors or read from Kafka for sink connectors.
CONNECT_VALUE_CONVERTER: io.confluent.connect.avro.AvroConverter
# Allows connect to leverage the power of schema registry. Here we define it for value schemas.
CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: 'http://schema-registry:${SCHEMA_REGISTRY_PORT}'
# Required. Converter class for internal key Connect data that implements the Converter interface.
CONNECT_INTERNAL_KEY_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
# Required. Converter class for offset value Connect data that implements the Converter interface.
CONNECT_INTERNAL_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
# Required. The hostname that will be given out to other workers to connect to.
CONNECT_REST_ADVERTISED_HOST_NAME: "kafka-connect"
# The next three are required when running in a single-node cluster, as we are.
# We would be able to take the default (of 3) if we had three or more nodes in the cluster.
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_PLUGIN_PATH: '/usr/share/java,/etc/kafka-connect/jars'
volumes:
- ./cogniplant/kafka-connect/connectors:/etc/kafka-connect/jars/
deploy:
placement:
constraints:
- node.labels.role==master
resources:
limits:
cpus: '0.50'
memory: 3048M
networks:
- cogniplant
depends_on:
- zookeeper
- kafka
kafka-connect-ui:
image: landoop/kafka-connect-ui
hostname: kafka-connect-ui
ports:
- "${CONNECT_UI_PORT}:9004"
environment:
CONNECT_URL: 'http://kafka-connect:${CONNECT_REST_PORT}/'
PORT: 9004
deploy:
placement:
constraints:
- node.labels.role==master
depends_on:
- kafka-connect
networks:
- cogniplant
kafdrop:
image: obsidiandynamics/kafdrop
ports:
- '${KAFDROP_UI_PORT}:9000'
environment:
KAFKA_BROKERCONNECT: 'kafka:${KAFKA_INTERNAL}'
JVM_OPTS: "-Xms16M -Xmx48M"
deploy:
placement:
constraints:
- node.labels.role==master
depends_on:
- kafka
networks:
- cogniplant
# Create a service called spark-master for stream processing
spark-master-stream:
image: "bde2020/spark-master:latest"
ports:
- '${SPARK_MASTER_STREAM_UI_PORT}:8080'
- "7078:7077"
environment:
- INIT_DAEMON_STEP=setup_spark
volumes:
- ./cogniplant/spark/applications:/opt/spark-apps
- ./cogniplant/spark/data:/opt/spark-data
deploy:
placement:
constraints:
- node.labels.role==master
resources:
limits:
cpus: '0.2'
memory: 2096M
replicas: 1
networks:
- cogniplant
#SPARK_WORKER_PORT / SPARK_WORKER_WEBUI_PORT, to use non-default ports for the worker
# Create a spark-worker for stream processing
spark-worker-stream:
image: "bde2020/spark-worker:latest"
ports:
- "18081:8081"
environment:
- SPARK_MASTER=spark://spark-master-stream:7077
- SPARK_WORKER_CORES=${SPARK_WORKER_STREAM_CORES}
- SPARK_WORKER_MEMORY=${SPARK_WORKER_STREAM_MEMORY}
volumes:
- ./cogniplant/spark/applications:/opt/spark-apps
- ./cogniplant/spark/data:/opt/spark-data
depends_on:
- spark-master-stream
deploy:
resources:
limits:
cpus: '0.2'
memory: 2096M
placement:
constraints:
- node.labels.role==master
replicas: 1
networks:
- cogniplant
#Create a service called spark-master for batch processing
spark-master-batch:
image: "bde2020/spark-master:latest"
ports:
- "${SPARK_MASTER_BATCH_UI_PORT}:8080"
- "7079:7077"
environment:
- INIT_DAEMON_STEP=setup_spark
volumes:
- ./cogniplant/spark/applications:/opt/spark-apps
- ./cogniplant/spark/data:/opt/spark-data
deploy:
placement:
constraints:
- node.labels.role==master
resources:
limits:
cpus: '0.2'
memory: 2096M
replicas: 1
networks:
- cogniplant
# Create a spark-worker for batch processing
spark-worker-batch:
image: "bde2020/spark-worker:latest"
ports:
- "28081:28081"
environment:
- SPARK_MASTER=spark://spark-master-batch:7077
- SPARK_WORKER_CORES=${SPARK_WORKER_BATCH_CORES}
- SPARK_WORKER_MEMORY=${SPARK_WORKER_BATCH_MEMORY}
volumes:
- ./cogniplant/spark/applications:/opt/spark-apps
- ./cogniplant/spark/data:/opt/spark-data
depends_on:
- spark-master-batch
deploy:
resources:
limits:
cpus: '0.2'
memory: 2096M
placement:
constraints:
- node.labels.role==master
replicas: 1
networks:
- cogniplant
influxdb:
image: influxdb:latest
ports:
- '8086:8086'
volumes:
- ./cogniplant/influxdb/data:/var/lib/influxdb
environment:
- INFLUXDB_DB=${INFLUXDB_DB_NAME}
- INFLUXDB_ADMIN_USER=${INFLUXDB_ADMIN_USER}
- INFLUXDB_ADMIN_PASSWORD=${INFLUXDB_ADMIN_PASSWORD}
deploy:
resources:
limits:
cpus: '0.3'
memory: 3096M
placement:
constraints:
- node.labels.role==master
replicas: 1
networks:
- cogniplant
chronograf:
image: chronograf
ports:
- '${CHRONOGRAF_UI_PORT}:8888'
depends_on:
- influxdb
environment:
- INFLUXDB_URL=${INFLUXDB_URL}
- INFLUXDB_USERNAME=${CHRONOGRAF_USERNAME}
- INFLUXDB_PASSWORD=${CHRONOGRAF_PWD}
volumes:
- ./cogniplant/chronograf/data:/var/lib/chronograf
deploy:
resources:
limits:
cpus: '0.1'
memory: 1096M
placement:
constraints:
- node.labels.role==master
networks:
- cogniplant
grafana:
image: grafana/grafana:latest
ports:
- '${GRAFANA_UI_PORT}:3000'
volumes:
- ./cogniplant/grafana/data:/var/lib/grafana
- ./cogniplant/grafana/log:/var/log/grafana
- ./cogniplant/grafana/provisioning:/etc/grafana/provisioning
depends_on:
- influxdb
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_USERNAME}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PWD}
deploy:
resources:
limits:
cpus: '0.1'
memory: 1096M
placement:
constraints:
- node.labels.role==master
networks:
- cogniplant
portainer:
image: portainer/portainer:latest
hostname: portainer
command: -H unix:///var/run/docker.sock
ports:
- '${PORTAINER_UI_PORT}:9000'
- 8000:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./cogniplant/portainer/data:/data
deploy:
placement:
constraints:
- node.labels.role==master
resources:
limits:
cpus: '0.10'
memory: 1024M
networks:
- cogniplant
schema-registry-ui:
image: landoop/schema-registry-ui:latest
hostname: schema-registry-ui
ports:
- '${SCHEMA_REGISTRY_UI_PORT}:8000'
environment:
SCHEMAREGISTRY_URL: http://schema-registry:${SCHEMA_REGISTRY_PORT}/
PROXY: "true"
volumes:
- ./cogniplant/schema-registry-ui/data:/data
depends_on:
- schema-registry
deploy:
placement:
constraints:
- node.labels.role==master
resources:
limits:
cpus: '0.10'
memory: 1024M
networks:
- cogniplant
mlflow_db:
image: postgres
hostname: mlflow_db
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PWD}
ports:
- 5432:5432
volumes:
- ./cogniplant/postgres/data:/var/lib/postgres
deploy:
resources:
limits:
cpus: '0.1'
memory: 1024M
placement:
constraints:
- node.labels.role==master
networks:
- cogniplant