forked from ferrosadb/ferrosa-memory
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
291 lines (283 loc) · 10.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
291 lines (283 loc) · 10.5 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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# ferrosa-memory-mcp development cluster
# 3-node Ferrosa cluster + MinIO (S3)
#
# Usage:
# podman compose up -d
#
# Ports:
# 19042-19044 CQL (node1-3)
# 17687-17689 Bolt/Cypher (node1-3)
# 17474-17476 Graph HTTP (node1-3)
# 19090-19092 Web console (node1-3)
# 19000-19001 MinIO S3 + console
services:
# --- S3-compatible object storage (MinIO — supports conditional PUT/CAS) ---
minio:
image: minio/minio:latest
# Cap memory so a runaway MinIO can't take out the Ferrosa nodes.
# MinIO steady-state is <200MB for this workload; 1G leaves headroom
# and fails loud if we blow past it (cgroup OOM = container OOMKilled=true
# which the watchdog logs, instead of the host SIGKILLing the VM).
mem_limit: 1g
memswap_limit: 1g
# Bounded restart — infinite loops surface in the podman events watchdog
# as runaway RestartCount in the per-minute snapshot.
restart: on-failure:5
ports:
- "19000:9000"
- "19001:9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin # pragma: allowlist secret
volumes:
- ~/data/ferrosa-memory/minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:9000/minio/health/live"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
minio-init:
image: minio/mc
depends_on:
minio:
condition: service_healthy
entrypoint: >
sh -c "mc alias set local http://minio:9000 minioadmin minioadmin &&
mc mb local/ferrosa-memory --ignore-existing &&
echo 'bucket created'"
restart: "no"
# --- 3-node Ferrosa cluster (CQL + Graph + Bolt) ---
# Progressive join: node1=standalone, node2=pair, node3=cluster
node1:
image: ferrosa-memory-node
user: "1000:1000"
# 2G cap per Ferrosa node. Historical steady-state is ~1-2GB under
# dev load (13.9k entities, 68k edges). The 2G ceiling covers
# compaction + SSTable cache headroom and lets 3 nodes + MinIO fit
# comfortably in an 8-16G podman VM without overcommit (3×2 + 1 = 7G
# container budget). A 4G ceiling was previously used but summed to
# 13G — more than an 8G VM can back, which caused silent VM panics
# (containers healthy, VM stopped) rather than clean cgroup OOMs.
# If this cap is hit the container OOMKilleds internally
# (State.OOMKilled=true), restart:on-failure kicks in, and the
# watchdog logs the event with context for forensics.
#
# memswap_limit matches mem_limit so the container cannot silently
# spill to swap inside the podman VM — we want a clear OOM event,
# not degraded performance we would miss.
mem_limit: 2g
memswap_limit: 2g
restart: on-failure:5
stop_grace_period: 35s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
depends_on:
minio-init:
condition: service_completed_successfully
ports:
- "19042:9042" # CQL
- "17474:7474" # Graph HTTP
- "17687:7687" # Bolt
- "19090:9090" # Web console
- "18080:8080" # SPARQL
environment:
FERROSA_HOST_ID: "11111111-1111-1111-1111-111111111111"
FERROSA_DATA_DIR: /var/lib/ferrosa
FERROSA_AUTH_ENABLED: "true"
FERROSA_AUTH_DISABLED: "false"
FERROSA_CQL_BIND: "0.0.0.0:9042"
FERROSA_CQL_BROADCAST: "127.0.0.1:19042"
FERROSA_CQL_INTERNAL_CLIENT_CIDRS: "10.89.1.0/24"
FERROSA_CQL_MAX_CONNECTIONS_PER_IP: "256"
FERROSA_WEB_BIND: "0.0.0.0:9090"
FERROSA_GRAPH_ENABLED: "true"
FERROSA_SPARQL_ENABLED: "true"
FERROSA_SPARQL_BIND: "0.0.0.0:8080"
FERROSA_CLUSTER_NAME: ferrosa-memory
FERROSA_CLUSTER_MODE: standalone
FERROSA_INTERNODE_BIND: "0.0.0.0:7000"
FERROSA_INTERNODE_BROADCAST: "node1:7000"
FERROSA_S3_ENDPOINT: "http://minio:9000"
FERROSA_S3_BUCKET: ferrosa-memory
FERROSA_S3_REGION: us-east-1
FERROSA_S3_ALLOW_HTTP: "true"
FERROSA_S3_ACCESS_KEY_ID: minioadmin
FERROSA_S3_SECRET_ACCESS_KEY: minioadmin # pragma: allowlist secret
FERROSA_S3_PREFIX: node1
volumes:
- ~/data/ferrosa-memory/node1:/var/lib/ferrosa
healthcheck:
test: ["CMD-SHELL", "bash -c '</dev/tcp/127.0.0.1/9042' || exit 1"]
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
node2:
image: ferrosa-memory-node
user: "1000:1000"
# 2G cap per Ferrosa node. Historical steady-state is ~1-2GB under
# dev load (13.9k entities, 68k edges). The 2G ceiling covers
# compaction + SSTable cache headroom and lets 3 nodes + MinIO fit
# comfortably in an 8-16G podman VM without overcommit (3×2 + 1 = 7G
# container budget). A 4G ceiling was previously used but summed to
# 13G — more than an 8G VM can back, which caused silent VM panics
# (containers healthy, VM stopped) rather than clean cgroup OOMs.
# If this cap is hit the container OOMKilleds internally
# (State.OOMKilled=true), restart:on-failure kicks in, and the
# watchdog logs the event with context for forensics.
#
# memswap_limit matches mem_limit so the container cannot silently
# spill to swap inside the podman VM — we want a clear OOM event,
# not degraded performance we would miss.
mem_limit: 2g
memswap_limit: 2g
restart: on-failure:5
stop_grace_period: 35s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
depends_on:
node1:
condition: service_healthy
ports:
- "19043:9042" # CQL
- "17475:7474" # Graph HTTP
- "17688:7687" # Bolt
- "19091:9090" # Web console
environment:
FERROSA_HOST_ID: "22222222-2222-2222-2222-222222222222"
FERROSA_DATA_DIR: /var/lib/ferrosa
FERROSA_AUTH_ENABLED: "true"
FERROSA_AUTH_DISABLED: "false"
FERROSA_CQL_BIND: "0.0.0.0:9042"
FERROSA_CQL_BROADCAST: "127.0.0.1:19043"
FERROSA_CQL_INTERNAL_CLIENT_CIDRS: "10.89.1.0/24"
FERROSA_CQL_MAX_CONNECTIONS_PER_IP: "256"
FERROSA_WEB_BIND: "0.0.0.0:9090"
FERROSA_GRAPH_ENABLED: "true"
FERROSA_SPARQL_ENABLED: "true"
FERROSA_SPARQL_BIND: "0.0.0.0:8080"
FERROSA_CLUSTER_NAME: ferrosa-memory
FERROSA_CLUSTER_MODE: pair
FERROSA_SEED: "node1:7000"
FERROSA_INTERNODE_BIND: "0.0.0.0:7000"
FERROSA_INTERNODE_BROADCAST: "node2:7000"
FERROSA_S3_ENDPOINT: "http://minio:9000"
FERROSA_S3_BUCKET: ferrosa-memory
FERROSA_S3_REGION: us-east-1
FERROSA_S3_ALLOW_HTTP: "true"
FERROSA_S3_ACCESS_KEY_ID: minioadmin
FERROSA_S3_SECRET_ACCESS_KEY: minioadmin # pragma: allowlist secret
FERROSA_S3_PREFIX: node2
volumes:
- ~/data/ferrosa-memory/node2:/var/lib/ferrosa
healthcheck:
test: ["CMD-SHELL", "bash -c '</dev/tcp/127.0.0.1/9042' || exit 1"]
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
node3:
image: ferrosa-memory-node
user: "1000:1000"
# 2G cap per Ferrosa node. Historical steady-state is ~1-2GB under
# dev load (13.9k entities, 68k edges). The 2G ceiling covers
# compaction + SSTable cache headroom and lets 3 nodes + MinIO fit
# comfortably in an 8-16G podman VM without overcommit (3×2 + 1 = 7G
# container budget). A 4G ceiling was previously used but summed to
# 13G — more than an 8G VM can back, which caused silent VM panics
# (containers healthy, VM stopped) rather than clean cgroup OOMs.
# If this cap is hit the container OOMKilleds internally
# (State.OOMKilled=true), restart:on-failure kicks in, and the
# watchdog logs the event with context for forensics.
#
# memswap_limit matches mem_limit so the container cannot silently
# spill to swap inside the podman VM — we want a clear OOM event,
# not degraded performance we would miss.
mem_limit: 2g
memswap_limit: 2g
restart: on-failure:5
stop_grace_period: 35s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
depends_on:
node1:
condition: service_healthy
node2:
condition: service_healthy
ports:
- "19044:9042" # CQL
- "17476:7474" # Graph HTTP
- "17689:7687" # Bolt
- "19092:9090" # Web console
environment:
FERROSA_HOST_ID: "33333333-3333-3333-3333-333333333333"
FERROSA_DATA_DIR: /var/lib/ferrosa
FERROSA_AUTH_ENABLED: "true"
FERROSA_AUTH_DISABLED: "false"
FERROSA_CQL_BIND: "0.0.0.0:9042"
FERROSA_CQL_BROADCAST: "127.0.0.1:19044"
FERROSA_CQL_INTERNAL_CLIENT_CIDRS: "10.89.1.0/24"
FERROSA_CQL_MAX_CONNECTIONS_PER_IP: "256"
FERROSA_WEB_BIND: "0.0.0.0:9090"
FERROSA_GRAPH_ENABLED: "true"
FERROSA_SPARQL_ENABLED: "true"
FERROSA_SPARQL_BIND: "0.0.0.0:8080"
FERROSA_CLUSTER_NAME: ferrosa-memory
FERROSA_CLUSTER_MODE: cluster
FERROSA_SEED: "node1:7000"
FERROSA_INTERNODE_BIND: "0.0.0.0:7000"
FERROSA_INTERNODE_BROADCAST: "node3:7000"
FERROSA_S3_ENDPOINT: "http://minio:9000"
FERROSA_S3_BUCKET: ferrosa-memory
FERROSA_S3_REGION: us-east-1
FERROSA_S3_ALLOW_HTTP: "true"
FERROSA_S3_ACCESS_KEY_ID: minioadmin
FERROSA_S3_SECRET_ACCESS_KEY: minioadmin # pragma: allowlist secret
FERROSA_S3_PREFIX: node3
volumes:
- ~/data/ferrosa-memory/node3:/var/lib/ferrosa
healthcheck:
test: ["CMD-SHELL", "bash -c '</dev/tcp/127.0.0.1/9042' || exit 1"]
interval: 5s
timeout: 5s
retries: 30
start_period: 15s
ferrosa-memory-mcp:
build:
context: .
dockerfile: Containerfile
stop_grace_period: 35s
depends_on:
node1:
condition: service_healthy
node2:
condition: service_healthy
node3:
condition: service_healthy
# Runtime config intentionally uses localhost contact points for CQL,
# Graph, SPARQL, Ollama, and loopback-only operator HTTP/Viz binds.
# Keep this service on the host network so the mounted config means the
# same thing inside the container as it does for the historical standalone
# `docker run --network host` launch.
network_mode: host
environment:
FERROSA_MEMORY_CONFIG: /run/secrets/ferrosa-memory/ferrosa-memory-http-podman.toml
volumes:
- ./.runtime:/run/secrets/ferrosa-memory:ro
healthcheck:
test: ["CMD", "curl", "-ksf", "https://127.0.0.1:8765/healthz/live"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s