From 54d38a31aa4a6096c055058e496465af21209bb5 Mon Sep 17 00:00:00 2001 From: Mikei386 <44135113+Mikei386@users.noreply.github.com> Date: Tue, 15 Sep 2026 11:30:57 +0200 Subject: [PATCH] Keep router connected to profile controller --- compose.yaml | 4 ++++ smoke-test.sh | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/compose.yaml b/compose.yaml index 5cf5ec3..195911b 100644 --- a/compose.yaml +++ b/compose.yaml @@ -530,6 +530,10 @@ services: ROUTER_STATE_FILE: /var/lib/mike-ai-profile-router/state.json ROUTER_MAX_CONCURRENT_REQUESTS: "16" UPSTREAM_URL: http://llama-upstream:8080 + # Profile are switched by the privileged controller. The router itself + # stays unprivileged and never manipulates Docker or host files directly. + PROFILE_CONTROL_URL: http://profile-controller:8090 + PROFILE_CONTROL_TOKEN: "${CONTROLLER_TOKEN:?CONTROLLER_TOKEN is required}" SWITCH_TIMEOUT: "600" REQUEST_TIMEOUT: "600" YUE2_START_TIMEOUT: "600" diff --git a/smoke-test.sh b/smoke-test.sh index 018fedf..86e109f 100755 --- a/smoke-test.sh +++ b/smoke-test.sh @@ -73,7 +73,7 @@ import os import urllib.request key = os.environ["ROUTER_API_KEY"] -for path in ("/health", "/v1/models"): +for path in ("/health", "/v1/models", "/status"): request = urllib.request.Request( "http://127.0.0.1:8081" + path, headers={"Authorization": "Bearer " + key}, @@ -82,10 +82,16 @@ for path in ("/health", "/v1/models"): body = response.read() if response.status != 200: raise SystemExit(f"{path}: HTTP {response.status}") - if path.endswith("models") and not json.loads(body).get("data"): + data = json.loads(body) + if path.endswith("models") and not data.get("data"): raise SystemExit("Router meldet keine Modelle") + if path == "/status": + if data.get("current_profile") not in data.get("profiles", {}): + raise SystemExit("Router erkennt das aktive Profil nicht") + if not data.get("qwen", {}).get("available"): + raise SystemExit("Router meldet Qwen als nicht verfügbar") PY -pass "Router-Liveness und OpenAI-Modellliste funktionieren" +pass "Router erkennt aktives Profil; Liveness und Modellliste funktionieren" latest=/data/docker-backups/athena-latest.tar.gz [[ -s $latest ]] || fail "Kein gueltiges Athena-Backup: $latest"