-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompose.yaml
More file actions
277 lines (262 loc) · 9.49 KB
/
Copy pathcompose.yaml
File metadata and controls
277 lines (262 loc) · 9.49 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
# Local dev stack: grex, two otelcol agents, an otelcol gateway, and Dex.
# The otelcol images are distroless (no shell), so they cannot carry exec
# healthchecks; deploy/compose/smoke.sh covers them via log assertions.
services:
gen-certs:
image: alpine/openssl:3.5.7
entrypoint: ["/bin/sh", "/gen-certs.sh"]
volumes:
- ./deploy/compose/gen-certs.sh:/gen-certs.sh:ro
- ./deploy/compose/certs:/certs
grex:
build:
context: .
dockerfile: Dockerfile
command: ["-config", "/etc/grex/config.yaml"]
ports:
- "127.0.0.1:8080:8080"
- "127.0.0.1:9090:9090"
- "127.0.0.1:4320:4320"
volumes:
- ./deploy/compose/grex.yaml:/etc/grex/config.yaml:ro
- ./deploy/compose/certs:/certs:ro
depends_on:
gen-certs:
condition: service_completed_successfully
river-migrate:
condition: service_completed_successfully
migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "wget", "-qO-", "--no-check-certificate", "https://127.0.0.1:9090/healthz"]
interval: 5s
timeout: 3s
retries: 12
grex-2:
# Second grex replica, purely to exercise Envoy's least-connections
# balancing locally (see envoy service below and
# docs/spec/design.md's Load balancing section). Same image/config as
# grex; nothing shared between the two beyond the config file and certs,
# matching 1.0's in-memory-per-process fleet state.
build:
context: .
dockerfile: Dockerfile
command: ["-config", "/etc/grex/config.yaml"]
ports:
- "127.0.0.1:8081:8080"
- "127.0.0.1:9092:9090"
- "127.0.0.1:4321:4320"
volumes:
- ./deploy/compose/grex.yaml:/etc/grex/config.yaml:ro
- ./deploy/compose/certs:/certs:ro
depends_on:
gen-certs:
condition: service_completed_successfully
river-migrate:
condition: service_completed_successfully
migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "wget", "-qO-", "--no-check-certificate", "https://127.0.0.1:9090/healthz"]
interval: 5s
timeout: 3s
retries: 12
grex-browser:
# Plain-HTTP instance for casual local browsing (see
# deploy/compose/grex-browser.yaml) — not part of the Envoy/gateway HA
# topology, no agents connect to it, exists only so the UI/riverui are
# reachable in a browser without installing an mTLS client cert.
build:
context: .
dockerfile: Dockerfile
command: ["-config", "/etc/grex/config.yaml"]
ports:
- "127.0.0.1:8082:8080"
- "127.0.0.1:9095:9090"
- "127.0.0.1:4322:4320"
volumes:
- ./deploy/compose/grex-browser.yaml:/etc/grex/config.yaml:ro
- ./deploy/compose/certs:/certs:ro
depends_on:
gen-certs:
condition: service_completed_successfully
river-migrate:
condition: service_completed_successfully
migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "wget", "-qO-", "--no-check-certificate", "https://127.0.0.1:9090/healthz"]
interval: 5s
timeout: 3s
retries: 12
envoy:
# Inner load-balancing tier: least-connections across grex/grex-2.
# opamp-gateway dials this instead of a single grex instance directly.
# --concurrency 1: Envoy's per-worker-thread connection accounting means
# near-simultaneous connections handled by different threads can each
# see "0 active" and pick the same host, coincidence, not a bug in the
# LB policy. Single-threaded is fine at this connection volume; a real
# multi-connection-per-second deployment would want more threads and
# would not see this race at any meaningful frequency (see
# docs/admin/high-availability.md).
image: envoyproxy/envoy:v1.33.0
command: ["-c", "/etc/envoy/envoy.yaml", "--concurrency", "1"]
volumes:
- ./deploy/compose/envoy.yaml:/etc/envoy/envoy.yaml:ro
- ./deploy/compose/envoy-healthcheck.sh:/envoy-healthcheck.sh:ro
ports:
- "127.0.0.1:9901:9901"
depends_on:
grex:
condition: service_healthy
grex-2:
condition: service_healthy
healthcheck:
# Not just "is the admin port up" — see envoy-healthcheck.sh: waits
# for both grex backends to be discovered and health-checked, so
# opamp-gateway (which depends on envoy being healthy) never opens
# its upstream connections while Envoy still only knows about one.
test: ["CMD", "bash", "/envoy-healthcheck.sh"]
interval: 2s
timeout: 3s
retries: 12
prometheus:
image: prom/prometheus:v3.13.1
ports:
- "127.0.0.1:9091:9090"
volumes:
- ./deploy/compose/prometheus.yaml:/etc/prometheus/prometheus.yml:ro
- ./deploy/compose/certs:/certs:ro
depends_on:
grex:
condition: service_healthy
grex-2:
condition: service_healthy
envoy:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:9090/-/healthy"]
interval: 5s
timeout: 3s
retries: 12
postgres:
# Dev-only infra for the durable state and future job dispatch backend
# (see internal/persistence, docs/spec/design.md's Post-1.0 roadmap).
# Both grex and grex-2 read/write this via deploy/compose/grex.yaml's
# database: block — persistence, the read API's cross-replica DB
# fallback, and the soft-delete purge job are all active in this stack.
image: postgres:17.2-alpine
environment:
POSTGRES_USER: grex
POSTGRES_PASSWORD: grex-dev-password
POSTGRES_DB: grex
ports:
- "127.0.0.1:5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U grex -d grex"]
interval: 5s
timeout: 3s
retries: 12
postgres-exporter:
image: quay.io/prometheuscommunity/postgres-exporter:v0.17.1
environment:
DATA_SOURCE_NAME: "postgresql://grex:grex-dev-password@postgres:5432/grex?sslmode=disable"
ports:
- "127.0.0.1:9187:9187"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:9187/metrics"]
interval: 5s
timeout: 3s
retries: 12
river-migrate:
# One-shot: runs River's own migrator (see cmd/river-migrate) to create
# River's tables (river_job, river_leader, etc) in the dev database.
# Independent of the migrate service below, which owns grex's own
# tables; see docs/spec/design.md's migration-tooling decision.
build:
context: .
dockerfile: Dockerfile
target: river-migrate
environment:
DATABASE_URL: "postgres://grex:grex-dev-password@postgres:5432/grex?sslmode=disable"
depends_on:
postgres:
condition: service_healthy
migrate:
# One-shot: runs golang-migrate against grex's own tables
# (internal/persistence/migrations): agent state, role_mapping,
# agent_connections, jobs/job_targets. Nothing reads/writes the latter
# three yet — schema only, see docs/spec/design.md.
image: migrate/migrate:v4.19.1
volumes:
- ./internal/persistence/migrations:/migrations:ro
command:
- -path=/migrations
- -database=postgres://grex:grex-dev-password@postgres:5432/grex?sslmode=disable
- up
depends_on:
postgres:
condition: service_healthy
dex:
image: dexidp/dex:v2.45.1
command: ["dex", "serve", "/etc/dex/config.yaml"]
ports:
- "127.0.0.1:5556:5556"
volumes:
- ./deploy/compose/dex.yaml:/etc/dex/config.yaml:ro
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:5556/dex/healthz"]
interval: 5s
timeout: 3s
retries: 12
opamp-gateway:
# Built from source against a grex fork branch: opampgateway v1.10.0
# never wires its upstream TLS settings into the websocket dialer, so
# the stock observIQ image cannot do mTLS to grex. See
# deploy/compose/opamp-gateway-build/manifest.yaml.
build: deploy/compose/opamp-gateway-build
command: ["--config", "/etc/otelcol/config.yaml"]
volumes:
- ./deploy/compose/opamp-gateway.yaml:/etc/otelcol/config.yaml:ro
- ./deploy/compose/certs:/certs:ro
depends_on:
envoy:
condition: service_healthy
otelcol-agent-1:
image: otel/opentelemetry-collector-contrib:0.157.0
command: ["--config", "/etc/otelcol/config.yaml"]
environment:
AGENT_NAME: agent-1
volumes:
- ./deploy/compose/otelcol-agent.yaml:/etc/otelcol/config.yaml:ro
- ./deploy/compose/certs:/certs:ro
depends_on:
- opamp-gateway
otelcol-agent-2:
# OpAMP Supervisor-managed, unlike agent-1's bare opamp extension: the
# two intentionally exercise both client-side models grex supports. See
# docs/spec/design.md's Local development section.
build: deploy/compose/opamp-supervisor-build
volumes:
- ./deploy/compose/supervisor.yaml:/etc/otelcol/supervisor.yaml:ro
- ./deploy/compose/otelcol-agent-2.yaml:/etc/otelcol/agent-2.yaml:ro
- ./deploy/compose/certs:/certs:ro
- opamp-supervisor-data:/var/lib/otelcol/supervisor-data
depends_on:
- opamp-gateway
otelcol-gateway:
image: otel/opentelemetry-collector-contrib:0.157.0
command: ["--config", "/etc/otelcol/config.yaml"]
volumes:
- ./deploy/compose/otelcol-gateway.yaml:/etc/otelcol/config.yaml:ro
- ./deploy/compose/certs:/certs:ro
depends_on:
- opamp-gateway
volumes:
postgres-data:
opamp-supervisor-data: