Add read-only Debug API support and update documentation
- Introduced a local read-only Debug API accessible at `http://127.0.0.1:17821` for diagnostics and agent interactions. - Updated CLI commands to include `gpu-rent debug` for launching the Debug API. - Enhanced documentation to reflect the new Debug API features and usage. - Modified configuration to include `DEBUG_LOCAL_PORT` for easier customization. - Added tests to ensure Debug API links are correctly generated in access card outputs.
This commit is contained in:
@@ -5,11 +5,13 @@
|
||||
```
|
||||
┌─ локальная машина (Windows / Linux) ─────────────────────────┐
|
||||
│ gpu-rent CLI │
|
||||
│ up / stop / status / doctor / hold │
|
||||
│ up / stop / status / doctor / hold / debug │
|
||||
│ tunnel / open — SSH localhost:17801 → VM :7801 │
|
||||
│ Debug API (read-only) — http://127.0.0.1:17821 │
|
||||
│ state <repo>/.gpu-rent/state.json │
|
||||
│ │
|
||||
│ браузер / MCP / curl API → http://127.0.0.1:17801 │
|
||||
│ агент / curl debug → http://127.0.0.1:17821/snapshot │
|
||||
│ локальный SwarmUI → http://127.0.0.1:7801 (не трогаем)
|
||||
└───────────────────────────────┬──────────────────────────────┘
|
||||
│ SSH :22 и OpenStack API
|
||||
@@ -48,6 +50,7 @@
|
||||
| `sync_files` | SFTP `Models` / Wildcards / workflows / Output |
|
||||
| `notify` | Toast/звук при backend Idle |
|
||||
| `tunnel` | sshtunnel + Nova EXPIRED watchdog |
|
||||
| `debug_api` / `debug_checks` | localhost read-only HTTP sidecar (`:17821`) для агента |
|
||||
| `local_watchdog` | Опциональный локальный тик → stop при unclean exit |
|
||||
| `llm_runtime` / `setup_wizard` | Opt-in Ollama + `ollama-models.yaml` |
|
||||
| `idle_killer` / `hold` | systemd на VM + hold-файл |
|
||||
|
||||
+19
@@ -68,6 +68,8 @@ gpu-rent up --yes --ollama
|
||||
| `gpu-rent tunnel` / `tunnel --open` | Повторный проброс; `--open` сразу браузер. **Ctrl+C / Ctrl+D** вызывают `stop` |
|
||||
| `gpu-rent open` / `open --llm` | Браузер на SwarmUI / LLM-порт (туннель уже должен слушать) |
|
||||
| `gpu-rent status` | State, Nova, диск, killer/hold, LLM, local-watchdog |
|
||||
| `gpu-rent diag` | SwarmUI/Comfy diagnostics с VM (API + journal + paths) |
|
||||
| `gpu-rent debug` | Локальный read-only Debug API (`:17821`) — для агента после `--no-tunnel` / без активного `up` |
|
||||
| `gpu-rent hold` / `--minutes N` / `--until ISO` / `--clear` | Пауза idle-killer (нужны живая VM + SSH) |
|
||||
| `gpu-rent stop` / `stop --no-pull` | Удалить compute (+ FIP), диски оставить; optional pull Output |
|
||||
| `gpu-rent destroy --i-understand-data-loss` | `stop` + диски |
|
||||
@@ -120,6 +122,22 @@ Exit 0 → можно `up`. Exit 1 → причина в таблице / кра
|
||||
|
||||
---
|
||||
|
||||
## Debug API (localhost)
|
||||
|
||||
На `gpu-rent up` и `gpu-rent tunnel` CLI поднимает **read-only** HTTP sidecar на `127.0.0.1:17821` (`DEBUG_LOCAL_PORT`). Ссылка печатается сразу и на access card.
|
||||
|
||||
Агент: `GET /openapi.json` → `GET /snapshot` → точечные пути (`/progress`, `/events?since=`, `/checks`, `/logs`, `/diag`, `/gpu`, `/swarm`, `/ollama`, `/assistent`). Пока SSH нет — VM-эндпоинты отвечают `ssh_unavailable`; прогресс установщика всё равно виден в `/progress` и `/events`.
|
||||
|
||||
После `up --no-tunnel` процесс завершается и sidecar гаснет — держи отдельно:
|
||||
|
||||
```text
|
||||
gpu-rent debug
|
||||
```
|
||||
|
||||
Мутаций нет (restart/hold/stop — как раньше через CLI).
|
||||
|
||||
---
|
||||
|
||||
## Local watchdog (опционально)
|
||||
|
||||
Основной авто-stop — **idle-killer на VM** (ноут можно закрыть). Local watchdog — если хочешь гасить GPU при «убили окно / ребут» без `stop`.
|
||||
@@ -194,6 +212,7 @@ AUTOCOMPLETE_ENABLED=true
|
||||
SWARMUI_LOCAL_PORT=17801
|
||||
LLM_RUNTIME=none
|
||||
OLLAMA_LOCAL_PORT=17811
|
||||
DEBUG_LOCAL_PORT=17821
|
||||
UPDATE_GIT=true
|
||||
|
||||
DEFAULT_FLAVOR_ID=
|
||||
|
||||
Reference in New Issue
Block a user