Verda: make startup script and SSH key lifecycle per-instance with reliable cleanup#3718
Open
peterschmidt85 wants to merge 6 commits intomasterfrom
Open
Verda: make startup script and SSH key lifecycle per-instance with reliable cleanup#3718peterschmidt85 wants to merge 6 commits intomasterfrom
peterschmidt85 wants to merge 6 commits intomasterfrom
Conversation
jvstme
approved these changes
Apr 1, 2026
| or message == "not found" | ||
| or ("startup script id" in message and "invalid" in message) | ||
| or ("script id" in message and "invalid" in message) | ||
| ) |
Collaborator
There was a problem hiding this comment.
(nit) In my testing, deleting a nonexistent key or script does not actually raise any exceptions. So I assume both _is_ssh_key_not_found_error and _is_startup_script_not_found_error are hallucinations and can be removed.
Co-authored-by: jvstme <36324149+jvstme@users.noreply.github.com>
Co-authored-by: jvstme <36324149+jvstme@users.noreply.github.com>
Co-authored-by: jvstme <36324149+jvstme@users.noreply.github.com>
Co-authored-by: jvstme <36324149+jvstme@users.noreply.github.com>
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
This PR makes Verda startup scripts and SSH keys fully per-instance and ensures they are cleaned up reliably.
What changed
startup_script_idssh_key_idscode(not_found) and narrowly handles expectedinvalid_requestinvalid-ID messagesBackward compatibility
Backward compatible:
VerdaInstanceBackendDatafields are optional.backend_datastill terminate safely (no-op cleanup when IDs are absent).Validation
Automated
pre-commit run --all-files✅uv run pytest -q src/tests/_internal/core/backends/verda/test_compute.py✅ (27 passed)uv run pytest -q✅ (2420 passed, 1147 skipped)Manual end-to-end checks
startup_script_id+ssh_key_ids.not_foundin Verdanot_foundin Verdahello-world.Notes
discontinuedin Verda API for some time; this is provider-side lifecycle behavior and does not affect dstack cleanup correctness.AI assistance
This PR was prepared with AI assistance.