Skip to content

fix(vm): restart a stopped sandbox on the image digest it was prepared with - #18

Open
137137137 wants to merge 1 commit into
ai-openshell:mainfrom
137137137:fix/vm-restart-pin-image-digest
Open

137137137 wants to merge 1 commit into
ai-openshell:mainfrom
137137137:fix/vm-restart-pin-image-digest

Conversation

@137137137

Copy link
Copy Markdown

Moved from ai-openshell/openshell#6187 after the driver migration (ai-openshell/openshell#5200). Issue: ai-openshell/openshell#6186.

Restarting a stopped VM sandbox re-resolved its image tag, so a moved tag put the preserved overlay on top of a different image. This records the digest the tag resolved to and uses it on restart.

  • ensure_prepared_registry_image_disk returns the pinned reference it verified; RuntimeImagePlan carries it back from the worker.
  • write_sandbox_image_metadata stores it in image-pinned-reference, and removes the file for images without a registry pin.
  • restart_image_ref resolves the pin on PreserveExisting. It only does this when image-reference still matches the sandbox's image, and rejects a pin without a digest or for another registry or repository.
  • A cached, digest-pinned prepared disk is used without a registry call, as the bootstrap cache already does (#4582).

Sandboxes without a pin file keep the old behaviour until their next start writes one. Local engine images aren't covered.

Testing: new tests cover a tag moving between create and restart (no registry request, original disk), the recorded pin, and the pin validation rules. cargo fmt --check, clippy with -D warnings, and cargo test -p openshell-driver-vm pass on Linux.

…d with

Restarting a VM sandbox resolved its image tag again, so a tag that moved
while the sandbox was stopped put the preserved overlay on a different
lower image. Record the digest-pinned reference when the overlay is
prepared and resolve that on restart. A cached, digest-pinned prepared
disk is now used without a registry call, as the bootstrap cache does.

Signed-off-by: 137137137 <168236155+137137137@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant