diff --git a/docs/platform/llm-server/ai/GNAI-008-PLAN_Ansible-Deployment.md b/docs/platform/llm-server/ai/GNAI-008-PLAN_Ansible-Deployment.md index 1928b81..68da6fd 100644 --- a/docs/platform/llm-server/ai/GNAI-008-PLAN_Ansible-Deployment.md +++ b/docs/platform/llm-server/ai/GNAI-008-PLAN_Ansible-Deployment.md @@ -43,6 +43,7 @@ | 2026-11-09 | 0.20 | Mistral Vibe | Re-Verifikation nach Host-Neustart (09.11.2026, ~05:05 CET): Recovery-Service stellte Production automatisch wieder her (`gn_ai_active_env{env="production"}=1`, Engine `gnai-production-llama-swift15` aktiv). Befund: `gnai-ai-backup.service` lief beim Boot mit Exit 21 (NFS-Mountpoint zu diesem Zeitpunkt noch nicht gemountet) — Timer (Persistent) und Service haben keine Mount-Abhängigkeit; offen: `RequiresMountsFor=/var/lib/ghostnet-pipeline` in der `ai_backup`-Rolle (Abschnitt 14.6) | | 2026-11-09 | 0.21 | Mistral Vibe | Befund aus 0.20 behoben: `ai_backup`-Service-Unit nutzt jetzt `RequiresMountsFor={{ ai_backup_nfs_mountpoint }}` (die bisherige `After=var-lib-ghostnet-pipeline.mount` passte nicht zur escapten Unit `var-lib-ghostnet\x2dpipeline.mount`). Deploy via `backup.yml` (production), verifiziert: systemd-Requires/After auf die Mount-Unit, manueller Lauf `Result=success` mit sha256-verifiziertem Archiv auf dem NFS-Share, Rollen-Zweitlauf `changed=0` (Abschnitt 14.6) | | 2026-11-14 | 0.22 | spektr / Mistral Vibe | Backup-Lücke geschlossen (GNAI-021 follow-up): `ai_backup_paths` um `etc/gnmon` (Dashboard-OIDC-Secret) und `var/lib/ghostnet-ai/production/openwebui-data` (OpenWebUI-Userdaten) erweitert. Die Live-`webui.db` (+`-wal`/`-shm`) wird aus dem Tar ausgeschlossen und stattdessen per SQLite-Online-Backup-API (python3 stdlib) als konsistenter Snapshot an derselben Archiv-Pfad eingefügt. Verifiziert 14.11.2026: manueller Lauf `Result=success`, Archiv `ghostnet-ai-backup-20261114-0720.tar.gz` (844 MB) enthält `etc/gnmon/dashboard-secrets.env` + `openwebui-data/webui.db` (0 wal/shm-Einträge), extrahierte DB `PRAGMA integrity_check` = ok (3 User, 4 Chats), sha256-Sidecar; Rollen-Zweitlauf `changed=0`. Restore-SOP in der Rollen-README ergänzt | +| 2026-11-14 | 0.23 | spektr / Mistral Vibe | llama.cpp-Pin auf v1.0.0 gehoben (Release 13.11.2026): `inference_engine_image_ref` und `rocm_probe_image` auf `sha256:4bbbd2e3…` (Tag `server-rocm-v1.0.0-b12359-b1b770d`, Build `b12359`, Revision `b1b770d90…`, OCI-Label-Version `v1.0.0-b12359-b1b770d`); Flag-Abgleich gegen b12359 `llama-server --help` bestanden (nur `--defrag-thold` entfernt, ungenutzt). Details und verworfene neue Optionen (FP8-KV, MoE-Cache, api-key) in GNAI-010 0.20/3.1. Rollout auf 10.0.0.90 steht noch aus (Pull + expliziter Unit-Restart, da die Rolle aktive Units nicht neu startet) | --- @@ -960,9 +961,11 @@ Danach wurde `verify-rocm-container.yml` mit der eigenständigen Rolle Host-Gerätenachweis und arbeitet anschließend ausschließlich im rootless Podman-Store von `gnai-testing`. Es verwendet das offizielle `llama.cpp`-ROCm-Image als unveränderliches amd64-Manifest -`sha256:b429b8be10d3d0353a09c98f4ab840fe516f779858a28f9fd4e5bdf10bc63cb4` -und prüft dessen OCI-Labels auf Build `b11058` und Revision -`f072b103714dfa1eee531f80b24512faf38e3dd2`. +`sha256:4bbbd2e33deb54330fd23edde3a2cdf12b05ce4415139c7e8639a9aebbacdcf2` +und prüft dessen OCI-Labels auf Revision `b1b770d90d94cad9e9ea5b993bdbc383a522fb28` +und Version `v1.0.0-b12359-b1b770d` (Pin aktualisiert 14.11.2026 auf den v1.0.0- +Release-Tag, Build `b12359`; vorheriger Pin `sha256:b429b8be…`, Build `b11058`, +Revision `f072b103…`). Die ephemeren Probecontainer erhielten nur `/dev/kfd`, die beiden zuvor ermittelten Render-Nodes und `keep-groups`; ein diff --git a/docs/platform/llm-server/ai/GNAI-010-TECH_Llama-Serving.md b/docs/platform/llm-server/ai/GNAI-010-TECH_Llama-Serving.md index 6cbee44..f226099 100644 --- a/docs/platform/llm-server/ai/GNAI-010-TECH_Llama-Serving.md +++ b/docs/platform/llm-server/ai/GNAI-010-TECH_Llama-Serving.md @@ -2,7 +2,7 @@ **Dokumenten-ID:** GNAI-010-TECH **Titel:** `llama.cpp`-Serving mit ROCm und rootless Podman -**Stand:** 2026-11-05 +**Stand:** 2026-11-14 **Status:** Sollkonfiguration umgesetzt und in Testing abgenommen (Abschnitt 10.5–10.10); Production-Lauf über `ai_environment_switch` (GNAI-008 14.6) **Referenzen:** [Modellbewertung](GNAI-009-PLAN_Llama-Model-Evaluation.md), [Ansible-Deployment](GNAI-008-PLAN_Ansible-Deployment.md), [Zielarchitektur](GNAI-004-INFRA_Architecture.md), [Ansible-Anleitung](../../../../llm-server/host/ansible/README.md) @@ -37,6 +37,7 @@ | 2026-11-04 | 0.17 | spektr / Mistral Vibe | Deckel-Einflussmessung ergänzt (Abschnitt 10.10): Bei offenem Deckel 89 °C Junction im Slot 03:00.0 nach 6,75 Min statt 86–88 °C nach 5,5 Min geschlossen – Deckel liefert nur ~1–1,5 Min Verzögerung. Hypothese gehäuseweite Luftführungs-Revision verworfen; Engpass ist das Karten-Sandwich lokal. Konfigurative Hebel (PWM-Anhebung, Tensor-Split, Power Cap) als nächster Testschritt nach GNMON-001-Anschluss festgehalten. | | 2026-11-05 | 0.18 | spektr / Mistral Vibe | PWM-Durchgriffstest ergänzt (Abschnitt 10.10): manueller Lüfter-PWM 255 auf der Karte im Slot 03:00.0 ergibt 3.149 RPM und ein stabiles Junction-Plateau von 76 °C (Peaks 80 °C) bei unverändertem Durchsatz (18,04 t/s) – Vorläufe brachen bei 86–93 °C ab. Werkkurve als Engpass identifiziert; Benchmarks unter Override thermisch wieder zulässig, eigenes Lüfterkurven-Service als Dauerlösung festgelegt, M5-Monitoring als live verifiziert dokumentiert. Override nach Test auf Auto zurückgesetzt. | | 2026-11-05 | 0.19 | spektr / Mistral Vibe | Dauerlösung deployt (Abschnitt 10.10): Rolle `gpu_fan_control` im Host-Projekt installiert den Systemdienst `gnai-gpu-fan-control` (PCI-stabile Adressierung beider Karten, Junction-Kurve 50/58/66/72/76 °C → 0/80/140/200/255 PWM, 5s-Zyklus, fallende Hysterese, EXIT-Failsafe auf Werksteuerung, Re-Assert des manuellen Modus je Zyklus). Preview/Deploy/Idempotenz bestanden, Kurzlasttest regelt 67–72 °C; BFCL-Restserie läuft wieder unter Lüfterschutz. | +| 2026-11-14 | 0.20 | spektr / Mistral Vibe | Image-Pin auf llama.cpp **v1.0.0** (Release 13.11.2026) gehoben: Tag `server-rocm-v1.0.0-b12359-b1b770d`, Index-Digest `sha256:4bbbd2e3…`, Build `b12359`, Revision `b1b770d90…` (Abschnitt 3.1). Upstream-Wechsel auf Semver: vX.Y.Z-Tags, aufgelöst über `nightly-tag.txt`; bewegliches `server-rocm` zeigt aktuell auf denselben Digest. Kompatibilitätsprüfung gegen `llama-server --help` von b12359 (Image lokal gepullt): alle 26 `Exec=`-Flags des Quadlets existieren; einzige entfernte Option `-dt/--defrag-thold` (#30565) wird nicht verwendet. Server-Härtung in 1.0 (#32113/#32115/#32098) betrifft uns nicht: kein server-seitiges `--tools`/MCP (Non-Loopback-Refusal greift nicht), keine privaten Media-URLs (keine Vision), OpenWebUI ist Non-Browser-Client. Neu verfügbare Optionen bewertet: `-ctk/-ctv f8_e4m3` (FP8-KV, auf gfx1030 emuliert — Benchmark vor Adoption, Default bleibt q8_0), `--moe-cache-cpu-share` (nur MoE, Profil ist dense), `--sleep-idle-seconds` (kontraproduktiv bei 128k), `--api-key` (optional, Port ohnehin netz-isoliert), `--allow-unauthenticated-tools`/`--media-allow-private-urls` (bleiben aus). libllama-soname .so.1/36 entfernte C-Symbole betreffen nur native Bindings — wir sind HTTP-only. Nach dem Rollout nennt die API `system_fingerprint: b12359-b1b770d90`. | --- @@ -80,12 +81,12 @@ nicht nachgewiesen. | Feld | Wert | | --- | --- | -| Upstream | `ghcr.io/ggml-org/llama.cpp:server-rocm` | -| verwendete Referenz | `ghcr.io/ggml-org/llama.cpp@sha256:b429b8be10d3d0353a09c98f4ab840fe516f779858a28f9fd4e5bdf10bc63cb4` | -| Architektur | amd64 | -| Build | `b11058` | -| Revision | `f072b103714dfa1eee531f80b24512faf38e3dd2` | -| Status | ROCm-Geräteerkennung unter `gnai-testing` bestanden | +| Upstream | `ghcr.io/ggml-org/llama.cpp:server-rocm-v1.0.0-b12359-b1b770d` (moving tag `server-rocm` zeigt seit 13.11.2026 auf denselben Digest) | +| verwendete Referenz | `ghcr.io/ggml-org/llama.cpp@sha256:4bbbd2e33deb54330fd23edde3a2cdf12b05ce4415139c7e8639a9aebbacdcf2` | +| Architektur | amd64 (Manifest `sha256:abb28972…`) | +| Build | `b12359` (v1.0.0, Release-Tag 13.11.2026, aufgelöst über `nightly-tag.txt`) | +| Revision | `b1b770d90d94cad9e9ea5b993bdbc383a522fb28` (OCI-Label `version=v1.0.0-b12359-b1b770d`) | +| Status | ROCm-Geräteerkennung unter `gnai-testing` bestanden (b11058); Flag-Abgleich aller Quadlet-`Exec=`-Optionen gegen `llama-server --help` von b12359 am 14.11.2026 bestanden — einzige Entfernung `--defrag-thold` wird nicht genutzt; ENTRYPOINT `/app/llama-server` unverändert. Vorheriger Pin b11058/`f072b103…`/`sha256:b429b8be…`: bis 14.11.2026 produktiv | Der Dienst verwendet ausschließlich den Digest. Ein bewegliches Tag darf in Testing zur Recherche aufgelöst, aber nicht in ein freigegebenes Profil @@ -978,6 +979,7 @@ Konsequenzen und Folgeaktionen: - [Swift-GGUF-Prüfsummen](https://huggingface.co/ukisai/Swift-Qwen3.8-27B-GGUF/blob/main/SHA256SUMS) - [Unsloth Qwen3.8-27B-GGUF – Modellkarte](https://huggingface.co/unsloth/Qwen3.8-27B-GGUF) - [Unsloth UD-Q6_K – Datei und SHA-256](https://huggingface.co/unsloth/Qwen3.8-27B-GGUF/blob/4ca720788d1e01f1bff70c033e0d0028fd02e502/Qwen3.8-27B-UD-Q6_K.gguf) -- [llama.cpp Server-Parameter und Router-Modus des gepinnten Builds](https://github.com/ggml-org/llama.cpp/blob/f072b103714dfa1eee531f80b24512faf38e3dd2/tools/server/README.md) +- [llama.cpp Server-Parameter und Router-Modus des gepinnten Builds](https://github.com/ggml-org/llama.cpp/blob/b1b770d90d94cad9e9ea5b993bdbc383a522fb28/tools/server/README.md) +- [llama.cpp Release v1.0.0 (13.11.2026) und Semver-Policy](https://github.com/ggml-org/llama.cpp/releases/tag/v1.0.0) - [Podman Quadlet](https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html) - [systemd-Unit-Abhängigkeiten](https://manpages.debian.org/trixie/systemd/systemd.unit.5.en.html) diff --git a/docs/platform/llm-server/ai/GNAI-021-TECH_OpenWebUI-Theme.md b/docs/platform/llm-server/ai/GNAI-021-TECH_OpenWebUI-Theme.md new file mode 100644 index 0000000..8fdaf7c --- /dev/null +++ b/docs/platform/llm-server/ai/GNAI-021-TECH_OpenWebUI-Theme.md @@ -0,0 +1,142 @@ +# Technischer Arbeitsentwurf + +**Dokumenten-ID:** GNAI-021-TECH +**Titel:** Ghostnet-Branding „gnai-catppuccin-mocha" — OpenWebUI-Theme als Default + Favicon „ursprünglicher Geist" auf beiden Sites, update-persistent +**Stand:** 2026-11-14 +**Status:** produktiv seit 2026-11-14 (Betreiber-Go „schalte es live"): Theme live; Favicons nach Betreiberentscheid 2026-11-14 zurück auf den ursprünglichen Geist (Badge-Varianten v2/v5 verworfen) — Monitoring via Image v0.3.6 (unverändert), OpenWebUI via ro-Mounts; Konvergenz `changed=0` +**Referenzen:** [DOC-Index](../../../GNAI-000-DOC_Index.md), [GNMON-000](../monitoring/GNMON-000-DOC_Index.md) (Dashboard-Stil M3.1: Catppuccin Mocha, Monospace), Rolle `llm-server/llm/ansible/roles/open_webui/`, OpenWebUI v0.13.3 (digest-gepinnt, `sha256:46b59158…`), Upstream-Quelle `tag v0.13.3` + +> Dieses Dokument beschreibt den technischen Sollzustand des Custom-Themes für +> OpenWebUI (`https://chat.ghostnet.selfhost.eu`, intern `10.0.0.90:8081`) und +> warum es OpenWebUI-Updates unabhängig übersteht. + +--- + +## Änderungsverlauf + +| Datum | Version | Autor | Beschreibung | +| --- | --- | --- | --- | +| 2026-11-14 | 0.1 | spektr / Mistral Vibe | Erstfassung: Befunde zum Theme-Mechanismus in v0.13.3, update-persistenter Mount, Umsetzung in Rolle `open_webui`, Verifikation | +| 2026-11-14 | 0.2 | spektr / Mistral Vibe | Live-Rollout: erster Lauf `changed=3` (Theme-Dir, custom.css, Quadlet), Play brach vor den Handlern an der Served-Prüfung ab (alter Container ohne Mount) — daemon-reload + Unit-Restart manuell nachgezogen, danach `GET /static/custom.css` = 200 mit 5311 Bytes und Marker; zweiter Playbook-Lauf konvergent `changed=0, failed=0`. Der Neustart nach Quadlet-Change ist zugleich der Persistenz-Beweis: OpenWebUIs Start-Wipe von `static/` läuft dabei erneut und kann den ro-Mount nicht anfassen | +| 2026-11-14 | 0.3 | spektr / Mistral Vibe | Favicons ergänzt (Abschnitt 5): v2 (Ghost + Pulse-Badge) für das Monitoring-Dashboard, v5 (Ghost + Terminal-Badge) für OpenWebUI — gleiche read-only-Mount-Mechanik | +| 2026-11-14 | 0.4 | spektr / Mistral Vibe | Live-Rollout Favicons: OpenWebUI v5 via ro-Mounts OK (alle 5 Dateien byte-identisch serviert, md5-geprüft). Dashboard: Mount-Versuch über `/app/wwwroot` scheiterte (HTTP 500 — MapStaticAssets-Manifest-Mismatch, Befund in Abschnitt 5), deshalb Image-Rebuild `dashboard:v0.3.7` auf der Workstation (Image-ID `a2c15048e188`, favicon md5 `87f78a61…` im Image verifiziert), `podman save`/scp/`load` als gn-dashboard, Tag im Inventory gebumpt, Unit neu gestartet — `GET /favicon.png` = 200, 2488 Bytes, md5 identisch zur Quelle; Playbook konvergent `changed=0, failed=0` | +| 2026-11-14 | 0.5 | spektr / Mistral Vibe | Betreiberentscheid: Badge-Varianten verworfen, beide Sites nutzen wieder den ursprünglichen Geist. Monitoring komplett reverted (Quell-PNGs, Rolle, Inventory-Tag v0.3.6; `GET /favicon.png` = 2729 B, md5 `78966788…`). OpenWebUI: Favicon-Dateien gegen byte-identische Kopien des Dashboard-Originals ersetzt (Mounts bleiben); Inode-Befund dokumentiert (copy→Rename→neuer Inode, laufender Container serviert alt — deshalb notify Restart + flush_handlers vor den Checks). Beide Playbooks konvergent `changed=0, failed=0`; alle Favicon-URLs md5-verifiziert | + +--- + +## 1. Entscheidung + +Betreiberwunsch 2026-11-14: OpenWebUI soll im Farbschema der Monitor-Website +(`mon.ghostnet.selfhost.eu`, GNMON — Catppuccin Mocha, DejaVu Sans Mono, +Hacker-TUI-Stil) erscheinen; das Theme soll **Default für alle Nutzer** sein +und **unabhängig von OpenWebUI-Updates** bestehen bleiben (kein Image-Patch, +kein Fork). + +## 2. Befunde zum Theme-Mechanismus in OpenWebUI v0.13.3 + +a) **Es gibt kein server-seitiges Theme.** Die Theme-Wahl (`system`/`light`/ + `dark`/`oled-dark`/`her`) liegt pro Browser in `localStorage.theme` + (`src/app.html`, `src/lib/utils/theme.ts` `setTheme()`); in der DB + (`webui.db`) existiert keine Theme-Tabelle (Backend-Modelle/Routers enthalten + kein Theme — geprüft gegen `tag v0.13.3`). Ein „Default-Theme für alle + Nutzer" lässt sich daher nicht serverseitig erzwingen, sondern nur über + CSS, das beide Modi abdeckt (Abschnitt 3). +b) **Offizieller Extension-Point: `/static/custom.css`.** `src/app.html` lädt + auf jeder Seite ``. Das + Image enthält an dieser Stelle eine **leere** Placeholder-Datei + (`static/static/custom.css` = leerer Blob). Live verifiziert 2026-11-14: + `GET /` enthält den custom.css-Link; `GET /static/custom.css` → 200, 0 Bytes. +c) **`/static` wird aus `STATIC_DIR` serviert** (`main.py`: `app.mount('/static', + StaticFiles(directory=STATIC_DIR))`, Default `/app/backend/open_webui/static`). + Beim Start wiped `config.py` alle Top-Level-Dateien in `STATIC_DIR` und kopiert + sie aus dem Image neu (`STATIC_SOURCE_DIR = /app/build/static`). Eine + **read-only bind-mountete Einzeldatei** kann dort weder `unlink()`t noch per + `copyfile` überschrieben werden (EBUSY/EROFS, beides per `except: pass` + ge-swallowt) — sie überlebt jeden Start und jedes Image-Update. +d) **Theme-Switch setzt Inline-Styles.** `setTheme()` schreibt + `--color-gray-800/850/900/950` als Inline-Style auf `` (dark/oled-dark). + Das Theme-CSS braucht daher `!important` auf den Custom-Properties. + Ungelayertes CSS (custom.css) schlägt außerdem die `@layer theme`-Variablen + von Tailwind v4 (`src/tailwind.css` definiert nur die Graustufen selbst; + Akzentfarben kommen aus dem Tailwind-Default-Theme). +e) **Farbpalette des Dashboards** stammt aus + `llm-server/monitoring/src/Ghostnet.Dashboard/wwwroot/app.css` (`:root`, + Catppuccin Mocha: crust `#11111b` … text `#cdd6f4` … mauve `#cba6f7`). + +## 3. Umsetzung + +- Theme-Datei im Repo: `llm-server/llm/ansible/roles/open_webui/files/theme/gnai-catppuccin-mocha.css`. + Mapping: Graustufen-Rampe → Mocha-Oberflächen (dark: 950=crust, 900=base, + 850=mantle, 800=surface0 … 50=text; light: Rampe invertiert auf dieselbe + dunkle Palette, damit auch `light`/`system`-Nutzer das Mocha-Theme sehen), + Akzent-Rampen (blue→sapphire/blue, green→green/teal, red→red, yellow→yellow, + orange→peach, violet→mauve), `color-scheme: dark`, Monospace-Stack + (`"DejaVu Sans Mono", ui-monospace, …`), Splash-Screen auf base/peach/grün. +- Deployment (Rolle `open_webui`): + - `open_webui_theme_dir = /var/lib/ghostnet-ai/production/openwebui-theme`, + Datei `custom.css` (Owner `gnai-production`, `0644`). + - Quadlet `open-webui.container.j2`: + `Volume={{ open_webui_theme_dir }}/custom.css:/app/backend/open_webui/static/custom.css:ro`. + - Kein Restart bei reinen Inhaltsänderungen nötig (`/static` wird pro Request + von Disk gelesen); der Quadlet-Change triggert einmalig daemon-reload + + Restart über die bestehenden Handler. +- Verifikation im Playbook: nach dem Health-Check prüft + `GET http://10.0.0.90:8081/static/custom.css` auf HTTP 200 **und** den Marker + `gnai-catppuccin-mocha` im Body — so fällt ein künftiges Image, das custom.css + nicht mehr referenziert/serviert, sofort auf statt still zu verstummen. + +## 4. Warum das Theme Updates überlebt + +- Der Mount liegt **host-seitig im Quadlet** (Ansible, Git), nicht im Image. +- Die Theme-Datei liegt **im Repo** und wird idempotent erneut ausgerollt + (`changed=0` bei unverändertem Stand). +- Beim Container-Start (auch nach Image-Update auf neuen Digest) kopiert + OpenWebUI `static/` zwar neu, kann die read-only gemountete Datei aber nicht + anfassen (Befund c) — das Theme bleibt aktiv. +- Einzige Sollbruchstelle: Ein künftiges OpenWebUI-Release, das den + `custom.css`-Link aus `app.html` entfernt. Der Served-Check im Playbook + (Abschnitt 3) erkennt das beim nächsten Rollout; bis dahin bleibt das Theme + auch über Updates aktiv. + +## 5. Favicons — Betreiberentscheid 2026-11-14: ursprünglicher Geist auf BEIDEN Sites + +Badge-Varianten (v2 Pulse, v5 Terminal aus `~/Downloads/Gemini_Generated_Image_p4vvywp4vvywp4vv.jpg`) +wurden gebaut, live genommen und dann vom Betreiber verworfen: Beide Websites +verwenden wieder das ursprüngliche Geist-Favicon der Monitoring-Website +(`favicon.png` 32x32 md5 `78966788…`, `apple-touch-icon.png` 180x180 md5 `9bc48a15…`). + +- **Monitoring-Dashboard:** alles zurückgesetzt — Quell-PNGs, Rolle + `gnmon_dashboard` und Inventory-Tag auf `HEAD`/`v0.3.6` reverted; Unit neu + gestartet, `GET /favicon.png` = 2729 Bytes, md5 identisch zum Original. Der + Image-Bau v0.3.7 (mit v2-Favicon) bleibt als unbenutztes Image im Store liegen. +- **OpenWebUI:** Mount-Mechanik bleibt (funktioniert), nur der Inhalt wurde + ersetzt: `roles/open_webui/files/favicon/` enthält jetzt byte-identische Kopien + des Dashboard-Originals (favicon.png, apple-touch-icon.png) plus Ableitungen + (favicon-96x96.png, favicon.ico 16/32, favicon.svg als Data-URI-Wrapper). + Live verifiziert: alle fünf `/static/*`-URLs liefern die erwarteten md5s. +- **Befund Inode (14.11.2026):** Single-File-Bind-Mounts binden den Inode bei + Container-Erzeugung; Ansible `copy` ersetzt Dateien per Rename (neuer Inode) — + der laufende Container serviert dann weiter den alten Inhalt. Deshalb notifyen + die Copy-Tasks in der Rolle jetzt `Restart OpenWebUI unit`, und `flush_handlers` + läuft vor den Served-Checks. +- **Befund .NET (14.11.2026):** Beim Dashboard ist der Mount-Weg prinzipiell + unbrauchbar — .NET 10 `MapStaticAssets` liest Content-Length/ETag aus dem + Publish-Manifest (`Ghostnet.Dashboard.staticwebassets.endpoints.json`); eine + gemountete abweichende Datei lieferte HTTP 500 (kürzer) bzw. Truncation (länger). + Favicon-Änderungen am Dashboard erfordern also immer einen Image-Bau + Tag-Bump. + +- Out of scope: OpenWebUI-Splash (`splash.png`/`splash-dark.png`) und + `site.webmanifest`/`web-app-manifest-*.png` zeigen weiterhin das OpenWebUI-Logo. + +## 6. Grenzen / Offen + +- Die Theme-Auswahl im UI (Settings → General → Theme) bleibt sichtbar, ist + aber visuell neutralisiert (light und dark rendern beide Mocha). Wer explizit + „OLED Dark" wählt, bekommt ebenfalls Mocha (Crust statt Schwarz) — bewusst, + damit das GNMON-Theme überall greift. +- Die DejaVu-Sans-Mono-Datei des Dashboards wird nicht eingebettet (kein + Font-Mount ohne neuen Mount-Pfad); auf Linux-Clients mit installierter + DejaVu Sans Mono ist der Look identisch, sonst greift der Monospace-Fallback. +- Code-Highlighting (hljs) und eingebettete Markdown-Tabellen behalten ihre + eigenen Akzente — bewusst nur dezente Anpassungen (Links sapphire, Inline-Code + peach, Selection mauve). diff --git a/docs/platform/llm-server/ai/GNAI-022-TECH_OpenWebUI-DeepResearch.md b/docs/platform/llm-server/ai/GNAI-022-TECH_OpenWebUI-DeepResearch.md index 4e743f5..751eaef 100644 --- a/docs/platform/llm-server/ai/GNAI-022-TECH_OpenWebUI-DeepResearch.md +++ b/docs/platform/llm-server/ai/GNAI-022-TECH_OpenWebUI-DeepResearch.md @@ -113,7 +113,7 @@ nach OWUI-v0.13.3 Reserved-Args (`user_prompt` lesen, History cappen). Admin die Pipe im Selector. - **Branding (GNAI-021, persistent nachgezogen 14.11.):** Favicons + `custom.css`-Theme liegen in `roles/open_webui/files/branding/`, werden - nach `openwebui-branding/` deployt und per ro-Mount in + nach `open_webui_favicon_dir` / `open_webui_theme_dir` deployt und per ro-Mount in `/app/backend/open_webui/static/` **und** `/app/build/favicon.png` gemountet (v0.13.3: index.html lädt `/static/*` aus dem Backend-static, die Root-Route `/favicon.png` aus dem Build-Dir). Verifiziert von außen: diff --git a/llm-server/host/ansible/README.md b/llm-server/host/ansible/README.md index 5555417..a6e9bbb 100644 --- a/llm-server/host/ansible/README.md +++ b/llm-server/host/ansible/README.md @@ -204,11 +204,15 @@ The dedicated verification playbook uses `gnai-testing` and an immutable amd64 manifest of the official `llama.cpp` ROCm image: ```text -version: b11058 -revision: f072b103714dfa1eee531f80b24512faf38e3dd2 -digest: sha256:b429b8be10d3d0353a09c98f4ab840fe516f779858a28f9fd4e5bdf10bc63cb4 +version: v1.0.0-b12359-b1b770d # OCI label; release tag v1.0.0 (2026-11-13), build b12359 +revision: b1b770d90d94cad9e9ea5b993bdbc383a522fb28 +digest: sha256:4bbbd2e33deb54330fd23edde3a2cdf12b05ce4415139c7e8639a9aebbacdcf2 ``` +Updated 2026-11-14 from the previous pin `b11058` / `f072b103…` / +`sha256:b429b8be…` to the v1.0.0 stable tag (`server-rocm-v1.0.0-b12359-b1b770d`, +amd64 manifest `sha256:abb28972…`). + It passes `/dev/kfd` and both discovered render nodes with `--group-add=keep-groups`. `rocminfo` must report exactly two `gfx1030` agents, and `llama-server --list-devices` must expose exactly two ROCm devices. No diff --git a/llm-server/host/ansible/roles/rocm_container_probe/defaults/main.yml b/llm-server/host/ansible/roles/rocm_container_probe/defaults/main.yml index e3c18d5..c7bc8bb 100644 --- a/llm-server/host/ansible/roles/rocm_container_probe/defaults/main.yml +++ b/llm-server/host/ansible/roles/rocm_container_probe/defaults/main.yml @@ -4,9 +4,11 @@ rocm_probe_account: uid: 981 home: /var/lib/ghostnet-ai/testing +# 2026-11-14: pin moved to the v1.0.0 stable tag (build b12359, commit +# b1b770d90); OCI label version of that image is v1.0.0-b12359-b1b770d. rocm_probe_image: >- - ghcr.io/ggml-org/llama.cpp@sha256:b429b8be10d3d0353a09c98f4ab840fe516f779858a28f9fd4e5bdf10bc63cb4 -rocm_probe_expected_image_revision: f072b103714dfa1eee531f80b24512faf38e3dd2 -rocm_probe_expected_image_version: b11058 + ghcr.io/ggml-org/llama.cpp@sha256:4bbbd2e33deb54330fd23edde3a2cdf12b05ce4415139c7e8639a9aebbacdcf2 +rocm_probe_expected_image_revision: b1b770d90d94cad9e9ea5b993bdbc383a522fb28 +rocm_probe_expected_image_version: v1.0.0-b12359-b1b770d rocm_probe_expected_architecture: gfx1030 rocm_probe_expected_device_count: 2 diff --git a/llm-server/llm/ansible/roles/ai_backup/README.md b/llm-server/llm/ansible/roles/ai_backup/README.md index d099627..ea1ea4d 100644 --- a/llm-server/llm/ansible/roles/ai_backup/README.md +++ b/llm-server/llm/ansible/roles/ai_backup/README.md @@ -8,9 +8,17 @@ share (`pve:/media/datenhdd3/Encoding`, operator decision 06.11.2026). ## Backup scope - `/etc/ghostnet-ai` (all environment config trees) +- `/etc/gnmon` (dashboard OIDC env file `dashboard-secrets.env`; added + 14.11.2026, GNAI-021 follow-up) - `/etc/containers/systemd/users/{980,981,984}` (rootless quadlets, included when present) - `/var/lib/ghostnet-ai/environment-state` (switch state) +- `/var/lib/ghostnet-ai/production/openwebui-data` (OpenWebUI app + user + data: uploads, cache; added 14.11.2026, GNAI-021 follow-up). The live + `webui.db`/`-wal`/`-shm` are **excluded** from the tar; instead a + consistent snapshot via SQLite's online-backup API (python3 stdlib) is + appended at the same archive path, so a mid-write WAL state is never + archived. - `/var/lib/ghostnet-ai/testing/bench/results` (benchmark artifacts) - `/var/lib/ghostnet-ai/shared/models` **without `*.gguf`** — the pinned `SOURCE.yml` manifests make the weights reproducible through the @@ -53,7 +61,13 @@ before it replaces the last good file; retention keeps the newest runtime converges with the restored state. 6. For model weights: restore via the model_store role (`--tags models`), then verify the `SOURCE.yml` checksums. -7. Re-run the affected environment playbook +7. For OpenWebUI user data (`var/lib/ghostnet-ai/production/openwebui-data`): + stop the unit (`runuser -u gnai-production -- systemctl --user stop + gnai-production-openwebui`), copy the archived `webui.db` back, + `chown -R gnai-production:gn-production` the data dir, start the unit, + then re-run `playbooks/webui.yml` (re-applies model/tool/config sync) + and verify `/health` + model list. +8. Re-run the affected environment playbook (`playbooks/ai.yml --tags service`) and verify health. Accepted proof (06.11.2026): full-tree extract-and-diff against the diff --git a/llm-server/llm/ansible/roles/ai_backup/defaults/main.yml b/llm-server/llm/ansible/roles/ai_backup/defaults/main.yml index 76e8422..a9a2ca9 100644 --- a/llm-server/llm/ansible/roles/ai_backup/defaults/main.yml +++ b/llm-server/llm/ansible/roles/ai_backup/defaults/main.yml @@ -25,12 +25,22 @@ ai_backup_script: /usr/local/sbin/gnai-ai-backup # the script only when they exist. ai_backup_paths: - etc/ghostnet-ai + - etc/gnmon - etc/containers/systemd/users/980 - etc/containers/systemd/users/981 - etc/containers/systemd/users/984 - var/lib/ghostnet-ai/environment-state + - var/lib/ghostnet-ai/production/openwebui-data - var/lib/ghostnet-ai/testing/bench/results +# OpenWebUI app data (GNAI-021 follow-up, 14.11.2026): the live SQLite +# webui.db (and its -wal/-shm sidecars) is EXCLUDED from the tar and replaced +# by a consistent snapshot taken via SQLite's online-backup API (python3 +# stdlib), so a mid-write WAL state is never archived. The snapshot lands at +# the same path inside the archive as the live db. +ai_backup_openwebui_data_dir: var/lib/ghostnet-ai/production/openwebui-data +ai_backup_openwebui_db: webui.db + # Included without its multi-gigabyte weights: model manifests and any # other metadata below the shared model store. ai_backup_model_store_meta: var/lib/ghostnet-ai/shared/models diff --git a/llm-server/llm/ansible/roles/ai_backup/tasks/main.yml b/llm-server/llm/ansible/roles/ai_backup/tasks/main.yml index 9b7b052..4dc19a6 100644 --- a/llm-server/llm/ansible/roles/ai_backup/tasks/main.yml +++ b/llm-server/llm/ansible/roles/ai_backup/tasks/main.yml @@ -13,6 +13,8 @@ - ai_backup_paths | length > 0 - ai_backup_service | length > 0 - ai_backup_script is match("^/usr/local/sbin/") + - ai_backup_openwebui_data_dir is match("^var/lib/") + - ai_backup_openwebui_db is match("^[a-z0-9_.-]+$") fail_msg: AI backup declarations are incomplete or invalid. - name: Require the NFS pipeline share to be mounted diff --git a/llm-server/llm/ansible/roles/ai_backup/templates/gnai-ai-backup.sh.j2 b/llm-server/llm/ansible/roles/ai_backup/templates/gnai-ai-backup.sh.j2 index 31ea209..f98b2ee 100644 --- a/llm-server/llm/ansible/roles/ai_backup/templates/gnai-ai-backup.sh.j2 +++ b/llm-server/llm/ansible/roles/ai_backup/templates/gnai-ai-backup.sh.j2 @@ -39,8 +39,40 @@ mkdir -p "$TARGET_DIR" STAMP=$(date +%Y%m%d-%H%M) ARCHIVE="$TARGET_DIR/ghostnet-ai-backup-$STAMP.tar.gz" TMP="$ARCHIVE.tmp" +RAWTMP="$ARCHIVE.raw" -tar -C / -czf "$TMP" "${paths[@]}" +# Consistent snapshot of the live OpenWebUI SQLite DB via the online-backup +# API (python3 stdlib; sqlite3 CLI is not installed on the host). The live +# db + wal/shm are excluded from the archive and the snapshot is appended at +# the same archive path. +DATA_REL="{{ ai_backup_openwebui_data_dir }}" +DB_REL="$DATA_REL/{{ ai_backup_openwebui_db }}" +STAGE="" +if [ -f "/$DB_REL" ]; then + STAGE=$(mktemp -d /tmp/gnai-ai-backup-stage.XXXXXX) + mkdir -p "$STAGE/$DATA_REL" + python3 - "/$DB_REL" "$STAGE/$DB_REL" <<'PY' +import sqlite3, sys +src = sqlite3.connect(f"file:{sys.argv[1]}?mode=ro", uri=True) +dst = sqlite3.connect(sys.argv[2]) +with dst: + src.backup(dst) +dst.close() +src.close() +PY +fi +trap 'rm -rf "$STAGE" "$RAWTMP"' EXIT + +# Build uncompressed first so the staged DB can be appended (tar -r does not +# work on compressed archives), then gzip. +tar -C / -cf "$RAWTMP" \ + --exclude="$DB_REL" --exclude="$DB_REL-wal" --exclude="$DB_REL-shm" \ + "${paths[@]}" +if [ -n "$STAGE" ]; then + tar -C "$STAGE" -rf "$RAWTMP" "$DB_REL" +fi +gzip -c "$RAWTMP" > "$TMP" +rm -f "$RAWTMP" if ! tar -tzf "$TMP" > /dev/null 2>&1; then log "ERROR: archive failed the integrity check" >&2 diff --git a/llm-server/llm/ansible/roles/inference_engine/defaults/main.yml b/llm-server/llm/ansible/roles/inference_engine/defaults/main.yml index c5bdbc0..759cf7c 100644 --- a/llm-server/llm/ansible/roles/inference_engine/defaults/main.yml +++ b/llm-server/llm/ansible/roles/inference_engine/defaults/main.yml @@ -4,10 +4,16 @@ # Experimental candidate and is intentionally not modelled here yet. # # Container image: immutable digest, never a moving tag (GNAI-010 section 3.1). -inference_engine_image: ghcr.io/ggml-org/llama.cpp:server-rocm -inference_engine_image_ref: ghcr.io/ggml-org/llama.cpp@sha256:b429b8be10d3d0353a09c98f4ab840fe516f779858a28f9fd4e5bdf10bc63cb4 -inference_engine_image_build: "b11058" -inference_engine_image_revision: f072b103714dfa1eee531f80b24512faf38e3dd2 +# 2026-11-14: pin moved to the v1.0.0 stable tag (released 2026-11-13), resolved +# via the release asset nightly-tag.txt to build b12359; the moving tag +# `server-rocm` already points at the same digest. All Exec flags of the quadlet +# were verified against `llama-server --help` of b12359 — the only removed flag +# is --defrag-thold (unused here). OCI labels: version v1.0.0-b12359-b1b770d, +# revision b1b770d90d94cad9e9ea5b993bdbc383a522fb28. +inference_engine_image: ghcr.io/ggml-org/llama.cpp:server-rocm-v1.0.0-b12359-b1b770d +inference_engine_image_ref: ghcr.io/ggml-org/llama.cpp@sha256:4bbbd2e33deb54330fd23edde3a2cdf12b05ce4415139c7e8639a9aebbacdcf2 +inference_engine_image_build: "b12359" +inference_engine_image_revision: b1b770d90d94cad9e9ea5b993bdbc383a522fb28 # Environment identity (overridden per inventory, GNAI-008 section 7.4). inference_engine_user: gnai-testing diff --git a/llm-server/llm/ansible/roles/open_webui/README.md b/llm-server/llm/ansible/roles/open_webui/README.md index 52973f1..05af408 100644 --- a/llm-server/llm/ansible/roles/open_webui/README.md +++ b/llm-server/llm/ansible/roles/open_webui/README.md @@ -67,3 +67,40 @@ wird nach `open_webui_branding_dir` deployt und per read-only Mounts in `/app/backend/open_webui/static/` des Image gemountet — update-persistent, da OpenWebUIs Start-Wipe von `static/` ro-Mounts nicht anfassen kann. Datei-Ersetzen erzeugt einen neuen Inode, daher notify Restart. +## Theme (GNAI-021): GNMON Catppuccin Mocha als Default + +- `files/theme/gnai-catppuccin-mocha.css` wird nach + `/var/lib/ghostnet-ai/production/openwebui-theme/custom.css` deployt und im + Quadlet **read-only** über `/app/backend/open_webui/static/custom.css` + gemountet (`Volume=...:ro`). +- `index.html` lädt `/static/custom.css` auf jeder Seite — update-sicher: Beim + Container-Start kopiert OpenWebUI zwar `static/` neu (`config.py`), aber + eine read-only Einzeldatei kann weder unlinkt noch überschrieben werden; + der Mount liegt host-seitig im Quadlet, die Datei kommt aus Git. Image-Updates + (neuer Digest) ändern daran nichts. +- Default für alle Nutzer: OpenWebUI speichert die Theme-Wahl (light/dark) nur + pro Browser in `localStorage` — es gibt keinen server-seitigen Default. Das + CSS bildet daher `html.light` UND `html.dark` auf dieselbe Mocha-Palette ab + (`!important` gegen die Inline-Styles von `setTheme()`), sodass das + GNMON-Theme unabhängig von der UI-Auswahl immer greift. +- Verifikation: Task `Verify the GNMON theme is served as /static/custom.css` + prüft nach dem Health-Check, dass die Datei non-empty mit Marker ausgeliefert + wird. + +## Favicon (GNAI-021): ursprünglicher Geist (wie Monitoring-Website) + +- `files/favicon/` (favicon.png 32px und apple-touch-icon.png 180px + byte-identisch zum Dashboard-Original, dazu favicon-96x96.png, favicon.ico, + favicon.svg als Ableitungen) wird nach + `/var/lib/ghostnet-ai/production/openwebui-favicon/` deployt und im Quadlet + **read-only** über die entsprechenden Dateien in + `/app/backend/open_webui/static/` gemountet (app.html referenziert alle fünf). +- Update-persistent wie das Theme: Mount host-seitig im Quadlet, Datei aus Git; + OpenWebUIs Start-Kopie von `static/` kann eine ro-Einzeldatei nicht anfassen. +- Achtung Inode: Single-File-Bind-Mounts binden den Inode bei der + Container-Erzeugung; Ansible `copy` ersetzt die Datei (Rename → neuer Inode). + Inhaltsänderungen notifies deshalb `Restart OpenWebUI unit`, und + `flush_handlers` läuft vor den Served-Checks, damit die geprüft wird, was + der Neustart neu gebunden hat. +- Verifikation: `GET /static/favicon.png` muss byte-identisch zur deployen Datei + sein (content_length vs. stat). diff --git a/llm-server/llm/ansible/roles/open_webui/defaults/main.yml b/llm-server/llm/ansible/roles/open_webui/defaults/main.yml index 51c1a36..d7a08db 100644 --- a/llm-server/llm/ansible/roles/open_webui/defaults/main.yml +++ b/llm-server/llm/ansible/roles/open_webui/defaults/main.yml @@ -74,22 +74,41 @@ open_webui_host_addr: 10.0.0.90 open_webui_host_port: 8081 open_webui_container_port: 8080 -# Branding (GNAI-021): Geist-Favicons + Theme custom.css ("gnai-catppuccin- -# mocha"), update-persistent via read-only mounts into the image's static -# dir. The files live in files/branding/ (favicon.png is byte-identical to -# the monitoring dashboard's original ghost, md5 789667887d0f5f704213222bfe61ad52). -open_webui_branding_dir: /var/lib/ghostnet-ai/production/openwebui-branding -open_webui_branding_files: - - favicon.png - - favicon.svg - - favicon.ico - - favicon-96x96.png - - apple-touch-icon.png - - custom.css - # Persistent app data (SQLite DB, uploads, cache). open_webui_data_dir: /var/lib/ghostnet-ai/production/openwebui-data +# GNMON theme (GNAI-021): Catppuccin Mocha wie das Monitoring-Dashboard. +# Wird als einzelne read-only-Datei über den Image-Placeholder +# /app/backend/open_webui/static/custom.css gemountet (index.html lädt +# /static/custom.css auf jeder Seite). Beim Container-Start kopiert OpenWebUI +# sein static/-Verzeichnis zwar neu (config.py), aber eine read-only +# Einzeldatei kann weder unlinkt noch überschrieben werden — die Fehler werden +# upstream ge-swallowt. Das Theme überlebt Image-Updates, weil der Mount +# host-seitig im Quadlet liegt und die Datei aus diesem Repo kommt. +open_webui_theme_dir: /var/lib/ghostnet-ai/production/openwebui-theme +open_webui_theme_src: theme/gnai-catppuccin-mocha.css +open_webui_theme_file: custom.css +open_webui_theme_container_path: /app/backend/open_webui/static/custom.css + +# Favicon (GNAI-021): the ORIGINAL ghost favicon of the monitoring site +# (byte-identical PNGs from src/Ghostnet.Dashboard/wwwroot/), same +# update-persistent mechanism as the theme: read-only single-file mounts over +# the image's /app/backend/open_webui/static/* favicon files (app.html +# references all of them). Badge variants were tried and rejected by the +# operator 2026-11-14 — both sites use the plain ghost. +open_webui_favicon_dir: /var/lib/ghostnet-ai/production/openwebui-favicon +open_webui_favicon_mounts: + - host_file: favicon.png + container_path: /app/backend/open_webui/static/favicon.png + - host_file: favicon-96x96.png + container_path: /app/backend/open_webui/static/favicon-96x96.png + - host_file: favicon.svg + container_path: /app/backend/open_webui/static/favicon.svg + - host_file: favicon.ico + container_path: /app/backend/open_webui/static/favicon.ico + - host_file: apple-touch-icon.png + container_path: /app/backend/open_webui/static/apple-touch-icon.png + # OIDC phase (M6 public route via NPM + Keycloak). Disabled for the # internal phase; enable together with the Keycloak client # `gnai-openwebui` and the NPM proxy host chat.ghostnet.selfhost.eu. diff --git a/llm-server/llm/ansible/roles/open_webui/files/branding/apple-touch-icon.png b/llm-server/llm/ansible/roles/open_webui/files/favicon/apple-touch-icon.png similarity index 100% rename from llm-server/llm/ansible/roles/open_webui/files/branding/apple-touch-icon.png rename to llm-server/llm/ansible/roles/open_webui/files/favicon/apple-touch-icon.png diff --git a/llm-server/llm/ansible/roles/open_webui/files/branding/favicon-96x96.png b/llm-server/llm/ansible/roles/open_webui/files/favicon/favicon-96x96.png similarity index 100% rename from llm-server/llm/ansible/roles/open_webui/files/branding/favicon-96x96.png rename to llm-server/llm/ansible/roles/open_webui/files/favicon/favicon-96x96.png diff --git a/llm-server/llm/ansible/roles/open_webui/files/branding/favicon.ico b/llm-server/llm/ansible/roles/open_webui/files/favicon/favicon.ico similarity index 100% rename from llm-server/llm/ansible/roles/open_webui/files/branding/favicon.ico rename to llm-server/llm/ansible/roles/open_webui/files/favicon/favicon.ico diff --git a/llm-server/llm/ansible/roles/open_webui/files/branding/favicon.png b/llm-server/llm/ansible/roles/open_webui/files/favicon/favicon.png similarity index 100% rename from llm-server/llm/ansible/roles/open_webui/files/branding/favicon.png rename to llm-server/llm/ansible/roles/open_webui/files/favicon/favicon.png diff --git a/llm-server/llm/ansible/roles/open_webui/files/branding/favicon.svg b/llm-server/llm/ansible/roles/open_webui/files/favicon/favicon.svg similarity index 100% rename from llm-server/llm/ansible/roles/open_webui/files/branding/favicon.svg rename to llm-server/llm/ansible/roles/open_webui/files/favicon/favicon.svg diff --git a/llm-server/llm/ansible/roles/open_webui/files/branding/custom.css b/llm-server/llm/ansible/roles/open_webui/files/theme/gnai-catppuccin-mocha.css similarity index 100% rename from llm-server/llm/ansible/roles/open_webui/files/branding/custom.css rename to llm-server/llm/ansible/roles/open_webui/files/theme/gnai-catppuccin-mocha.css diff --git a/llm-server/llm/ansible/roles/open_webui/tasks/main.yml b/llm-server/llm/ansible/roles/open_webui/tasks/main.yml index 33f5fc0..47f6e83 100644 --- a/llm-server/llm/ansible/roles/open_webui/tasks/main.yml +++ b/llm-server/llm/ansible/roles/open_webui/tasks/main.yml @@ -52,6 +52,45 @@ group: "{{ open_webui_user }}" mode: "0750" +- name: Ensure the OpenWebUI theme directory exists + ansible.builtin.file: + path: "{{ open_webui_theme_dir }}" + state: directory + owner: "{{ open_webui_user }}" + group: "{{ open_webui_user }}" + mode: "0750" + +- name: Deploy the GNMON theme as custom.css (read-only mount target, survives image updates) + # Single-file bind mounts pin the inode at container creation; Ansible copy + # replaces the file (rename -> new inode), so a content change MUST restart + # the unit to re-bind the current file. Hence the notify. + ansible.builtin.copy: + src: "files/{{ open_webui_theme_src }}" + dest: "{{ open_webui_theme_dir }}/{{ open_webui_theme_file }}" + owner: "{{ open_webui_user }}" + group: "{{ open_webui_user }}" + mode: "0644" + notify: Restart OpenWebUI unit + +- name: Ensure the OpenWebUI favicon directory exists + ansible.builtin.file: + path: "{{ open_webui_favicon_dir }}" + state: directory + owner: "{{ open_webui_user }}" + group: "{{ open_webui_user }}" + mode: "0750" + +- name: Deploy the ghost favicon files (read-only mount targets, survive image updates) + # Same inode caveat as the theme: content changes notify a unit restart. + ansible.builtin.copy: + src: "files/favicon/{{ item.host_file }}" + dest: "{{ open_webui_favicon_dir }}/{{ item.host_file }}" + owner: "{{ open_webui_user }}" + group: "{{ open_webui_user }}" + mode: "0644" + loop: "{{ open_webui_favicon_mounts }}" + notify: Restart OpenWebUI unit + - name: Check whether the WebUI secret key already exists ansible.builtin.command: argv: @@ -452,29 +491,6 @@ failed_when: >- open_webui_pipe_hash.stdout.split()[0] != open_webui_deep_research_pipe_sha256 -- name: Ensure the branding directory exists - ansible.builtin.file: - path: "{{ open_webui_branding_dir }}" - state: directory - owner: "{{ open_webui_user }}" - group: "{{ open_webui_user }}" - mode: "0750" - -- name: Deploy the branding files (favicons + custom.css theme, GNAI-021) - # Read-only mounted into the image's static dir by the quadlet below. - # File replaces create a new inode, so a restart is required for the - # running container to pick up new content (GNAI-021 Inode-Befund). - ansible.builtin.copy: - src: "files/branding/{{ item }}" - dest: "{{ open_webui_branding_dir }}/{{ item }}" - owner: "{{ open_webui_user }}" - group: "{{ open_webui_user }}" - mode: "0644" - loop: "{{ open_webui_branding_files }}" - notify: - - Reload workload user manager - - Restart OpenWebUI unit - - name: Ensure the deep-research pipe exists, is active and publicly readable in OpenWebUI # Pipe functions (type='pipe') appear in the model selector with # id=function.id; non-admin users only see them when a row in the `model` @@ -589,6 +605,11 @@ path: /tmp/gnai-deep-research-pipe.py state: absent changed_when: false +- name: Flush handlers before the served checks + # Content changes to the ro-mounted files notify "Restart OpenWebUI unit"; + # the restart must happen BEFORE the served checks, otherwise they test the + # stale inode still bound by the running container. + ansible.builtin.meta: flush_handlers when: not ansible_check_mode - name: Wait for the OpenWebUI health endpoint @@ -602,6 +623,36 @@ until: open_webui_health.status == 200 when: not ansible_check_mode +- name: Verify the GNMON theme is served as /static/custom.css (non-empty, marker present) + # Guards the update-persistence contract: if a future OpenWebUI image stops + # referencing or serving custom.css, this fails instead of silently losing + # the theme. + ansible.builtin.uri: + url: "http://{{ open_webui_host_addr }}:{{ open_webui_host_port }}/static/custom.css" + status_code: 200 + timeout: 10 + return_content: true + register: open_webui_theme_served + failed_when: "'gnai-catppuccin-mocha' not in open_webui_theme_served.content" + when: not ansible_check_mode + +- name: Stat the deployed favicon for the served-size comparison + ansible.builtin.stat: + path: "{{ open_webui_favicon_dir }}/favicon.png" + register: open_webui_favicon_stat + when: not ansible_check_mode + +- name: Verify the ghost favicon is served as /static/favicon.png (byte-identical to the deployed file) + ansible.builtin.uri: + url: "http://{{ open_webui_host_addr }}:{{ open_webui_host_port }}/static/favicon.png" + status_code: 200 + timeout: 10 + register: open_webui_favicon_served + failed_when: >- + open_webui_favicon_served.content_length | int + != open_webui_favicon_stat.stat.size | int + when: not ansible_check_mode + - name: Verify the engine model list is reachable through OpenWebUI's network ansible.builtin.command: argv: diff --git a/llm-server/llm/ansible/roles/open_webui/templates/open-webui.container.j2 b/llm-server/llm/ansible/roles/open_webui/templates/open-webui.container.j2 index 8da212a..e744435 100644 --- a/llm-server/llm/ansible/roles/open_webui/templates/open-webui.container.j2 +++ b/llm-server/llm/ansible/roles/open_webui/templates/open-webui.container.j2 @@ -11,14 +11,19 @@ Network={{ open_webui_network_name }} Network={{ open_webui_egress_network_name }} PublishPort={{ open_webui_host_addr }}:{{ open_webui_host_port }}:{{ open_webui_container_port }} Volume={{ open_webui_data_dir }}:/app/backend/data:rw -# Branding: read-only file mounts into the image's static dir; OpenWebUI's -# start-wipe of static/ cannot touch ro mounts (GNAI-021). -{% for f in open_webui_branding_files %} -Volume={{ open_webui_branding_dir }}/{{ f }}:/app/backend/open_webui/static/{{ f }}:ro +# GNMON theme (GNAI-021): read-only single-file mount over the image's empty +# custom.css placeholder. Survives image updates — the mount lives host-side +# in this quadlet, and OpenWebUI's startup static re-copy cannot unlink or +# overwrite a read-only bind-mounted file. +Volume={{ open_webui_theme_dir }}/{{ open_webui_theme_file }}:{{ open_webui_theme_container_path }}:ro +# Favicon (GNAI-021): original ghost, same read-only single-file mount pattern +# over the image's static favicon files (app.html references all of them). +{% for m in open_webui_favicon_mounts %} +Volume={{ open_webui_favicon_dir }}/{{ m.host_file }}:{{ m.container_path }}:ro {% endfor %} -# v0.13.3 serves the root route /favicon.png from the frontend build dir, -# while index.html links /static/favicon.png (backend static, mounted above). -Volume={{ open_webui_branding_dir }}/favicon.png:/app/build/favicon.png:ro +# v0.13.3 root route /favicon.png is served from the frontend build dir +# (index.html links /static/* from the backend static mounted above). +Volume={{ open_webui_favicon_dir }}/favicon.png:/app/build/favicon.png:ro # Secrets are injected as environment variables, never written to disk or git. Secret={{ open_webui_webui_secret_key_secret }},type=env,target=WEBUI_SECRET_KEY Secret={{ open_webui_engine_api_key_secret }},type=env,target=OPENAI_API_KEY