feat(vmm): local VMM instance discovery#584
Merged
Conversation
46a1adc to
82f9424
Compare
Each dstack-vmm process now registers itself in /run/dstack-vmm/<uuid>.json on startup with instance metadata (address, pid, working dir, config, etc.) and cleans up on shutdown via Drop. Stale files from crashed processes are detected by checking /proc/<pid> and cleaned on next startup. vmm-cli.py gains two new commands: - ls-vmm: list all running VMM instances on the host - switch-vmm: select the active instance (prefix match on UUID) Auto-discovery resolves the VMM URL when no explicit --url is given: if an active instance is set it connects there; if exactly one instance is running it connects automatically.
82f9424 to
428738f
Compare
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dstack-vmmprocess registers itself in/run/dstack-vmm/<uuid>.jsonon startup with instance metadata (listen address, pid, working dir, config path, image/run paths, node name, version)Drop; stale files from crashed processes are detected by checking/proc/<pid>and cleaned on next VMM startupvmm-cli.pygainsls-vmmandswitch-vmm <id>commands for multi-instance management--urlis given, CLI auto-connects to the active or sole running VMM instanceTest plan
ls-vmmshows both with correct portsswitch-vmmwith prefix match,*marker, andlsvmauto-connects to selected instanceunix:./vmm.sock): discovery file, path resolution, auto-connect all workDropremoves registration filels-vmmfilters by/proc/<pid>checkcargo fmt,cargo clippyclean