feat(image): implement optimized pure-Go native image rootfs export#558
Conversation
72c3d1f to
7574824
Compare
Code Review: PR #558 -- Native Go rootfs exportOverall, this is a well-structured PR. The concurrent-download/sequential-extract design is correct for ordered OCI layers. Test coverage with testing/synctest is excellent. Issue 1: PR description says opt-in but code is opt-OUTFile: native.go:38-42, PR description The PR description states this feature is opt-in, but the function returns true when the env var is unset. Feature is enabled by default (opt-OUT). Only setting CUBEMASTER_NATIVE_ROOTFS_EXPORT_ENABLED=false disables it. Fix the description mismatch. Issue 2: No progress feedback during native extractionFile: native.go:60-209 The dockerless path reports progress through OnPullProgress; the native path has no equivalent. Consider adding progress counters. Issue 3: Silent env-var parse failuresFile: native.go:41,226 Unparseable env values silently fall back to defaults. Log a warning when the env var is present but invalid. Issue 4: convertV1Config cross-path compatibility undocumentedFile: source.go:148-156 Document whether the DockerImageConfig output is compatible with the dockerless path. Issue 5: Decompressor close errors silently discardedFile: native.go:195-196 Decompressor Close errors are swallowed. Log them. Positive highlights
|
|
PTAL @fslongjin |
|
@novahe,We are preparing for the release of the next version, and after it's sent out, we will take a look at this PR |
7574824 to
ddc24ef
Compare
OK, looking forward to your feedback as soon as possible. |
ddc24ef to
5cb532b
Compare
|
Kindly ping @kinwin-ustc |
I'll review this later today~ |
Review: Native rootfs exportThanks for the PR. The overall direction matches the requirement: it adds an opt-in Native Export path controlled by I do not think this is ready to merge yet. There are a few functional and correctness gaps that should be addressed first. Blocking / high-risk issues
Functional / architecture notes
Security notes
Test coverageGood coverage added:
Missing or currently weak coverage:
Local verification
Suggested merge checklist:
|
2a8511d to
2ed7a74
Compare
2ed7a74 to
781a10b
Compare
chenhengqi
left a comment
There was a problem hiding this comment.
If we can do it in pure-Go, we can just retire all Docker/Dockerless code which requrires external CLIs.
Yes, the goal is to replace them entirely. For now, we will enable If we encounter any issues, we can fall back to the previous behavior by setting PTAL @fslongjin |
781a10b to
1aa2d12
Compare
|
This introduces a regression in the existing template image build progress reporting.
In the new Native export path, however, progress reporting is not wired through. Please keep the existing progress contract for the Native pipeline as well. A straightforward approach would be to use |
|
thank you for the reminder, I implemented it. Please take a look again when you have time. @fslongjin |
Introduces a pure-Go, daemonless rootfs export mode (Native Export) that completely bypasses docker, skopeo, and umoci while maintaining industry-standard extraction performance. This feature is enabled by default and can be disabled by setting the CUBEMASTER_NATIVE_ROOTFS_EXPORT_ENABLED=false environment variable. Key features: 1. Implements a concurrent native-prefetch pipeline to saturate network bandwidth, utilizing errgroup for immediate context cancellation and error propagation if any layer fails. 2. Unlocks Phase 2 loop-mount streaming for Native mode, allowing it to bypass intermediate host directories and extract compressed streams directly into the target ext4.img block device. 3. Implements a "decompress-and-delete" strategy that immediately removes compressed temporary files layer by layer, significantly minimizing peak disk space usage. Assisted-by: Antigravity:Gemini 3.1 Pro (High) Signed-off-by: novahe <heqianfly@gmail.com>
1aa2d12 to
3ddbe14
Compare

This PR introduces a pure-Go, daemonless rootfs export mode (
Native Export) that completely bypassesdocker,skopeo, andumociwhile maintaining industry-standard extraction performance.This feature is opt-in and can be explicitly enabled by setting the
CUBEMASTER_NATIVE_ROOTFS_EXPORT_ENABLED=trueenvironment variable. By utilizing go-containerregistry and archive.Untar, the native pipeline fetches images and constructs the root filesystem natively in Go, providing a much lighter, faster, and more controllable alternative to the external CLI-baseddockerlessapproach.Key Features
errgroupfor immediate context cancellation and error propagation if any layer fails.ext4.imgblock device.Comparison: Native vs. Dockerless
skopeo+umoci)skopeo copyflushes the entire image to disk as an OCI layout first, followed byumoci unpackto extract the rootfs.ext4mount point.skopeoandumocisubprocesses.docker/skopeo/umocisubprocesses (Note:ext4creation still depends on system tools).Test Results
Future Work
Assisted-by: Codex:GPT-5