feat: Authentik login + switchable GPU prod target
Add OIDC auth for Command Center and runtime GPU endpoint selection pointed at atc-gpu-prod (10.0.10.106), matching what is currently deployed.
This commit is contained in:
+28
-3
@@ -63,6 +63,18 @@ def build_workload_payload(snap: dict[str, Any]) -> dict[str, Any]:
|
||||
gpu = snap.get("gpu", {})
|
||||
objectscale = snap.get("objectscale", {})
|
||||
command = snap.get("command_center", {})
|
||||
try:
|
||||
from gpu_config import resolve_gpu_identity
|
||||
gpu_id = resolve_gpu_identity(gpu)
|
||||
except Exception:
|
||||
host = gpu.get("ip") or gpu.get("host") or "10.0.10.106"
|
||||
gpu_id = {
|
||||
"vm": "atc-gpu-prod",
|
||||
"ip": host,
|
||||
"ui_url": gpu.get("ui_url") or f"http://{host}:9000",
|
||||
"llm_url": gpu.get("vllm_url") or f"http://{host}:8001/v1",
|
||||
"vmid": 306,
|
||||
}
|
||||
|
||||
docker_apps = [_app_row(c) for c in docker.get("containers", [])]
|
||||
db_apps = [_app_row(c) for c in databases.get("containers", [])]
|
||||
@@ -221,6 +233,18 @@ def build_workload_payload(snap: dict[str, Any]) -> dict[str, Any]:
|
||||
}
|
||||
if extra:
|
||||
row.update(extra)
|
||||
if nid == "gpu":
|
||||
row["vm"] = gpu_id["vm"]
|
||||
row["ip"] = gpu_id["ip"]
|
||||
row["vmid"] = gpu_id.get("vmid", row.get("vmid"))
|
||||
row["links"] = [
|
||||
{"label": "GPU Lab UI", "url": gpu_id["ui_url"]},
|
||||
{"label": "vLLM API", "url": gpu_id["llm_url"]},
|
||||
]
|
||||
row["endpoints"] = [
|
||||
{"name": "gpu-lab", "host": gpu_id["ip"], "port": "9000", "proto": "http"},
|
||||
{"name": "vllm", "host": gpu_id["ip"], "port": "8001", "proto": "http"},
|
||||
]
|
||||
return row
|
||||
|
||||
connect_running = 1 if connect_app and connect_app.get("state") == "running" else 0
|
||||
@@ -247,10 +271,11 @@ def build_workload_payload(snap: dict[str, Any]) -> dict[str, Any]:
|
||||
_node("hadoop", "Hadoop HDFS", "atc-hadoop-m01", "10.0.21.61", 50, 52, "#39ff14", "ok" if hdfs_ok else "warn", "parallel",
|
||||
zones[-1]["apps"], hadoop.get("live_datanodes", 0), zones[-1]["total"],
|
||||
{"hdfs_used_gb": hadoop.get("capacity_used_gb"), "hdfs_total_gb": hadoop.get("capacity_total_gb")}),
|
||||
_node("gpu", "GPU Lab", "atc-gpu-dev", "10.0.20.106", 88, 52, "#76b900", "ok" if gpu.get("ok") else "down", "inference",
|
||||
[{"name": gpu.get("active_model") or "vLLM", "state": "running" if gpu.get("inference_active") else "down", "image": "vllm", "ports": ["8001"]}],
|
||||
_node("gpu", "GPU Lab", gpu_id["vm"], gpu_id["ip"], 88, 52, "#76b900", "ok" if gpu.get("ok") else "down", "inference",
|
||||
[{"name": gpu.get("active_model") or "vLLM", "state": "running" if gpu.get("inference_active") else "down", "image": "vllm", "ports": ["8001", "9000"]}],
|
||||
gpu.get("gpu_count", 0), gpu.get("gpu_count", 0) or 4,
|
||||
{"model": gpu.get("active_model"), "util": round(sum(g.get("util_gpu", 0) for g in gpu.get("gpus", [])) / max(len(gpu.get("gpus", [])), 1), 1)}),
|
||||
{"model": gpu.get("active_model"), "util": round(sum(g.get("util_gpu", 0) for g in gpu.get("gpus", [])) / max(len(gpu.get("gpus", [])), 1), 1),
|
||||
"ui_url": gpu_id["ui_url"], "vllm_url": gpu_id["llm_url"]}),
|
||||
_node("command", "Command Center", "MCP · VM304", "10.0.21.33", 50, 78, "#00f0ff",
|
||||
_level(command.get("running", 0), command.get("total", 1) or 1), "hub",
|
||||
command.get("containers") and [_app_row(c) for c in command.get("containers", [])] or [
|
||||
|
||||
Reference in New Issue
Block a user