summaryrefslogtreecommitdiff
path: root/lib/hyperstack/cli.rb
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-25 22:23:05 +0300
committerPaul Buetow <paul@buetow.org>2026-05-25 22:23:05 +0300
commit0b9cd40f79f543a3845ba45cc3514fa47d33cd1c (patch)
tree5005c2dc6627c7c86d60a43fac29b3bae3308725 /lib/hyperstack/cli.rb
parente95ec1dd2a631a5d8790cedbe770baa95f048d94 (diff)
Fix Gemma 4 vLLM startup and improve partial-provisioning UX
- provisioning.rb: auto-install pytest before pre_start_cmd to fix missing dependency in nightly vLLM images that crashes EngineCore on cupy import - cli.rb: relax active_config_loaders/vm1_alive? to match by vm_id+public_ip instead of requiring status==ACTIVE, so watch/status/test work on VMs that were interrupted mid-provisioning - vm_lifecycle.rb: persist API status/vm_state back to state file during status calls; add 'Provisioning: incomplete' notice when provisioned_at is missing - provisioning_orchestrator.rb: add wait_for_ssh polling before ensure_trusted_host to fix race between SSH daemon readiness and keyscan
Diffstat (limited to 'lib/hyperstack/cli.rb')
-rw-r--r--lib/hyperstack/cli.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/hyperstack/cli.rb b/lib/hyperstack/cli.rb
index b5bcaff..b466105 100644
--- a/lib/hyperstack/cli.rb
+++ b/lib/hyperstack/cli.rb
@@ -110,30 +110,27 @@ module HyperstackVM
end
end
- # Returns only the config loaders whose state files exist, i.e. VMs that have
- # been provisioned at least once. Used by watch/status/test when the user
- # wants to see whatever is currently up without specifying --vm explicitly.
- # VMs that have an active (live) state file: state exists, has a public IP,
- # and status is ACTIVE. Used by watch/status/test when falling back from
- # a dead or unprovisioned default VM.
+ # Returns only the config loaders whose state files exist and have a tracked VM.
+ # Used by watch/status/test when the user wants to see whatever is currently
+ # up without specifying --vm explicitly.
def active_config_loaders
pair_config_loaders.filter_map do |loader|
next unless File.exist?(loader.config.state_file)
state = JSON.parse(File.read(loader.config.state_file))
- state['public_ip'] && state['status'] == 'ACTIVE' ? loader : nil
+ state['public_ip'] && state['vm_id'] ? loader : nil
rescue JSON::ParserError, Errno::ENOENT
nil
end
end
- # True when VM1 has a state file that actually points to a running VM.
+ # True when VM1 has a state file with a tracked VM ID and public IP.
def vm1_alive?
path = ConfigLoader.load(vm_config_path('1')).config.state_file
return false unless File.exist?(path)
state = JSON.parse(File.read(path))
- state['public_ip'] && state['status'] == 'ACTIVE'
+ state['public_ip'] && state['vm_id']
rescue JSON::ParserError, Errno::ENOENT
false
end
@@ -263,7 +260,7 @@ module HyperstackVM
def run_status
loaders = default_or_active_loaders
if loaders.empty?
- puts 'No active VMs found.'
+ puts 'No active VMs found. Run `create --vm 1|2|both` first.'
puts
puts '[local-wireguard]'
build_manager(ConfigLoader.load(vm_config_path('1')).config).show_local_wireguard(nil)