- Added `ollama-models.yaml` to .gitignore and implemented logic to copy it in gpu-rent.ps1 and gpu-rent.sh. - Enhanced env.example to include new variables for LLM runtime options and local watchdog configuration. - Updated CLI commands to support LLM options during setup and execution, including new flags for Ollama and llama.cpp. - Improved documentation in cli.md and README.md to reflect changes in LLM integration and local watchdog functionality. - Adjusted architecture and decisions documentation to clarify the role of LLMs and local watchdog in the system.
5.9 KiB
5.9 KiB
Project Review — 2026-08-21 (1)
Prior Reviews Summary
Based on the last 3 review files analysed in Phase 0.
Still Open (carried forward)
None.
Resolved Since Last Review
None.
Phase 1: Code Quality
SOLID
session.cmd_up/_bind_accessorchestrate cloud, SSH, bootstrap, provision, snapshot, notify — god-flow (src/gpu_rent/session.py).- Docs name separate modules (
civitai_seed,models_push,git_seed,watchdog,reconcile) that do not exist as packages; logic is folded intoprovision.py,sync_files.py,tunnel.py,cli.status. Configdataclass is a wide bag of unrelated settings (auth, paths, idle, autocomplete, civitai).
Performance
push_tree/pull_tree: per-fileremote_sha256+put_fileeach open a new SSH (sync_files.py,ssh_ops.py).- Every
upre-runs fullbootstrap.sh(apt-get) via_bind_accesseven when already bootstrapped. scan_poolson everyup: extra Keystone authorize + per-flavor HTTP extra_specs (ThreadPool 16).- Tunnel watchdog:
connect()/ Keystone authorize every ~30s.
Correctness & Bugs
wait_sshaborts after 3AuthenticationExceptions (~15s) while cloud-init may still be injecting keys (ssh_ops.py~114–120).cmd_stopleavesbootstrapped=True(session.py~397–400) → next ACTIVE path mis-labeled / wrong branch when FIP cleared.phaseset toready_cloudbefore bootstrap finishes (session.py~344–346).- Application credential created without role/access_rules restriction (
idle_killer.py~52–57) vs architecture “delete/shelve only”. GIT_TOKENembedded in git remote URL and never stripped (clone_ext.pywith_token/ clone).- SG rules accumulate old CIDRs; never prune (
cloud.pyensure_security_group). - Session tests out of sync: no
bootstrapped+FIP setup for “second GPU”;run_bootstrapmock missingupdate=(tests/test_session.py).
Code Quality
- State machine phases in docs (
bootstrapping,seeding_*,waiting_ui) never written by code (onlyidle/provisioning/ready_*). os_client.connectreportsapp_version="0.1.0"while package is0.2.0.- Duplicated SwarmUI busy/Idle polling logic in
ready.pyandremote/idle_killer.py.
Phase 2: Logical Consistency
Domain & Application Layer
- Architecture table invents module names; actual layout is flatter (
cli→session/doctor/tunnel→cloud/provision/ssh_ops).
Data Flow
- Config sources:
.env(dotenv override=False) thengpu-rent.vars(override empty only) — OK. - Volume IDs:
statepreferred overBOOT_VOLUME_ID/DATA_VOLUME_IDenv — OK; AZ not re-validated on reuse.
State Management
bootstrappednot cleared onstop.bootstrappedTrue only at end of_bind_access; failure mid-bind leavesready_cloud+bootstrapped=False.- Marker files on VM (
/opt/swarmui/.gpu-rent-bootstrapped) independent of localstate.bootstrapped.
Consistency
- Error handling: mostly
GpuRentError/CloudError; some soft-log (wait_backend_idle, snapshot, idle-killer arm). - Civitai bad token is blocking in doctor → blocks
upeven if user only needs default SwarmUI models.
Phase 3: UI/UX (CLI)
Usability
upalways prints full doctor table (noisy).- Invalid/expired
CIVITAI_API_TOKENblocks entire session start. destroyhas no--no-pull(always respectsPULL_OUTPUTviacmd_stop).
Visual & Consistency
- N/A (CLI). Mixed RU/EN messages by design.
Interaction & Feedback
- Confirm on
upwithout--yesis good;--yesskips. - Tunnel Ctrl+C messaging is clear.
logsonly tails cloud-init +is-active, notjournalctl -u swarmuias docs imply.
Accessibility
- N/A.
Full exploration notes (sections 1–10)
See chat report for narrative. Tasks below are actionable.
Tasks
- 1. [Bug] Soften
wait_sshearly auth abort (retry until timeout / distinguish “sshd up, keys not ready”) —src/gpu_rent/ssh_ops.pyline 114 - 2. [Bug] Clear
bootstrapped=False(and align phase) incmd_stop—src/gpu_rent/session.pyline 397 - 3. [Security] Restrict idle-killer application credential (access_rules / roles delete-only) —
src/gpu_rent/idle_killer.pyline 52 - 4. [Security] Strip
GIT_TOKENfrom gitoriginafter clone/fetch —src/gpu_rent/remote/clone_ext.pyline 30 - 5. [Security] Stop accumulating stale SSH SG CIDRs; replace or prune old /32 —
src/gpu_rent/cloud.pyline 154 - 6. [Security] Revisit default
GPU_RENT_SSH_CIDR=0.0.0.0/0inenv.example—env.exampleline 16 - 7. [Performance] Reuse one SSH/SFTP session in
push_tree/pull_tree/ hash checks —src/gpu_rent/sync_files.pyline 15 - 8. [Performance] Skip full bootstrap (or apt) when VM already marked bootstrapped —
src/gpu_rent/session.pyline 87 - 9. [Logic] Do not set
phase=ready_cloudbefore_bind_accesssucceeds —src/gpu_rent/session.pyline 344 - 10. [Logic] Make doctor Civitai failure non-blocking when seed is optional —
src/gpu_rent/doctor.pyline 271 - 11. [CodeQuality] Fix
tests/test_session.pymocks (bootstrapped+FIP;run_bootstrap(..., update=)) —tests/test_session.pyline 40 - 12. [UX]
logsshould includejournalctl -u swarmuias docs claim —src/gpu_rent/cli.pyline 404 - 13. [Logic] Update
docs/architecture.mdmodule names, phases, questionary, hold--minuteswording —docs/architecture.mdline 37
Closure notes (2026-08-21)
wait_ssh: auth streak give-up after 180s continuous AuthenticationException (not 3 attempts).- Idle-killer: access_rules for GET/DELETE server; fallback without rules if Keystone rejects.
- Bootstrap light path:
GPU_RENT_BOOTSTRAP_LIGHT=1skips apt when marker present. - Also fixed
os_clientapp_version→ package__version__(noted in Phase 1, not a numbered task).