Point gpu-rent logs at gpu-rent-ollama and harden Assistent bin probes.

Stock ollama.service is disabled by install; journal aliases must use
gpu-rent-ollama. Prefer bin/{Debug,Release}/net* when locating the
extension DLL and Sqlite private deps.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-23 06:46:57 +03:00
co-authored by Cursor
parent ca11467a0d
commit 23b07672d6
4 changed files with 46 additions and 20 deletions
+15 -4
View File
@@ -30,10 +30,18 @@ for root in roots:
for p in sorted(root.iterdir()):
if "assistent" not in p.name.lower():
continue
dlls = sorted(p.glob("bin/**/SwarmAssistentExtension.dll"))
# Prefer TFM output dirs (Debug/Release net*), then any bin/** fallback
dlls = []
for cfg_name in ("Debug", "Release"):
dlls.extend(sorted(p.glob(f"bin/{cfg_name}/net*/SwarmAssistentExtension.dll")))
if not dlls:
dlls = sorted(p.glob("bin/**/SwarmAssistentExtension.dll"))
if not dlls:
# Older layout / alternate assembly name
dlls = sorted(p.glob("bin/**/*Assistent*.dll"))
for cfg_name in ("Debug", "Release"):
dlls.extend(sorted(p.glob(f"bin/{cfg_name}/net*/*Assistent*.dll")))
if not dlls:
dlls = sorted(p.glob("bin/**/*Assistent*.dll"))
dll = dlls[0] if dlls else None
dll_dir = dll.parent if dll else None
sqlite_dll = (dll_dir / "Microsoft.Data.Sqlite.dll") if dll_dir else None
@@ -335,9 +343,12 @@ def collect_assistent_extension(cfg: Config, *, fs: dict[str, Any] | None = None
hints.append(f"{e.get('name')}: нет DLL — compile fail / Swarm не билдил")
ok = False
elif not e.get("sqlite_dll"):
where = e.get("dll_dir") or "bin/{Debug,Release}/net*"
hints.append(
f"{e.get('name')}: DLL есть, но нет Microsoft.Data.Sqlite.dll — "
"чат/memory API могут падать (нужен ≥0.13.1 + seed-extensions)"
f"{e.get('name')}: DLL есть ({where}), но рядом нет "
"Microsoft.Data.Sqlite.dll (+ SQLitePCLRaw*) — чат/memory API упадут. "
"Нужен swarm-assistent ≥0.13.1 (CopyLocalLockFileAssemblies) + "
"gpu-rent seed-extensions + restart SwarmUI"
)
ok = False
if not e.get("tab_html") or not e.get("bundle_js"):
+8 -2
View File
@@ -237,7 +237,11 @@ for root in roots:
for p in sorted(root.iterdir()):
if "assistent" not in p.name.lower():
continue
dlls = sorted(p.glob("bin/**/SwarmAssistentExtension.dll"))
dlls = []
for cfg_name in ("Debug", "Release"):
dlls.extend(sorted(p.glob(f"bin/{cfg_name}/net*/SwarmAssistentExtension.dll")))
if not dlls:
dlls = sorted(p.glob("bin/**/SwarmAssistentExtension.dll"))
dll = dlls[0] if dlls else None
dll_dir = dll.parent if dll else None
sqlite = (dll_dir / "Microsoft.Data.Sqlite.dll") if dll_dir else None
@@ -246,6 +250,7 @@ for root in roots:
"path": str(p),
"name": p.name,
"dll": str(dll) if dll else None,
"dll_dir": str(dll_dir) if dll_dir else None,
"sqlite_dll": bool(sqlite and sqlite.is_file()),
"sqlitepcl": bool(pcl),
})
@@ -330,8 +335,9 @@ def verify_assistent_sqlite_bins(cfg: Config, host: str, log: Log) -> bool:
log(f"Assistent {name}: Microsoft.Data.Sqlite есть (SQLitePCLRaw не найден)")
ok_any = True
else:
where = row.get("dll_dir") or "bin/{Debug,Release}/net*"
log(
f"⚠ Assistent {name}: DLL есть, но нет Microsoft.Data.Sqlite.dll — "
f"⚠ Assistent {name}: DLL в {where}, но нет Microsoft.Data.Sqlite.dll — "
"чат/memory API упадут. Нужен ≥0.13.1 + seed-extensions + restart"
)
return ok_any
+12 -9
View File
@@ -13,20 +13,23 @@ Log = Callable[[str], None]
DIGEST_LINES = 20
FULL_LINES_DEFAULT = 80
# Stock `ollama.service` is disabled by install_ollama.sh; we run gpu-rent-ollama.
OLLAMA_UNIT = "gpu-rent-ollama"
KILLER_UNIT = "gpu-rent-idle-killer"
UNIT_ALIASES: dict[str, str] = {
"all": "all",
"swarm": "swarmui",
"swarmui": "swarmui",
"ollama": "ollama",
"killer": "gpu-rent-idle-killer",
"idle-killer": "gpu-rent-idle-killer",
"idle": "gpu-rent-idle-killer",
"ollama": OLLAMA_UNIT,
"gpu-rent-ollama": OLLAMA_UNIT,
"killer": KILLER_UNIT,
"idle-killer": KILLER_UNIT,
"idle": KILLER_UNIT,
"cloud-init": "cloud-init",
"cloud": "cloud-init",
}
KILLER_UNIT = "gpu-rent-idle-killer"
def units_for(cfg: Config) -> list[str]:
"""Journal units enabled for this stack (no cloud-init)."""
@@ -34,7 +37,7 @@ def units_for(cfg: Config) -> list[str]:
if bool(getattr(cfg, "enable_swarmui", True)):
units.append("swarmui")
if normalize_runtime(getattr(cfg, "llm_runtime", "none")) == "ollama":
units.append("ollama")
units.append(OLLAMA_UNIT)
units.append(KILLER_UNIT)
return units
@@ -81,7 +84,7 @@ def journal_units_for_target(target: str, *, cfg: Config | None = None) -> list[
if target == "all":
if cfg is not None:
return units_for(cfg)
return ["swarmui", "ollama", KILLER_UNIT]
return ["swarmui", OLLAMA_UNIT, KILLER_UNIT]
return [target]
@@ -115,7 +118,7 @@ def fetch_logs_for_cli(
target = resolve_unit_alias(unit)
# Full dump keeps historical all=swarm+ollama+killer regardless of cfg.
if target == "all":
journal_units = ["swarmui", "ollama", KILLER_UNIT]
journal_units = ["swarmui", OLLAMA_UNIT, KILLER_UNIT]
else:
journal_units = journal_units_for_target(target)
cmd = build_logs_remote_cmd(