-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
173 lines (163 loc) · 5.42 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
173 lines (163 loc) · 5.42 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
# Endpoints on localhost:
# VictoriaMetrics :8428
# Prometheus :9090
# node-exporter :9100
# detector :9092 (/metrics, /healthz, /-/reload, /ready, /debug/*)
# http-demo :8000 (/metrics; "load" profile only)
# Redis :6379 (query-cache backend; HA isn't wired in compose
# since leader election needs a kube API server)
# Grafana :3000 (admin / admin) — "load" profile only
#
# Two profiles:
# default (`make dev-up`) — VM, Prometheus, Redis, node-exporter,
# detector. Minimum for detector
# development.
# load (`make dev-up-load`) — adds http-demo, http-demo-loadgen,
# Grafana. Full demo experience.
name: promanomaly-dev
services:
victoriametrics:
image: victoriametrics/victoria-metrics:v1.142.0
container_name: pa-victoriametrics
command:
- "--storageDataPath=/storage"
- "--httpListenAddr=:8428"
- "--retentionPeriod=30d"
ports:
- "8428:8428"
volumes:
- vm-data:/storage
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8428/health"]
interval: 5s
timeout: 3s
retries: 20
restart: unless-stopped
http-demo:
# Tiny FastAPI app with a handful of endpoints + /metrics. Driven by
# the loadgen below so the detector has http_* time series to score on.
# Behind the "load" profile so `make dev-up` (minimum dev stack)
# doesn't start it; `make dev-up-load` does.
profiles: ["load"]
build:
context: ./docker/http-demo
dockerfile: Dockerfile.app
image: promanomaly-http-demo:dev
container_name: pa-http-demo
ports:
- "8000:8000"
restart: unless-stopped
http-demo-loadgen:
# ~20-30 req/min with a slow sinusoidal modulation so the rate has shape.
# Same profile as http-demo since one without the other is useless.
profiles: ["load"]
build:
context: ./docker/http-demo
dockerfile: Dockerfile.loadgen
image: promanomaly-http-demo-loadgen:dev
container_name: pa-http-demo-loadgen
environment:
TARGET: http://http-demo:8000
BASE_RPM: "25"
AMPLITUDE_RPM: "15"
PERIOD_SECONDS: "600"
depends_on:
- http-demo
restart: unless-stopped
node-exporter:
image: prom/node-exporter:v1.11.1
container_name: pa-node-exporter
command:
- "--path.procfs=/host/proc"
- "--path.sysfs=/host/sys"
- "--path.rootfs=/rootfs"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
pid: host
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
ports:
- "9100:9100"
restart: unless-stopped
redis:
# Lets the dev detector exercise the Redis-backed query cache path
# against a real backend instead of in-memory only. HA mode (leader
# election) needs a Kubernetes API server, which docker-compose does
# not provide — so the snapshot cache stays unused here. The query
# cache validates fine in single-replica mode.
image: redis:7-alpine
container_name: pa-redis
command: ["redis-server", "--save", "", "--appendonly", "no"]
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
restart: unless-stopped
prometheus:
image: prom/prometheus:v3.11.3
container_name: pa-prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=2h"
- "--web.enable-lifecycle"
ports:
- "9090:9090"
volumes:
- ./docker/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prom-data:/prometheus
depends_on:
victoriametrics:
condition: service_healthy
restart: unless-stopped
detector:
build:
context: ./detector
image: promanomaly:dev
container_name: pa-detector
command: ["--config", "/etc/promanomaly/config.yaml"]
ports:
- "9092:9092"
volumes:
# Dev-tuned config: short window, fast refresh, low min_points so the
# first scores are produced minutes after `make dev-up` instead of
# waiting an hour for the rolling window to fill.
# examples/configs/* are production-grade and require a long-running TSDB.
- ./docker/dev-config.yaml:/etc/promanomaly/config.yaml:ro
depends_on:
victoriametrics:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
grafana:
# Grafana is in the "load" profile because the bundled dashboards are
# tied to the http-demo data; a minimum `make dev-up` for detector
# development doesn't need it. `make dev-up-load` brings it up.
profiles: ["load"]
image: grafana/grafana:13.0.1
container_name: pa-grafana
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer
GF_USERS_DEFAULT_THEME: dark
ports:
- "3000:3000"
volumes:
- ./docker/grafana/provisioning:/etc/grafana/provisioning:ro
- ./dashboards/grafana:/etc/grafana/dashboards:ro
- grafana-data:/var/lib/grafana
depends_on:
- victoriametrics
- prometheus
restart: unless-stopped
volumes:
vm-data:
prom-data:
grafana-data: