-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
298 lines (293 loc) · 10.1 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
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
version: "3"
services:
kafka_b:
image: bitnami/kafka:latest
hostname: kafka_b
ports:
- "9092:9092"
- "9094:9094"
volumes:
- kafka_data:/bitnami
environment:
- KAFKA_ENABLE_KRAFT=yes
- KAFKA_CFG_PROCESS_ROLES=broker,controller
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_LISTENERS=PLAINTEXT:https://:9092,CONTROLLER:https://:9093,EXTERNAL:https://:9094
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT:https://127.0.0.1:9092,EXTERNAL:https://kafka_b:9094
- KAFKA_BROKER_ID=1
- [email protected]:9093
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_NODE_ID=1
- KAFKA_AUTO_CREATE_TOPICS_ENABLE=true
- KAFKA_CFG_NUM_PARTITIONS=3
healthcheck:
test: ["CMD", "sh", "-c", "unset JMX_PORT; kafka-topics.sh --bootstrap-server localhost:9092 --list"]
interval: 10s
timeout: 10s
retries: 5
networks:
- gutenberg-network
init-topics:
image: bitnami/kafka:latest
container_name: init_topics
command: >
sh -c "
/opt/bitnami/kafka/bin/kafka-topics.sh --create --if-not-exists --bootstrap-server kafka_b:9094 --replication-factor 1 --partitions 3 --topic ${OUTPUT_TOPIC} &&
/opt/bitnami/kafka/bin/kafka-topics.sh --create --if-not-exists --bootstrap-server kafka_b:9094 --replication-factor 1 --partitions 3 --topic ${GITHUB_TOPIC} &&
/opt/bitnami/kafka/bin/kafka-topics.sh --create --if-not-exists --bootstrap-server kafka_b:9094 --replication-factor 1 --partitions 3 --topic ${VECTORDB_TOPIC_NAME} &&
/opt/bitnami/kafka/bin/kafka-topics.sh --create --if-not-exists --bootstrap-server kafka_b:9094 --replication-factor 1 --partitions 3 --topic ${PDF_INPUT} &&
/opt/bitnami/kafka/bin/kafka-topics.sh --create --if-not-exists --bootstrap-server kafka_b:9094 --replication-factor 1 --partitions 3 --topic ${PROCESSED_TOPIC} &&
/opt/bitnami/kafka/bin/kafka-topics.sh --create --if-not-exists --bootstrap-server kafka_b:9094 --replication-factor 1 --partitions 3 --topic ${RESOURCE_TOPIC}
"
depends_on:
kafka_b:
condition: service_healthy
networks:
- gutenberg-network
fastapi:
container_name: fastapi
image: jgcapworh92/gutenberg-ingestion-api:latest
environment:
smtp_username: "${smtp_username}"
smtp_password: "${smtp_password}"
postgres_user: "${POSTGRES_USER}"
postgres_password: "${POSTGRES_PASSWORD}"
postgres_port: "${POSTGRES_PORT}"
postgres_db: "${POSTGRES_DB}"
postgres_server: "${POSTGRES_HOSTNAME}"
ports:
- 8000:8000
depends_on:
postgres:
condition: service_healthy
restart: always
networks:
- gutenberg-network
gateway_service:
build: .
depends_on:
init-topics:
condition: service_completed_successfully
environment:
APP_NAME: "gateway_service"
BROKERS: "${BROKERS}"
INPUT_TOPIC: "${INPUT_TOPIC}"
RESOURCE_TOPIC: "${RESOURCE_TOPIC}"
CONSUMER_CONFIG: "${CONSUMER_CONFIG}"
PRODUCER_CONFIG: "${PRODUCER_CONFIG}"
volumes:
- ./recovery/gateway_service:/bytewax/recovery/gateway_service
- ./logs:/bytewax/logs
networks:
- gutenberg-network
command: ["python", "-m", "bytewax.run", "-r", "/bytewax/recovery/gateway_service", "-s", "3", "-b", "0", "-w4", "dataflows/gateway_service"]
github_listener:
build: .
container_name: github_retriever
depends_on:
init-topics:
condition: service_completed_successfully
environment:
APP_NAME: "github_retriever"
BROKERS: "${BROKERS}"
INPUT_TOPIC: "${INPUT_TOPIC}"
OUTPUT_TOPIC: "${OUTPUT_TOPIC}"
GITHUB_TOKEN: "${GITHUB_TOKEN}"
VECTORDB_TOPIC_NAME: "${VECTORDB_TOPIC_NAME}"
CONSUMER_CONFIG: "${CONSUMER_CONFIG}"
PRODUCER_CONFIG: "${PRODUCER_CONFIG}"
volumes:
- ./recovery/github_listener:/bytewax/recovery/github_listener
- ./logs:/bytewax/logs
networks:
- gutenberg-network
command: ["python", "-m", "bytewax.run", "-r", "/bytewax/recovery/github_listener", "-s", "3", "-b", "0", "-w4", "dataflows/github_commit_processing"]
llm_summary_service:
build: .
container_name: llm_summary_service
depends_on:
init-topics:
condition: service_completed_successfully
environment:
APP_NAME: "llm_summary_service"
BROKERS: "${BROKERS}"
OUTPUT_TOPIC: "${OUTPUT_TOPIC}"
GITHUB_TOKEN: "${GITHUB_TOKEN}"
PROCESSED_TOPIC: "${PROCESSED_TOPIC}"
CONSUMER_CONFIG: "${CONSUMER_CONFIG}"
PRODUCER_CONFIG: "${PRODUCER_CONFIG}"
MODEL_PROVIDER: "${MODEL_PROVIDER}"
VECTORDB_TOPIC_NAME: "${VECTORDB_TOPIC_NAME}"
TEMPLATE: "${TEMPLATE}"
OPENAI_API_KEY: "${OPENAI_API_KEY}"
LOCAL_LLM_URL: "${LOCAL_LLM_URL}"
volumes:
- ./recovery/commit_summary_service:/bytewax/recovery/commit_summary_service
- ./logs:/bytewax/logs
networks:
- gutenberg-network
command: ["python", "-m", "bytewax.run", "-r", "/bytewax/recovery/commit_summary_service", "-s", "3", "-b", "0", "-w4", "dataflows/commit_summary_service"]
pdf_summary_service:
build: .
container_name: pdf_summary_service
depends_on:
init-topics:
condition: service_completed_successfully
environment:
APP_NAME: "pdf_summary_service"
BROKERS: "${BROKERS}"
OUTPUT_TOPIC: "${OUTPUT_TOPIC}"
GITHUB_TOKEN: "${GITHUB_TOKEN}"
PROCESSED_TOPIC: "${PROCESSED_TOPIC}"
CONSUMER_CONFIG: "${CONSUMER_CONFIG}"
PRODUCER_CONFIG: "${PRODUCER_CONFIG}"
MODEL_PROVIDER: "${MODEL_PROVIDER}"
VECTORDB_TOPIC_NAME: "${VECTORDB_TOPIC_NAME}"
PDF_INPUT: "${PDF_INPUT}"
TEMPLATE: "${TEMPLATE}"
OPENAI_API_KEY: "${OPENAI_API_KEY}"
LOCAL_LLM_URL: "${LOCAL_LLM_URL}"
volumes:
- ./recovery/pdf_service:/bytewax/recovery/pdf_service
networks:
- gutenberg-network
command: ["python", "-m", "bytewax.run", "-r", "/bytewax/recovery/pdf_service", "-s", "3", "-b", "0", "-w4", "dataflows/pdfProcessing"]
qdrant:
image: qdrant/qdrant
ports:
- "6333:6333"
- "6334:6334"
volumes:
- qdrant-storage:/qdrant/storage:z
networks:
- gutenberg-network
add_qdrant_service:
build: .
container_name: add_qdrant_service
depends_on:
init-topics:
condition: service_completed_successfully
environment:
APP_NAME: "add_qdrant_service"
BROKERS: "${BROKERS}"
OUTPUT_TOPIC: "${OUTPUT_TOPIC}"
GITHUB_TOKEN: "${GITHUB_TOKEN}"
PROCESSED_TOPIC: "${PROCESSED_TOPIC}"
CONSUMER_CONFIG: "${CONSUMER_CONFIG}"
PRODUCER_CONFIG: "${PRODUCER_CONFIG}"
VECTORDB_TOPIC_NAME: "${VECTORDB_TOPIC_NAME}"
MODEL_PROVIDER: "${MODEL_PROVIDER}"
TEMPLATE: "${TEMPLATE}"
OPENAI_API_KEY: "${OPENAI_API_KEY}"
LOCAL_LLM_URL: "${LOCAL_LLM_URL}"
volumes:
- ./recovery/add_qdrant_service:/bytewax/recovery/add_qdrant_service
- ./logs:/bytewax/logs
networks:
- gutenberg-network
command: ["python", "-m", "bytewax.run", "-r", "/bytewax/recovery/add_qdrant_service", "-s", "3", "-b", "0", "-w4", "dataflows/add_qdrant_service"]
kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
depends_on:
init-topics:
condition: service_completed_successfully
ports:
- 8080:8080
environment:
DYNAMIC_CONFIG_ENABLED: 'true'
volumes:
- ./kui/config.yml:/etc/kafkaui/dynamic_config.yaml
networks:
- gutenberg-network
postgres:
image: postgres:16.2
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "5432:5432"
command:
- "postgres"
- "-c"
- "wal_level=logical"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- gutenberg-network
pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: adminpassword
PGADMIN_LISTEN_PORT: 80
depends_on:
- postgres
ports:
- "5050:80"
volumes:
- pgadmin-data:/var/lib/pgadmin
networks:
- gutenberg-network
debezium:
image: debezium/connect:2.6.2.Final
hostname: debezium
ports:
- "8083:8083"
depends_on:
- kafka_b
- postgres
- fastapi
environment:
BOOTSTRAP_SERVERS: kafka_b:9094
GROUP_ID: 1
CONFIG_STORAGE_TOPIC: debezium_connect_configs
OFFSET_STORAGE_TOPIC: debezium_connect_offsets
STATUS_STORAGE_TOPIC: debezium_connect_statuses
KEY_CONVERTER_SCHEMAS_ENABLE: "false"
VALUE_CONVERTER_SCHEMAS_ENABLE: "false"
CONNECT_KEY_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_REST_ADVERTISED_HOST_NAME: "debezium"
CONNECT_CONFIG_PROVIDERS: 'env'
CONNECT_CONFIG_PROVIDERS_ENV_CLASS: 'org.apache.kafka.common.config.provider.EnvVarConfigProvider'
POSTGRES_HOSTNAME: ${POSTGRES_HOSTNAME}
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD", "curl", "-f", "https://localhost:8083/"]
interval: 30s
timeout: 10s
retries: 5
start_period: 40s
networks:
- gutenberg-network
init-debezium:
image: curlimages/curl:latest
depends_on:
debezium:
condition: service_healthy
entrypoint: /kafka/debezium-setup/init-connector-config.sh
volumes:
- ./debezium-setup:/kafka/debezium-setup:ro
networks:
- gutenberg-network
volumes:
qdrant-storage:
driver: local
kafka_data:
driver: local
postgres-data:
pgadmin-data:
networks:
gutenberg-network:
driver: bridge