-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathdocker-compose-choreo.yml
More file actions
274 lines (262 loc) · 7.87 KB
/
Copy pathdocker-compose-choreo.yml
File metadata and controls
274 lines (262 loc) · 7.87 KB
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
version: '3.8'
name: ldf-choreo
services:
mongodb-choreo:
build:
context: ./deployment/choreo/development/docker/mongodb
dockerfile: Dockerfile
container_name: mongodb-choreo
ports:
- "27017:27017"
volumes:
- mongodb_choreo_data:/data/db
networks:
- choreo-network
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=admin123
- MONGO_INITDB_DATABASE=opengin
# GitHub backup restore configuration
- GITHUB_BACKUP_REPO=${OPENGIN_GITHUB_BACKUP_REPO:-LDFLK/data-backups}
- BACKUP_VERSION=${OPENGIN_DB_BACKUP_VERSION:-0.0.4}
- BACKUP_ENVIRONMENT=${OPENGIN_CHOREO_ENVIRONMENT:-development}
- RESTORE_FROM_GITHUB=true
healthcheck:
test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ]
interval: 10s
timeout: 10s
retries: 5
start_period: 30s
neo4j-choreo:
build:
context: ./deployment/choreo/development/docker/neo4j
dockerfile: Dockerfile
args:
GITHUB_BACKUP_REPO: ${OPENGIN_GITHUB_BACKUP_REPO:-LDFLK/data-backups}
BACKUP_VERSION: ${OPENGIN_DB_BACKUP_VERSION:-0.0.4}
BACKUP_ENVIRONMENT: ${OPENGIN_CHOREO_ENVIRONMENT:-development}
container_name: neo4j-choreo
ports:
- "7474:7474"
- "7687:7687"
volumes:
- neo4j_choreo_data:/data
- neo4j_choreo_logs:/logs
networks:
- choreo-network
environment:
- NEO4J_AUTH=neo4j/neo4j123
- NEO4J_server_memory_pagecache_size=1G
- NEO4J_server_memory_heap_initial__size=1G
- NEO4J_server_memory_heap_max__size=1G
- NEO4J_server_default__listen__address=0.0.0.0
- NEO4J_server_bolt_listen__address=0.0.0.0:7687
- NEO4J_server_http_listen__address=0.0.0.0:7474
# GitHub backup restore configuration
- GITHUB_BACKUP_REPO=${OPENGIN_GITHUB_BACKUP_REPO:-LDFLK/data-backups}
- BACKUP_VERSION=${OPENGIN_DB_BACKUP_VERSION:-0.0.4}
- BACKUP_ENVIRONMENT=${OPENGIN_CHOREO_ENVIRONMENT:-development}
- RESTORE_FROM_GITHUB=true
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:7474 || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
postgres-choreo:
build:
context: ./deployment/choreo/development/docker/postgres
dockerfile: Dockerfile
container_name: postgres-choreo
ports:
- "5432:5432"
volumes:
- postgres_choreo_data:/var/lib/postgresql/data
- postgres_choreo_backup:/var/lib/postgresql/backup
networks:
- choreo-network
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=opengin
# GitHub backup restore configuration (disabled for development)
- GITHUB_BACKUP_REPO=${OPENGIN_GITHUB_BACKUP_REPO:-LDFLK/data-backups}
- BACKUP_VERSION=${OPENGIN_DB_BACKUP_VERSION:-0.0.4}
- BACKUP_ENVIRONMENT=${OPENGIN_CHOREO_ENVIRONMENT:-development}
- RESTORE_FROM_GITHUB=true
- FORCE_RESTORE=${FORCE_RESTORE:-false}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -h /tmp" ]
interval: 10s
timeout: 5s
retries: 5
heartbeat-choreo:
platform: linux/amd64
build:
context: ./deployment/choreo/development/docker/heartbeat
dockerfile: Dockerfile
container_name: heartbeat-choreo
networks:
- choreo-network
environment:
- NEO4J_URL=http://neo4j-choreo:7474
- NEO4J_USER=neo4j
- NEO4J_PASSWORD=neo4j123
- POSTGRES_HOST=postgres-choreo
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=opengin
- MONGODB_HOST=mongodb-choreo
- MONGODB_PORT=27017
- MONGODB_USER=admin
- MONGODB_PASSWORD=admin123
- MONGODB_DB=opengin
- HEARTBEAT_INTERVAL=30
depends_on:
- neo4j-choreo
- mongodb-choreo
- postgres-choreo
restart: unless-stopped
cleanup-choreo:
build:
context: .
dockerfile: deployment/development/docker/cleanup/Dockerfile.choreo
container_name: cleanup-choreo
networks:
- choreo-network
environment:
- POSTGRES_HOST=postgres-choreo
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=opengin
- MONGO_URI=mongodb://admin:admin123@mongodb-choreo:27017/admin?authSource=admin
- MONGO_DB_NAME=opengin
- NEO4J_URI=bolt://neo4j-choreo:7687
- NEO4J_USER=neo4j
- NEO4J_PASSWORD=neo4j123
depends_on:
- postgres-choreo
- mongodb-choreo
- neo4j-choreo
profiles:
- cleanup
core-choreo:
build:
context: ./opengin/core-api
dockerfile: docker/Dockerfile.choreo
container_name: core-choreo
ports:
- "50051:50051"
environment:
# Neo4j Configuration (using choreo Neo4j)
- NEO4J_URI=bolt://neo4j-choreo:7687
- NEO4J_USER=neo4j
- NEO4J_PASSWORD=neo4j123
# MongoDB Configuration (using choreo MongoDB)
- MONGO_URI=mongodb://admin:admin123@mongodb-choreo:27017/admin?authSource=admin
- MONGO_DB_NAME=opengin
- MONGO_COLLECTION=metadata
- MONGO_ADMIN_USER=admin
- MONGO_ADMIN_PASSWORD=admin123
# PostgreSQL Configuration (using choreo PostgreSQL)
- POSTGRES_HOST=postgres-choreo
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=opengin
- POSTGRES_SSL_MODE=disable
# CORE Service Configuration
- CORE_SERVICE_HOST=0.0.0.0
- CORE_SERVICE_PORT=50051
depends_on:
mongodb-choreo:
condition: service_healthy
neo4j-choreo:
condition: service_healthy
postgres-choreo:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:50051 || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
networks:
- choreo-network
ingestion-choreo:
build:
context: ./opengin/ingestion-api
dockerfile: docker/Dockerfile.choreo
container_name: ingestion-choreo
ports:
- "8080:8080"
environment:
- CORE_SERVICE_URL=http://core-choreo:50051
- INGESTION_SERVICE_HOST=0.0.0.0
- INGESTION_SERVICE_PORT=8080
depends_on:
core-choreo:
condition: service_healthy
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "8080" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- choreo-network
read-choreo:
build:
context: ./opengin/read-api
dockerfile: docker/Dockerfile.choreo
container_name: read-choreo
ports:
- "8081:8081"
environment:
- CORE_SERVICE_URL=http://core-choreo:50051
- READ_SERVICE_HOST=0.0.0.0
- READ_SERVICE_PORT=8081
depends_on:
core-choreo:
condition: service_healthy
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "8081" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- choreo-network
e2e-choreo:
image: python:3.9-slim
container_name: e2e-choreo
volumes:
- ./opengin/tests/e2e:/app/tests
working_dir: /app/tests
networks:
- choreo-network
environment:
- PYTHONUNBUFFERED=1
- INGESTION_SERVICE_URL=http://ingestion-choreo:8080
- READ_SERVICE_URL=http://read-choreo:8081
depends_on:
ingestion-choreo:
condition: service_healthy
command: >
sh -c "
echo 'Waiting for services to be ready...' &&
sleep 10 &&
pip install requests &&
pip install protobuf &&
pip install pandas &&
python3 basic_core_tests.py &&
python3 basic_read_tests.py"
networks:
choreo-network:
driver: bridge
volumes:
mongodb_choreo_data:
neo4j_choreo_data:
neo4j_choreo_logs:
postgres_choreo_data:
postgres_choreo_backup: