Enhance SwarmUI integration and GPU environment verification
- Updated CLI documentation to reflect the new handling of `CIVITAI_API_TOKEN`, which is now automatically passed to SwarmUI user settings during startup. - Improved the `render_access_panel` function to include additional warnings for idle-killer failures and stack errors, enhancing user feedback. - Introduced a new function `seed_swarmui_api_keys` to manage API key injection into SwarmUI, ensuring seamless integration with the Model Downloader. - Enhanced GPU environment verification logic to include fail-fast checks for critical components like CUDA, improving error handling and user notifications. - Updated tests to validate the new API key handling and access panel behavior, ensuring robustness in the integration process.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from gpu_rent.access_card import collect_access_links, mcp_snippet_lines
|
||||
from gpu_rent.access_card import collect_access_links, mcp_snippet_lines, render_access_panel
|
||||
|
||||
|
||||
class _Cfg:
|
||||
@@ -6,6 +6,7 @@ class _Cfg:
|
||||
llm_runtime = "ollama"
|
||||
ollama_local_port = 17811
|
||||
llamacpp_local_port = 17812
|
||||
enable_swarmui = True
|
||||
|
||||
|
||||
def test_collect_links_swarm_and_ollama(monkeypatch):
|
||||
@@ -29,3 +30,16 @@ def test_collect_links_no_tunnel():
|
||||
def test_mcp_snippet_json():
|
||||
lines = mcp_snippet_lines(_Cfg())
|
||||
assert any("17801/mcp" in line for line in lines)
|
||||
|
||||
|
||||
def test_access_panel_red_when_killer_failed(monkeypatch):
|
||||
monkeypatch.setattr(
|
||||
"gpu_rent.access_card.load_state",
|
||||
lambda: type(
|
||||
"S",
|
||||
(),
|
||||
{"notes": {"idle_killer": "failed", "idle_killer_error": "no cred"}},
|
||||
)(),
|
||||
)
|
||||
panel = render_access_panel(_Cfg(), tunneled=True)
|
||||
assert panel.border_style == "red"
|
||||
|
||||
Reference in New Issue
Block a user