Repository navigation
Expand file tree
/
Copy pathdocker-compose.federation.yml
More file actions
215 lines (208 loc) · 6.25 KB
/
Copy pathdocker-compose.federation.yml
File metadata and controls
215 lines (208 loc) · 6.25 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
# Two-node federation dev stack (LAN peer sync via Compose DNS).
#
# Usage:
# docker compose -f docker-compose.federation.yml up --build -d
# ./scripts/federation_matrix.sh
#
# Optional role stubs (edge + relay expected-negative probes):
# docker compose -f docker-compose.federation.yml --profile roles up --build -d
# RUN_ROLE_CASES=1 EDGE_URL=http://localhost:8003 RELAY_URL=http://localhost:8004 \
# ./scripts/federation_matrix.sh
#
# Peer A: http://localhost:8001
# Peer B: http://localhost:8002
# Edge: http://localhost:8003 (profile: roles)
# Relay: http://localhost:8004 (profile: roles)
#
# Each port binds loopback by default (#523) — set API_BIND=0.0.0.0 to reach
# these nodes from another machine.
x-ohm-common: &ohm-common
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
networks:
- ohm-federation
restart: unless-stopped
services:
ohm-peer-a:
<<: *ohm-common
container_name: ohm-peer-a
ports:
- "${API_BIND:-127.0.0.1}:8001:8001"
environment:
- API_HOST=0.0.0.0
- API_PORT=8001
- PORT=8001
- DEBUG=False
- LOG_LEVEL=INFO
# Force local storage — do not inherit STORAGE_PROVIDER from host .env
- STORAGE_PROVIDER=local
- LOCAL_STORAGE_PATH=/app/storage
- AZURE_STORAGE_ACCOUNT=
- AZURE_STORAGE_KEY=
- AZURE_STORAGE_CONTAINER=
# Known keys for matrix script (override .env so tests are reproducible)
- API_KEYS=fed-test-key-a
- OHM_FEDERATION_ENABLED=true
- OHM_FEDERATION_NODE_NAME=OHM Peer A
- OHM_FEDERATION_NODE_ROLE=peer
- OHM_FEDERATION_DATA_DIR=/app/storage/federation
- OHM_STORAGE_CONFIG_PATH=/app/storage/config/storage-config.json
- OHM_FEDERATION_MANUAL_PEERS=http://ohm-peer-b:8001
- OHM_FEDERATION_MDNS_ENABLED=false
- OHM_FEDERATION_SYNC_INTERVAL_SEC=30
- OHM_FEDERATION_SYNC_RATE_LIMIT_PER_MIN=20
- LLM_ENABLED=false
- MATCHING_EAGER_INIT=false
- ENVIRONMENT=test
volumes:
- ohm-storage-a:/app/storage
- ohm-logs-a:/app/logs
- ./test-data:/app/test-data:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 15s
timeout: 10s
retries: 5
start_period: 45s
ohm-peer-b:
<<: *ohm-common
container_name: ohm-peer-b
ports:
- "${API_BIND:-127.0.0.1}:8002:8001"
environment:
- API_HOST=0.0.0.0
- API_PORT=8001
- PORT=8001
- DEBUG=False
- LOG_LEVEL=INFO
- STORAGE_PROVIDER=local
- LOCAL_STORAGE_PATH=/app/storage
- AZURE_STORAGE_ACCOUNT=
- AZURE_STORAGE_KEY=
- AZURE_STORAGE_CONTAINER=
- API_KEYS=fed-test-key-b
- OHM_FEDERATION_ENABLED=true
- OHM_FEDERATION_NODE_NAME=OHM Peer B
- OHM_FEDERATION_NODE_ROLE=peer
- OHM_FEDERATION_DATA_DIR=/app/storage/federation
- OHM_STORAGE_CONFIG_PATH=/app/storage/config/storage-config.json
- OHM_FEDERATION_MANUAL_PEERS=http://ohm-peer-a:8001
- OHM_FEDERATION_MDNS_ENABLED=false
- OHM_FEDERATION_SYNC_INTERVAL_SEC=30
- OHM_FEDERATION_SYNC_RATE_LIMIT_PER_MIN=20
- LLM_ENABLED=false
- MATCHING_EAGER_INIT=false
- ENVIRONMENT=test
volumes:
- ohm-storage-b:/app/storage
- ohm-logs-b:/app/logs
- ./test-data:/app/test-data:ro
depends_on:
ohm-peer-a:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 15s
timeout: 10s
retries: 5
start_period: 45s
# --- Role stubs (profile: roles) — capability flags only; no relay protocol yet ---
ohm-edge:
<<: *ohm-common
profiles: ["roles"]
container_name: ohm-edge
ports:
- "${API_BIND:-127.0.0.1}:8003:8001"
environment:
- API_HOST=0.0.0.0
- API_PORT=8001
- PORT=8001
- API_KEYS=fed-test-key-edge
- STORAGE_PROVIDER=local
- LOCAL_STORAGE_PATH=/app/storage
- AZURE_STORAGE_ACCOUNT=
- AZURE_STORAGE_KEY=
- AZURE_STORAGE_CONTAINER=
- LLM_ENABLED=false
- MATCHING_EAGER_INIT=false
- ENVIRONMENT=test
- OHM_FEDERATION_ENABLED=true
- OHM_FEDERATION_NODE_NAME=OHM Edge
- OHM_FEDERATION_NODE_ROLE=edge
- OHM_FEDERATION_DATA_DIR=/app/storage/federation
- OHM_STORAGE_CONFIG_PATH=/app/storage/config/storage-config.json
- OHM_FEDERATION_MANUAL_PEERS=http://ohm-peer-a:8001
- OHM_FEDERATION_MDNS_ENABLED=false
volumes:
- ohm-storage-edge:/app/storage
- ohm-logs-edge:/app/logs
depends_on:
ohm-peer-a:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 15s
timeout: 10s
retries: 5
start_period: 45s
ohm-relay:
<<: *ohm-common
profiles: ["roles"]
container_name: ohm-relay
ports:
- "${API_BIND:-127.0.0.1}:8004:8001"
environment:
- API_HOST=0.0.0.0
- API_PORT=8001
- PORT=8001
- API_KEYS=fed-test-key-relay
- STORAGE_PROVIDER=local
- LOCAL_STORAGE_PATH=/app/storage
- AZURE_STORAGE_ACCOUNT=
- AZURE_STORAGE_KEY=
- AZURE_STORAGE_CONTAINER=
- LLM_ENABLED=false
- MATCHING_EAGER_INIT=false
- ENVIRONMENT=test
- OHM_FEDERATION_ENABLED=true
- OHM_FEDERATION_NODE_NAME=OHM Relay
- OHM_FEDERATION_NODE_ROLE=relay
- OHM_FEDERATION_DATA_DIR=/app/storage/federation
- OHM_STORAGE_CONFIG_PATH=/app/storage/config/storage-config.json
- OHM_FEDERATION_MANUAL_PEERS=http://ohm-peer-a:8001,http://ohm-peer-b:8001
- OHM_FEDERATION_MDNS_ENABLED=false
volumes:
- ohm-storage-relay:/app/storage
- ohm-logs-relay:/app/logs
depends_on:
ohm-peer-a:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 15s
timeout: 10s
retries: 5
start_period: 45s
networks:
ohm-federation:
driver: bridge
volumes:
ohm-storage-a:
driver: local
ohm-storage-b:
driver: local
ohm-storage-edge:
driver: local
ohm-storage-relay:
driver: local
ohm-logs-a:
driver: local
ohm-logs-b:
driver: local
ohm-logs-edge:
driver: local
ohm-logs-relay:
driver: local