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:
+8
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user