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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user