Update README and CLI documentation for tunnel functionality
- Enhanced README.md to clarify the `gpu-rent up` command, including default tunnel behavior and options for cloud-only operation. - Updated cli.md to reflect changes in the `gpu-rent up` command, detailing the new `--no-tunnel` option and its implications. - Revised decisions.md to explain the separation of `up` and `tunnel` commands, emphasizing the default tunnel opening after `up`. - Improved doctor.py to provide clearer instructions regarding tunnel creation and cloud-only usage. - Adjusted notify.py to reflect the updated command usage for accessing the SwarmUI.
This commit is contained in:
+34
-2
@@ -75,6 +75,7 @@ def _print_checks(checks) -> int:
|
||||
_print_next_steps(failed)
|
||||
return 1
|
||||
console.print("\n[green]Можно идти дальше.[/green] Дальше: gpu-rent up --yes")
|
||||
console.print(" (туннель :17801 по умолчанию; только облако: --no-tunnel)")
|
||||
console.print("Чеклист spike: docs/spike-notes.md")
|
||||
return 0
|
||||
|
||||
@@ -290,8 +291,18 @@ def up(
|
||||
flavor: Optional[str] = typer.Option(None, "--flavor", help="Flavor id, без фоллбека"),
|
||||
yes: bool = typer.Option(False, "--yes", help="Без вопросов"),
|
||||
adopt: bool = typer.Option(False, "--adopt", help="Подхватить тег gpu-rent без state"),
|
||||
no_tunnel: bool = typer.Option(
|
||||
False,
|
||||
"--no-tunnel",
|
||||
help="Только облако + bootstrap, без локального туннеля",
|
||||
),
|
||||
open_browser: bool = typer.Option(
|
||||
True,
|
||||
"--open/--no-open",
|
||||
help="После туннеля открыть браузер на 17801 (по умолчанию да)",
|
||||
),
|
||||
) -> None:
|
||||
"""Create/unshelve GPU и bootstrap SwarmUI (без Docker)."""
|
||||
"""Create/unshelve GPU, bootstrap SwarmUI, по умолчанию туннель на :17801."""
|
||||
try:
|
||||
checks = run_doctor()
|
||||
code = _print_checks(checks)
|
||||
@@ -302,7 +313,7 @@ def up(
|
||||
def confirm(msg: str) -> bool:
|
||||
return typer.confirm(msg)
|
||||
|
||||
cmd_up(
|
||||
state = cmd_up(
|
||||
cfg,
|
||||
no_spot=no_spot,
|
||||
flavor=flavor,
|
||||
@@ -311,6 +322,27 @@ def up(
|
||||
confirm=confirm,
|
||||
log=lambda m: console.print(m),
|
||||
)
|
||||
if no_tunnel:
|
||||
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}")
|
||||
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,
|
||||
open_browser=open_browser,
|
||||
log=lambda m: console.print(m),
|
||||
)
|
||||
except GpuRentError as exc:
|
||||
_die(exc)
|
||||
|
||||
|
||||
@@ -363,8 +363,8 @@ def dry_run_plan(checks: list[Check]) -> list[str]:
|
||||
f"idle-killer: {cfg.idle_minutes} мин пустой очереди, льгота {cfg.idle_grace_minutes} мин",
|
||||
"₽: в API нет — смотри панель; диск 24/7 даже после stop",
|
||||
f"туннель: localhost:{cfg.swarmui_local_port} -> VM :7801",
|
||||
"gpu-rent up --yes создаст сеть/диски/compute и поставит SwarmUI (если doctor зелёный и квота GPU > 0)",
|
||||
"после up: gpu-rent tunnel (Ctrl+C не гасит GPU)",
|
||||
"gpu-rent up --yes создаст GPU + SwarmUI и откроет туннель :17801 (Ctrl+C не гасит GPU)",
|
||||
"только облако без туннеля: gpu-rent up --yes --no-tunnel",
|
||||
]
|
||||
flavor = next((c.detail for c in checks if c.name == "flavor" and c.ok), None)
|
||||
if flavor:
|
||||
|
||||
@@ -74,7 +74,7 @@ def print_mcp_snippet(cfg: Config, log: Log) -> None:
|
||||
log("}")
|
||||
log("")
|
||||
log(f"SwarmUI на VM: 127.0.0.1:7801 (только через туннель)")
|
||||
log(f"Локально: gpu-rent tunnel")
|
||||
log(f"Локально: уже в up (или gpu-rent tunnel)")
|
||||
log(f"Браузер: gpu-rent open → http://127.0.0.1:{port}")
|
||||
log(f"API: http://127.0.0.1:{port}/API/")
|
||||
log(f"MCP: http://127.0.0.1:{port}/mcp")
|
||||
|
||||
Reference in New Issue
Block a user