forked from Picred/air-quality-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
137 lines (127 loc) · 3.46 KB
/
docker-compose.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
networks:
aqm:
name: aqm
ipam:
driver: default
config:
- subnet: 10.0.100.0/24
services:
kafka_zk:
build:
context: kafka/
dockerfile: Dockerfile
container_name: kafkaZK
environment:
KAFKA_ACTION: start-zk
networks:
aqm:
ipv4_address: 10.0.100.22
ports:
- "2181:2181"
kafka_server:
build:
context: kafka/
dockerfile: Dockerfile
environment:
- KAFKA_ACTION=start-kafka
container_name: kafkaServer
hostname: kafkaServer
restart: always
depends_on:
- kafka_zk
networks:
aqm:
ipv4_address: 10.0.100.23
ports:
- "9092:9092"
kafka_ui:
image: provectuslabs/kafka-ui:v0.7.2
environment:
- KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=10.0.100.23:9092
- KAFKA_CLUSTERS_0_ZOOKEEPER=10.0.100.22:2181
container_name: kafkaUI
networks:
aqm:
ports:
- "8080:8080"
logstash:
image: docker.elastic.co/logstash/logstash:8.13.0
hostname: logstash
container_name: logstash
volumes:
- ./logstash/pipeline/from_python_to_kafka.conf:/usr/share/logstash/pipeline/logstash.conf
environment:
- XPACK_MONITORING_ENABLED=false
networks:
aqm:
ingestion_manager:
build:
context: ingestion_manager
dockerfile: Dockerfile
hostname: ingestion_manager
container_name: ingestion_manager
volumes:
- ./ingestion_manager:/ingestion_manager
depends_on:
- logstash
networks:
aqm:
spark:
build:
context: spark/
dockerfile: Dockerfile
hostname: spark
container_name: spark
restart: always
volumes:
- ./spark/code/app.py:/opt/aqm/app.py
- ./ingestion_manager/data/historical_data.csv:/opt/spark/work-dir/data.csv
- ./spark/model:/opt/spark/work-dir/model
command: >
/opt/spark/bin/spark-submit --conf spark.driver.extraJavaOptions="-Divy.cache.dir=/tmp -Divy.home=/tmp" --packages org.apache.spark:spark-sql-kafka-0-10_2.12:3.5.1,org.elasticsearch:elasticsearch-spark-30_2.12:8.13.4 /opt/aqm/app.py
networks:
aqm:
ports:
- "4040:4040"
depends_on:
elasticsearch:
condition: service_healthy
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.13.4
environment:
- discovery.type=single-node
- xpack.security.enabled=false
mem_limit: 1 GB
hostname: elasticsearch
container_name: elasticsearch
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9200/_cluster/health"]
interval: 15s
timeout: 15s
retries: 5
start_period: 90s
networks:
aqm:
ports:
- "9200:9200"
kibana:
hostname: kibana
container_name: kibana
image: docker.elastic.co/kibana/kibana:8.13.4
ports:
- "5601:5601"
volumes:
- ./kibana/kibana.yml:/usr/share/kibana/config/kibana.yml
networks:
aqm:
# Uncomment to train the model with historical data
# train_model:
# build:
# context: spark/
# dockerfile: Dockerfile
# volumes:
# - ./spark/code/train_model.py:/opt/aqm/train_model.py
# - ./ingestion_manager/data/historical_data.csv:/opt/spark/work-dir/data.csv
# - ./spark/model:/opt/spark/work-dir/model
# command: >
# /opt/spark/bin/spark-submit --conf spark.driver.extraJavaOptions="-Divy.cache.dir=/tmp -Divy.home=/tmp" --packages org.apache.spark:spark-sql-kafka-0-10_2.12:3.5.1 /opt/aqm/train_model.py