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
+11 -5
View File
@@ -7,6 +7,7 @@ import pytest
from gpu_rent.vm_logs import (
DIGEST_LINES,
KILLER_UNIT,
OLLAMA_UNIT,
build_logs_remote_cmd,
fetch_unit_logs,
resolve_unit_alias,
@@ -23,7 +24,7 @@ class _Cfg:
def test_units_for_swarm_and_ollama():
assert units_for(_Cfg(enable_swarmui=True, llm_runtime="ollama")) == [
"swarmui",
"ollama",
OLLAMA_UNIT,
KILLER_UNIT,
]
@@ -37,7 +38,7 @@ def test_units_for_swarm_only():
def test_units_for_llm_only():
assert units_for(_Cfg(enable_swarmui=False, llm_runtime="ollama")) == [
"ollama",
OLLAMA_UNIT,
KILLER_UNIT,
]
@@ -51,7 +52,9 @@ def test_digest_cmd_has_journal_no_cloud_init():
)
assert "cloud-init" not in cmd
assert "journalctl -u swarmui" in cmd
assert "journalctl -u ollama" in cmd
assert f"journalctl -u {OLLAMA_UNIT}" in cmd
# Stock ollama.service is disabled — digest must not query bare unit name
assert "journalctl -u ollama -n" not in cmd
assert f"journalctl -u {KILLER_UNIT}" in cmd
assert f"-n {DIGEST_LINES}" in cmd
assert "systemctl is-active swarmui" in cmd
@@ -61,15 +64,18 @@ def test_full_logs_cmd_includes_cloud_init():
cmd = build_logs_remote_cmd(
lines=80,
include_cloud_init=True,
journal_units=["swarmui", "ollama", KILLER_UNIT],
journal_units=["swarmui", OLLAMA_UNIT, KILLER_UNIT],
)
assert "cloud-init-output.log" in cmd
assert "journalctl -u swarmui" in cmd
assert f"journalctl -u {OLLAMA_UNIT}" in cmd
def test_resolve_unit_alias():
assert resolve_unit_alias(None) == "all"
assert resolve_unit_alias("swarm") == "swarmui"
assert resolve_unit_alias("ollama") == OLLAMA_UNIT
assert resolve_unit_alias("gpu-rent-ollama") == OLLAMA_UNIT
assert resolve_unit_alias("killer") == KILLER_UNIT
with pytest.raises(ValueError, match="неизвестный"):
resolve_unit_alias("bogus")
@@ -90,4 +96,4 @@ def test_fetch_unit_logs_uses_ssh(monkeypatch):
assert "cloud-init" not in calls[0][1]
assert "journalctl -u swarmui" in calls[0][1]
assert f"journalctl -u {KILLER_UNIT}" in calls[0][1]
assert "journalctl -u ollama" not in calls[0][1]
assert f"journalctl -u {OLLAMA_UNIT}" not in calls[0][1]