Add stack Update, ComfyUI model manager, and slim ComfyUI stack.
Server UI gains Update on stack cards, ComfyUI Models tab with workflow scan and downloads, and centralized comfyui_config. Model catalog and download scripts move from stacks/comfyui to server-ui so ComfyUI stays a minimal Docker wrapper for easier image updates.
This commit is contained in:
@@ -87,6 +87,44 @@ def control_plane_env_paths(stack_dir: Path) -> list[Path]:
|
||||
return paths
|
||||
|
||||
|
||||
def _has_stack_compose(repo_root: Path) -> bool:
|
||||
stacks = repo_root / "stacks"
|
||||
if not stacks.is_dir():
|
||||
return False
|
||||
for name in ("compose.yaml", "docker-compose.yml", "docker-compose.yaml"):
|
||||
if (stacks / "localai" / name).is_file():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def _production_repo_root_candidates() -> list[Path]:
|
||||
home = Path.home()
|
||||
return [
|
||||
home / "cursor" / "ubuntu-bare-metal",
|
||||
Path("/data/apps/ubuntu-bare-metal"),
|
||||
Path("/repo"),
|
||||
home / "ubuntu-bare-metal",
|
||||
]
|
||||
|
||||
|
||||
def resolve_repo_root(stack_dir: Path, env: dict[str, str]) -> Path:
|
||||
"""Resolve ubuntu-bare-metal repo root for compose stack paths."""
|
||||
for key in ("REPO_ROOT",):
|
||||
raw = (env.get(key) or os.environ.get(key) or "").strip()
|
||||
if raw:
|
||||
candidate = Path(raw).expanduser().resolve()
|
||||
if _has_stack_compose(candidate):
|
||||
return candidate
|
||||
|
||||
if _is_production_stack_dir(stack_dir):
|
||||
for candidate in _production_repo_root_candidates():
|
||||
resolved = candidate.expanduser().resolve()
|
||||
if _has_stack_compose(resolved):
|
||||
return resolved
|
||||
|
||||
return (stack_dir.parent.parent).resolve()
|
||||
|
||||
|
||||
def api_key_source(stack_dir: Path, values: dict[str, str]) -> str:
|
||||
"""Human-readable hint for logs (no secret values)."""
|
||||
if os.environ.get("API_KEY"):
|
||||
|
||||
Reference in New Issue
Block a user