Repository navigation
Record each VM's base-image identity for diff-based export - #1121
Conversation
Step 1 of boxctl-vms/docs/plans/rootfs-diff-export-import.md: fcVM now records BaseImagePath/BaseImageSHA256/BaseImageSizeBytes at Deploy time, via a new BaseImageIdentifier interface a RootfsPreparer can optionally implement (kept separate from RootfsPreparer itself since Cloud Hypervisor's preparer has no equivalent export path and shouldn't need to implement an unused method). DebugfsRootfsPreparer's implementation caches the sha256 in a sidecar file next to the base image, invalidated by mtime/size change, so repeated Deploys against the same golden image don't re-hash a multi-GB file every time. Reuses ensureCacheImage's existing lock helper (renamed lockCacheImage -> lockPath, now used by both). A failure to compute base-image identity is soft: logged, never fails Deploy itself, since this is purely an optimization for a later, unrelated export feature. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFu9nLXeUeopfwaqpyMcD6
|
The I tried to re-run just that job to confirm the flake, but it's part of GitHub's managed default CodeQL setup and the Actions API refuses a retry ( Generated by Claude Code |
Summary
Step 1 of rootfs-diff-export-import.md (a
boxctl-vmsplan doc, whose core diff/patch approach was already manually verified byte-for-byte against a real paused VM onaimax).fcVMnow recordsBaseImagePath/BaseImageSHA256/BaseImageSizeBytesatDeploytime.BaseImageIdentifierinterface, kept separate fromRootfsPrepareritself β Cloud Hypervisor's preparer (internal/providerch) has no equivalent export path (diff-export is Firecracker-only, matchingService.Pause's existing ch/Windows rejection) and shouldn't need to implement a method it'll never use.ProviderFC.Deploytype-asserts for it instead of requiring it.DebugfsRootfsPreparer.BaseImageIdentitycaches the sha256 in a{baseImage}.sha256sumsidecar file, invalidated by mtime/size change, so repeated Deploys against the same golden image don't re-hash a multi-GB file every time. ReusesensureCacheImage's existing file-lock helper (renamedlockCacheImageβlockPath, now used by both).Deployβ this is purely an optimization for a later, unrelated export feature.No CLI changes, no behavior change for anyone not consuming the new
fcVMfields.Test plan
go build ./...go vet ./...golangci-lint runon touched packages β 0 issueshashFile,baseImageIdentity(cache-hit via corrupted-sidecar check, and cache-invalidation on mtime/size change),Deploypopulating the new fields, andDeploy's soft-fail path when identity computation errorsgo test ./...) β one pre-existing failure in./cmd(TestReadConfig_NoConfigDirectory,TestCreateFlagsBindToViper) confirmed present onmainbefore this change too (viagit stash), unrelated to this PRπ€ Generated with Claude Code
https://claude.ai/code/session_01LFu9nLXeUeopfwaqpyMcD6