Add package data for GPU rent and update CLI documentation

- Added package data configuration for the 'gpu_rent' package in pyproject.toml.
- Updated README.md to include usage instructions for Windows and Unix launchers.
- Enhanced CLI documentation in cli.md to reflect new commands and their functionalities.
- Revised setup.md to clarify installation steps and environment setup.
- Improved error handling and command descriptions in the CLI implementation.
- Added new functions for model version handling and flavor resolution in the codebase.
- Updated state management to include additional properties for better tracking.
This commit is contained in:
Leonid Pershin
2026-08-21 03:06:51 +03:00
parent 167d07a733
commit 615cf81493
34 changed files with 2733 additions and 117 deletions
+33
View File
@@ -0,0 +1,33 @@
"""Upload and run the idempotent SwarmUI bootstrap on the VM."""
from __future__ import annotations
from collections.abc import Callable
from importlib.resources import files
from gpu_rent.config import Config
from gpu_rent.errors import CloudError
from gpu_rent.ssh_ops import run_script_sudo
Log = Callable[[str], None]
def bootstrap_script() -> str:
return files("gpu_rent.remote").joinpath("bootstrap.sh").read_text(encoding="utf-8")
def run_bootstrap(cfg: Config, host: str, log: Log) -> None:
log("bootstrap SwarmUI на VM (идемпотентно, без Docker)")
script = bootstrap_script()
out = run_script_sudo(
cfg,
host,
script,
remote_path="/tmp/gpu-rent-bootstrap.sh",
timeout=1800,
env={"SWARM_USER": cfg.ssh_user},
log=log,
)
if "bootstrap ok" not in out:
raise CloudError(f"bootstrap не подтвердил успех:\n{out[-800:]}")
log("диски и systemd unit готовы; дальше seed, потом start swarmui")