Keep router connected to profile controller
This commit is contained in:
@@ -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"
|
||||
|
||||
+9
-3
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user