Refactor access card handling and update CLI output for tunnel operations

- Integrated `print_access_card` functionality into the `up` command for both tunneled and non-tunneled scenarios.
- Removed the deprecated `print_mcp_snippet` function from the session management flow.
- Updated the `tunnel_forwards` function to streamline port handling for LLM runtimes.
- Enhanced test cases to reflect changes in access card printing and MCP snippet logging.
This commit is contained in:
Leonid Pershin
2026-08-21 05:34:09 +03:00
parent 2005b00175
commit 82e36129cd
8 changed files with 258 additions and 56 deletions
+8 -4
View File
@@ -456,20 +456,24 @@ def up(
log=lambda m: console.print(m),
)
if no_tunnel:
from gpu_rent.access_card import print_access_card
console.print(
f"[bold]готово[/bold] (без туннеля). "
f"UI: gpu-rent tunnel --open | stop: gpu-rent stop"
)
if state.floating_ip:
console.print(f"FIP {state.floating_ip}")
print_access_card(
cfg,
tunneled=False,
host=state.floating_ip,
console=console,
)
return
if not state.floating_ip:
raise GpuRentError("нет floating IP после up — туннель не открыть")
console.print(
f"[bold]панель[/bold] http://127.0.0.1:{cfg.swarmui_local_port} "
"(Ctrl+C = закрыть туннель, GPU жив → gpu-rent stop)"
)
run_tunnel(
cfg,
state.floating_ip,