summaryrefslogtreecommitdiff
path: root/lib/hyperstack/manager.rb
AgeCommit message (Collapse)Author
2026-05-25refactor(manager): move dry-run/resume logic into VmLifecycle; thin Manager ↵Paul Buetow
facade - Manager is now a thin facade (~160 lines) that delegates VM lifecycle, provisioning, testing, and cleanup to focused collaborators. - Moved replace/resume/dry-run handling and presentation helpers from Manager into VmLifecycle where they belong. - Fixed operator-precedence bug: instance && instance['id']. - Fixed status fallback to return public_ip from state on API error. - Fixed LocalWireGuard delegation bug (removed @local_wireguard.show_local_wireguard call which did not exist; now routes through Manager#show_local_wireguard). - Removed dead code: unused ensure_security_rules and legacy_litellm from VmLifecycle. - ProvisioningOrchestrator: removed spurious show_local_wireguard call and added legacy_litellm_rules cleanup with proper warn_out helper. - Added missing require statements (json, fileutils, provisioning). - Removed dead attr_reader :config from InferenceTester. - Renamed shadowed variable in cleanup_local_access.
2026-05-25refactor(manager): extract focused collaborators from Manager God ClassPaul Buetow
Extract VM lifecycle, SSH execution, WireGuard setup, model switching, end-to-end inference tests, and provisioning orchestration into separate collaborator classes. Manager becomes a thin facade (~80 lines). Also fixes CLI edge-cases: status/model-list when no VMs are active, and threads --vllm/--ollama flags through the provisioning pipeline.
2026-05-25update hyperstack2 VM state and config after recreationPaul Buetow
2026-05-24chore(config): remove gpt-oss-120b references since qwen3.6 is betterPaul Buetow
2026-05-24cleanup: remove ComfyUI and photo-related code from lib/hyperstackPaul Buetow
2026-05-24fix(manager): only delete state file when VM deletion is confirmedPaul Buetow
Ensure Manager#delete does not wipe the state file on generic/transient API failures. The rescue now checks whether the error message indicates the VM is already gone (404, not_found, does not exist) before removing state. This prevents orphaned billable VMs after exhausted retries or transient network errors.
2026-03-26hyperstack: fix TOML paths, add live provisioning progress, and auto ↵Paul Buetow
end-to-end test on create - cli: introduce REPO_ROOT constant so create-both/delete-both/watch find TOML configs at the repo root instead of lib/hyperstack/ - manager: with_polling prints a heartbeat every 30s so silent waits (SSH, VM ready, etc.) are visibly alive - provisioning: bootstrap_guest streams SSH output in real time so apt-lock waits and setup steps are visible as they happen - provisioning: vLLM wait loop reads docker logs to show the current startup stage (shard loading %, torch.compile, CUDA graphs, API up) instead of a plain "not ready yet" counter - manager: create automatically runs the end-to-end inference test after provisioning completes, removing the manual 'test' step Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25hyperstack: split 3335-line monolith into lib/hyperstack/ modulesPaul Buetow
Extracts all classes from hyperstack.rb into focused library files: - lib/hyperstack/config.rb — ConfigLoader + Config (TOML loading, validation) - lib/hyperstack/state.rb — StateStore + PrefixedOutput (JSON state, threaded output) - lib/hyperstack/client.rb — HyperstackClient (REST API + retry logic) - lib/hyperstack/wireguard.rb — LocalWireGuard (wg1.conf peer management, /etc/hosts) - lib/hyperstack/provisioning.rb — ProvisioningScripts + RemoteProvisioner (SSH bootstrap) - lib/hyperstack/manager.rb — Manager (VM lifecycle orchestration) - lib/hyperstack/watcher.rb — VllmWatcher (Prometheus + GPU dashboard) - lib/hyperstack/cli.rb — CLI (OptionParser command dispatch) hyperstack.rb becomes a 46-line entry point with require_relative calls. All files pass `ruby -c` syntax check and `--help` runs correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>