78 lines
2.8 KiB
Markdown
78 lines
2.8 KiB
Markdown
# Deploy
|
|
|
|
Local stack and example operator configs.
|
|
|
|
## Quick start
|
|
|
|
```sh
|
|
cd deploy
|
|
MONLET_AUTH_TOKEN=$(openssl rand -hex 16) docker compose up --build
|
|
```
|
|
|
|
Brings up: PostgreSQL 16, Monlet server (with Alembic upgrade on start), Web UI.
|
|
Web timestamps use `MONLET_WEB_TIME_ZONE` (`UTC` by default); notification text/annotations use `MONLET_NOTIFICATION_TIME_ZONE` (`UTC` by default).
|
|
PostgreSQL and server containers run with `TZ=UTC`; local presentation timezones are configured separately.
|
|
|
|
- Server: http://127.0.0.1:8000 (`/api/v1/health`, `/api/v1/ready`, `/metrics`)
|
|
- Web UI: http://127.0.0.1:3000
|
|
- PostgreSQL: 127.0.0.1:5432, db `monlet`, user `monlet`
|
|
|
|
Add Prometheus + Alertmanager + Grafana:
|
|
|
|
```sh
|
|
MONLET_AUTH_TOKEN=$(openssl rand -hex 16) docker compose --profile observability up
|
|
```
|
|
|
|
- Prometheus: http://127.0.0.1:9090
|
|
- Alertmanager: http://127.0.0.1:9093
|
|
- Grafana: http://127.0.0.1:3001 (admin / `$GF_ADMIN_PASSWORD`, default `admin`)
|
|
|
|
## Smoke test
|
|
|
|
```sh
|
|
bash deploy/smoke.sh
|
|
```
|
|
|
|
Boots the stack, hits `/health`, `/ready`, `/metrics`, ingests example payloads from `examples/`, and verifies the API exposes resulting agent/check/incident/outbox state.
|
|
|
|
`SMOKE_KEEP=1 bash deploy/smoke.sh` leaves the stack up after the run.
|
|
|
|
## Showcase / E2E stand (Stage 6.1)
|
|
|
|
Full-fat demo stack with several dockerized agents driving the system through
|
|
every witness state: agent alive/stale/dead, check ok/warning/critical/unknown,
|
|
incident open/resolved, outbox sent/retry/failed,
|
|
anti-double-alerting with `notifications_enabled=false`, and agent spool
|
|
replay after a controlled server outage.
|
|
|
|
```sh
|
|
bash deploy/e2e-showcase.sh
|
|
```
|
|
|
|
Internally:
|
|
|
|
```sh
|
|
MONLET_AUTH_TOKEN=monlet-ui-dev-token docker compose -f deploy/docker-compose.yml -f deploy/docker-compose.showcase.yml up -d --build
|
|
```
|
|
|
|
`SHOWCASE_KEEP=1 bash deploy/e2e-showcase.sh` leaves the stack up so you can
|
|
inspect the web UI at http://127.0.0.1:3000.
|
|
|
|
Dockerized agents (`deploy/docker/agent.Dockerfile`, `deploy/showcase/`) exist
|
|
for demo/e2e only — production deploys the Go binary under systemd.
|
|
|
|
## Files
|
|
|
|
- `docker-compose.yml` — full local stack (server / postgres / web / optional observability profile).
|
|
- `prometheus/prometheus.yml` — example scrape config (Monlet server + agent target).
|
|
- `alertmanager/alertmanager.yml` — example route + receiver.
|
|
- `grafana/provisioning/` — datasource + dashboard providers.
|
|
- `grafana/dashboards/monlet-overview.json` — starter dashboard.
|
|
- `smoke.sh` — local stack smoke entry point.
|
|
- `docker-compose.showcase.yml` — override that adds demo agents + mock webhook.
|
|
- `docker/agent.Dockerfile` — demo/e2e agent image (not for production).
|
|
- `showcase/` — demo agent configs, check scripts, and mock webhook.
|
|
- `e2e-showcase.sh` — full showcase runner.
|
|
|
|
Docker images install Python/Node project dependencies inside the image; host venvs are never mounted.
|