mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 18:01:09 +02:00
infra(gpu-box): commit GPU-Box compose to repo + Phase 2e docs
The GPU-Box stack has been carrying real production workload since Phase 2c (monitoring) but only existed as a /srv/mana/docker-compose.gpu-box.yml on the box itself. If the WSL filesystem dies, none of it is reproducible. Bring the file into infrastructure/ as the source of truth (live file on the box must be kept synchronous; manual rsync for now since there's no CD into the GPU box). Plus: - infrastructure/.env.gpu-box.example as the secrets template - infrastructure/README.md describing what runs there + how the Cloudflare-tunnel ingress is API-managed (not config.yml) - .gitignore for the live infrastructure/.env.gpu-box copy - MAC_MINI_SERVER.md status-page section now points at the GPU-Box setup instead of the long-stopped Mini container - PLAN_OPTION_C.md: Phase 2e row + GPU-Box service tree update Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e3cca9e271
commit
d8a35afd99
6 changed files with 576 additions and 9 deletions
|
|
@ -176,22 +176,22 @@ Alerts: WebAppDown (2 min), APIDown (1 min), InfraToolDown (3 min), GPUServiceDo
|
|||
|
||||
### Public Status Page (status.mana.how)
|
||||
|
||||
Statische HTML-Seite, die alle 60 Sekunden vom Container `mana-status-gen` neu generiert wird.
|
||||
> **Stand 2026-05-07** — Status-Page-Generator + dedizierter Nginx wurden auf die GPU-Box umgezogen (Phase 2e, siehe [`PLAN_OPTION_C.md`](./PLAN_OPTION_C.md)). Die Container `mana-mon-status-gen` + `mana-mon-status-nginx` leben jetzt in [`infrastructure/docker-compose.gpu-box.yml`](../infrastructure/docker-compose.gpu-box.yml), DNS routet `status.mana.how` auf den `mana-gpu-server`-Tunnel.
|
||||
|
||||
| Komponente | Pfad |
|
||||
|---|---|
|
||||
| Generator-Script | `scripts/generate-status-page.sh` |
|
||||
| Docker-Service | `status-page-gen` in `docker-compose.macmini.yml` |
|
||||
| Output | `/Volumes/ManaData/landings/status/index.html` + `status.json` |
|
||||
| Nginx-Config | `docker/nginx/landings.conf` → `status.mana.how` |
|
||||
| Generator-Script | `scripts/generate-status-page.sh` (vom GPU-Box-Sparse-Repo `/srv/mana/source/` bind-gemountet) |
|
||||
| Docker-Services | `status-page-gen` + `status-nginx` in `infrastructure/docker-compose.gpu-box.yml` |
|
||||
| Output | docker-volume `status-output` (geteilt zwischen den beiden Containern) |
|
||||
| Public-Tunnel | mana-gpu-server, Port `:8090` |
|
||||
|
||||
**Datenquellen:**
|
||||
- **Service-Uptime:** VictoriaMetrics via Blackbox Exporter (`probe_success`, `probe_duration_seconds`)
|
||||
- **App Release Tiers:** Automatisch aus `packages/shared-branding/src/mana-apps.ts` geparst (per awk, read-only Volume-Mount). Zeigt welche Apps in welchem Tier (founder/alpha/beta/public) sind.
|
||||
- **Service-Uptime:** VictoriaMetrics via Blackbox Exporter (`probe_success`, `probe_duration_seconds`) — VM läuft jetzt im selben docker-network auf der GPU-Box, kein Cloudflare-Round-Trip mehr.
|
||||
- **App Release Tiers:** Automatisch aus `packages/shared-branding/src/mana-apps.ts` geparst.
|
||||
|
||||
**Automatische Aktualisierung:** Änderungen an `requiredTier` in `mana-apps.ts` werden nach dem nächsten `git pull` auf dem Server automatisch beim nächsten 60s-Refresh auf der Statusseite sichtbar — kein Container-Restart nötig, da die Datei live gemountet ist.
|
||||
**Automatische Aktualisierung:** Der GPU-Box-systemd-timer `mana-source-pull.timer` macht stündlich `git pull` auf `/srv/mana/source/`. Änderungen an `requiredTier` in `mana-apps.ts` schlagen nach maximal 1 h Pull-Latenz + 60 s Status-Tick auf der Status-Seite durch.
|
||||
|
||||
**`status.json`** wird parallel generiert und enthält Service-Status + Tier-Daten als JSON (genutzt von ManaScore Live-Badges).
|
||||
**`status.json`** wird parallel generiert und enthält Service-Status + Tier-Daten als JSON.
|
||||
|
||||
### Service Management
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ Production-Hot-Path bleibt unverändert auf dem Mini.
|
|||
| Phase 2b — Umami + Forgejo | ✅ | Beide healthy auf GPU-Box. Glitchtip übersprungen — Mini-Glitchtip ist bereits im Broken-State (DB `glitchtip` existiert nicht in Postgres, läuft nur in Degraded-Mode), Migration würde Bug nicht heilen |
|
||||
| Phase 2c — VM + Loki + Alerts | ✅ | Komplett auf GPU-Box. 11 Container neu (VM, Loki, Pushgateway, Blackbox, Vmalert, Alertmanager, Alert-notifier, GPU-eigenes Node-Exporter+Cadvisor+Promtail). VM scrapt 76 Targets, **69 UP / 7 DOWN** (DOWN sind alle pre-existing wrong /metrics endpoints auf Mana-Services, nicht durch Migration). Konfig-Pfade: `monitoring/{prometheus,loki,blackbox,alertmanager,alert-notifier}/`. Bekannte Limits siehe unten. |
|
||||
| Phase 2d — Glitchtip mit dediziertem DB-Stack | ✅ | 4 Container neu (mana-mon-glitchtip + worker + dedizierte glitchtip-postgres + glitchtip-redis). Mini-Postgres scheiterte bei `logs.0001_initial`-Partition-Creation mit OS-level "Permission denied" (macOS-Docker-Storage-Quirk auf externer SSD). Auf der GPU-Box mit Linux-ext4 saubere 333-Tabellen-Migration. Worker enqueuet UND finished Tasks → DB-Writes funktional (vorher hingen sie ewig). Public-Hostname `glitchtip.mana.how` → mana-gpu-server-Tunnel (config v23). |
|
||||
| Phase 2e — Status-Page auf GPU-Box | ✅ | 2 Container neu (`mana-mon-status-gen` + `mana-mon-status-nginx`). Sparse `/srv/mana/source` mit `mana-source-pull.timer` (stündlich) hostet das `generate-status-page.sh` und `mana-apps.ts`. status-gen schreibt in das Docker-Volume `status-output`, das status-nginx auf `:8090` ausliefert. Public-Hostname `status.mana.how` → mana-gpu-server-Tunnel (config v25). Bonus: behebt den Inode-Stale-Bind-Mount-Bug, der auf dem Mini bei jedem CD-`git checkout -f` die Status-Page kaputt machte. `vm.mana.how` (Phase-2c-Workaround für Mini→GPU-VM-Routing) wurde wieder aus dem Tunnel entfernt — VM ist nicht mehr public. |
|
||||
| Phase 3 — Daten-Migration | n/a | Alle migrierten Apps lesen Mini-Postgres direkt — keine separate Datenmigration |
|
||||
| Phase 4 — Cloudflare-Cutover | ✅ | API-Approach via `cert.pem` apiToken: PUT `/accounts/.../cfd_tunnel/.../configurations` für GPU-Tunnel, dann `cloudflared tunnel route dns --overwrite-dns`. Kein Dashboard-Klick nötig. 3 Hostnames live (grafana/git/stats) |
|
||||
| Phase 5 — Mini-Compose aufräumen | ✅ | 3 Blöcke in `cloudflared-config.yml` auskommentiert (Backup angelegt), cloudflared neu geladen, Mini-Container `mana-mon-grafana` + `mana-mon-umami` gestoppt (nicht entfernt — Rollback bleibt möglich) |
|
||||
|
|
@ -59,6 +60,12 @@ WSL2 (Ubuntu 24.04, 24 GB RAM-Limit, 12 vCPU, vmIdleTimeout=-1)
|
|||
│ ├── mana-mon-glitchtip-postgres (postgres:16-alpine) — eigene DB-Instanz
|
||||
│ │ └── volume: glitchtip-pg-data (333 Tabellen, alle Migrationen sauber)
|
||||
│ └── mana-mon-glitchtip-redis (redis:7-alpine) — eigene Cache+Queue
|
||||
├── Phase 2e — Status-Page (eigener Stack)
|
||||
│ ├── mana-mon-status-gen (alpine:3.20) — Generator-Loop, queryt VM lokal
|
||||
│ ├── mana-mon-status-nginx (nginx:alpine, :8090) — serviert HTML+JSON
|
||||
│ └── volume: status-output (geteilt zwischen den beiden)
|
||||
└── /srv/mana/source/ — Sparse mana-monorepo-clone (scripts/ + packages/shared-branding/src/)
|
||||
└── systemd-timer: mana-source-pull.timer (stündlich `git pull --ff-only`)
|
||||
└── Phase 2c — Metrics-Stack
|
||||
├── mana-mon-victoria (VM v1.99.0, :9090) — scrapt Mini-Services via 192.168.178.131:<port>
|
||||
│ ├── extra_hosts: host.docker.internal:host-gateway
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue