-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose-optimum.yml
More file actions
237 lines (230 loc) · 7.97 KB
/
docker-compose-optimum.yml
File metadata and controls
237 lines (230 loc) · 7.97 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
services:
proxy-1:
image: 'getoptimum/proxy:${PROXY_VERSION-latest}'
platform: linux/amd64
ports:
- "8081:8080" # HTTP Port for the proxy
- "50051:50051" # gRPC Port for the proxy
environment:
- PROXY_PORT=:8080
- PROXY_GRPC_PORT=:50051
- CLUSTER_ID=${CLUSTER_ID}
- ENABLE_AUTH=false # not using Auth0 for now if needed they pass AUTH0_DOMAIN and AUTH0_AUDIENCE
- LOG_LEVEL=debug
- P2P_NODES=p2pnode-1:33212,p2pnode-2:33212,p2pnode-3:33212,p2pnode-4:33212 # comma separated list of p2p node
networks:
optimum-network:
ipv4_address: 172.28.0.10
depends_on:
- p2pnode-1
- p2pnode-2
- p2pnode-3
- p2pnode-4
proxy-2:
image: 'getoptimum/proxy:${PROXY_VERSION-latest}'
platform: linux/amd64
ports:
- "8082:8080" # HTTP Port for the proxy
- "50052:50051" # gRPC Port for the proxy
environment:
- PROXY_PORT=:8080
- PROXY_GRPC_PORT=:50051
- CLUSTER_ID=${CLUSTER_ID}
- ENABLE_AUTH=false # not using Auth0
- LOG_LEVEL=debug
- P2P_NODES=p2pnode-1:33212,p2pnode-2:33212,p2pnode-3:33212,p2pnode-4:33212
networks:
optimum-network:
ipv4_address: 172.28.0.11
depends_on:
- p2pnode-1
- p2pnode-2
- p2pnode-3
- p2pnode-4
p2pnode-1:
image: 'getoptimum/p2pnode:${P2P_NODE_VERSION-latest}'
platform: linux/amd64
volumes:
- ./identity:/identity
environment:
- LOG_LEVEL=debug
- CLUSTER_ID=${CLUSTER_ID}
- SIDECAR_PORT=33212 # default port for sidecar is 33212 for the grpc bidirectional streaming for the proxy
- API_PORT=9090 # default port for API is 9090
- IDENTITY_DIR=/identity
#### configuration for mump2p
- NODE_MODE=optimum # options: "gossipsub", "optimum"
- OPTIMUM_PORT=7070 # default port for Optimum is 7070
- OPTIMUM_MAX_MSG_SIZE=1048576 # 1MB
- OPTIMUM_MESH_TARGET=6 # number of peers to connect to
- OPTIMUM_MESH_MIN=3 # minimum number of peers to connect to
- OPTIMUM_MESH_MAX=12 # maximum number of peers to connect to
- OPTIMUM_SHARD_FACTOR=4 # number of shards to create default is 4
- OPTIMUM_SHARD_MULT=1.5 # multiplier for shard size default is 1.5
- OPTIMUM_THRESHOLD=0.75 # forward shred threshold default is 0.75
networks:
optimum-network:
ipv4_address: 172.28.0.12
ports:
- "33221:33212"
- "7071:7070"
- "6061:6060"
- "9091:9090"
p2pnode-2:
image: 'getoptimum/p2pnode:${P2P_NODE_VERSION-latest}'
platform: linux/amd64
depends_on:
- p2pnode-1
environment:
- LOG_LEVEL=debug
- CLUSTER_ID=${CLUSTER_ID}
- SIDECAR_PORT=33212 # default port for sidecar is 33212
- API_PORT=9090 # default port for API is 9090
- IDENTITY_DIR=/identity
#### configuration for mump2p
- NODE_MODE=optimum # options: "gossipsub", "optimum"
- BOOTSTRAP_PEERS=/ip4/172.28.0.12/tcp/7070/p2p/${BOOTSTRAP_PEER_ID} # bootstrap from p2pnode-1
- OPTIMUM_PORT=7070 # default port for Optimum is 7070
- OPTIMUM_MAX_MSG_SIZE=1048576 # 1MB
- OPTIMUM_MESH_TARGET=6 # number of peers to connect to
- OPTIMUM_MESH_MIN=3 # minimum number of peers to connect to
- OPTIMUM_MESH_MAX=12 # maximum number of peers to connect to
- OPTIMUM_SHARD_FACTOR=4 # number of shards to create default is 4
- OPTIMUM_SHARD_MULT=1.5 # multiplier for shard size default is 1.5
- OPTIMUM_THRESHOLD=0.75 # forward shred threshold default is 0.75
networks:
optimum-network:
ipv4_address: 172.28.0.13
ports:
- "33222:33212"
- "7072:7070"
- "6062:6060"
- "9092:9090"
p2pnode-3:
image: 'getoptimum/p2pnode:${P2P_NODE_VERSION-latest}'
platform: linux/amd64
depends_on:
- p2pnode-1
environment:
- LOG_LEVEL=debug
- CLUSTER_ID=${CLUSTER_ID}
- SIDECAR_PORT=33212 # default port for sidecar is 33212
- API_PORT=9090 # default port for API is 9090
- IDENTITY_DIR=/identity
#### configuration for mump2p
- NODE_MODE=optimum # options: "gossipsub", "optimum"
- OPTIMUM_PORT=7070 # default port for Optimum is 7070
- OPTIMUM_MAX_MSG_SIZE=1048576 # default is 1MB
- OPTIMUM_MESH_TARGET=6 # number of peers to connect to default is 6
- OPTIMUM_MESH_MIN=3 # minimum number of peers to connect to default is 3
- OPTIMUM_MESH_MAX=12 # maximum number of peers to connect to default is 12
- OPTIMUM_SHARD_FACTOR=4 # number of shards to create default is 4
- OPTIMUM_SHARD_MULT=1.5 # multiplier for shard size default is 1.5
- OPTIMUM_THRESHOLD=0.75 # forward shred threshold default is 0.75
- BOOTSTRAP_PEERS=/ip4/172.28.0.12/tcp/7070/p2p/${BOOTSTRAP_PEER_ID} # bootstrap from p2pnode-1
networks:
optimum-network:
ipv4_address: 172.28.0.14
ports:
- "33223:33212"
- "7073:7070"
- "6063:6060"
- "9093:9090"
p2pnode-4:
image: 'getoptimum/p2pnode:${P2P_NODE_VERSION-latest}'
platform: linux/amd64
depends_on:
- p2pnode-1
environment:
- LOG_LEVEL=debug
- CLUSTER_ID=${CLUSTER_ID}
- SIDECAR_PORT=33212 # default port for sidecar is 33212
- API_PORT=9090 # default port for API is 9090
- IDENTITY_DIR=/identity
#### configuration for mump2p
- NODE_MODE=optimum # options: "gossipsub", "optimum"
- OPTIMUM_PORT=7070 # default port for Optimum is 7070
- OPTIMUM_MAX_MSG_SIZE=1048576 # 1MB
- OPTIMUM_MESH_TARGET=6 # number of peers to connect to
- OPTIMUM_MESH_MIN=3 # minimum number of peers to connect to
- OPTIMUM_MESH_MAX=12 # maximum number of peers to connect to
- OPTIMUM_SHARD_FACTOR=4 # number of shards to create default is 4
- OPTIMUM_SHARD_MULT=1.5 # multiplier for shard size default is 1.5
- OPTIMUM_THRESHOLD=0.75 # forward shred threshold default is 0.75
- BOOTSTRAP_PEERS=/ip4/172.28.0.12/tcp/7070/p2p/${BOOTSTRAP_PEER_ID} # bootstrap from p2pnode-1
networks:
optimum-network:
ipv4_address: 172.28.0.15
ports:
- "33224:33212"
- "7074:7070"
- "6064:6060"
- "9094:9090"
# Monitoring stack
# Prometheus + Grafana
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
volumes:
- ./metrics/grafana/prometheus:/etc/prometheus
- prometheus-data:/prometheus
ports:
- "9090:9090"
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=1h"
- "--storage.tsdb.retention.size=2GB"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9090/-/healthy"]
interval: 30s
timeout: 10s
retries: 3
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
optimum-network:
ipv4_address: 172.28.0.20 # prometheus
# Note: Add scrape configs in ./metrics/grafana/prometheus/prometheus.yml to monitor your services
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- ./metrics/grafana/provisioning:/etc/grafana/provisioning:ro
- ./metrics/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana-data:/var/lib/grafana
ports:
- "3000:3000"
depends_on:
- prometheus
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
optimum-network:
ipv4_address: 172.28.0.21 # grafana
volumes:
prometheus-data:
grafana-data:
networks:
optimum-network:
driver: bridge
ipam:
config:
- subnet: 172.28.0.0/16