Repository navigation
perf(microvm): reuse native copy-on-write rootfs cloning - #2297
Merged
Merged
Conversation
Add regression coverage for issue #2296 before adopting copy-on-write cloning. Co-authored-by: Mecatl <[email protected]>
Use the pinned go-microvm clone primitive and test materialization and independent writes rather than incidental old copier behavior. Co-authored-by: Mecatl <[email protected]>
JAORMX
marked this pull request as ready for review
October 14, 2026 06:30
Merged
2 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
Closes #2296.
Use the already-pinned
go-microvm/rootfs.CloneDirwhen materializing the repository-private writable rootfs. The dependency uses APFS cloning on macOS and Linux reflinks where available, with ordinary-copy fallback. No dependency update or upstream change is required.The integration test exercises real guest-agent materialization and verifies that source and both clones have independent writable contents, retain an in-root symlink and executable file, and retain the installed guest-agent bytes and executable mode.
Verified artifact admission, snapshot copying, cache layout, runtime namespaces and upgrade/recovery behavior remain unchanged. Existing repository rootfs trees are not migrated or retroactively deduplicated.
Design
Reuse go-microvm's supported cloning behavior rather than treating the old local copy helper as a compatibility specification. Production owns a private transaction-scoped staging destination, and artifact admission remains enforced before cloning. Tests focus on actual materialization and write-isolation requirements rather than duplicating dependency implementation details.
This replaces the initial draft's test-only proposal. Its proposed upstream prerequisite was withdrawn after reviewing the real caller boundary; there is no pending upstream blocker.
Validation
task lint: passed.task test: passed.task test:race: passed.go run ./cmd/mecademo: passed, including tool call/result and permission ask/approval.git diff --check: passed.Local full gates used a short isolated
TMPDIRto avoid test Unix-socket path limits. Test/race invocations cleared the harness-injected Git configuration override withGIT_CONFIG_COUNT=0after an empty external-diff setting broke unrelated Git-based tests. No tests were disabled.No measured disk-savings claim or real macOS VM qualification is made. Storage sharing depends on filesystem support and applies to newly materialized rootfs trees.
API compatibility
Internal filesystem implementation change; no wire fields, remote API semantics, API major, feature identifiers, stored-data schema or public Go signatures change. No migration or client upgrade is required. Existing artifact admission and repository lifecycle behavior remain unchanged; no breaking change approval is needed.