Use native RAFS in nydusify commit instead of tarfs and custom tarball logic
#1776
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.
Overview
This PR replaces much of the
nydusify commitlogic by using existing features innydus-image. This simplifies the code and improves performance.Related Issues
No related issue.
Change Details
The existing
nydusify commitlogic uses Go to stream a tarball of modified files and whiteouts intonydus-image createin tarfs mode. Without historical context I don't know exactly why this was done, but my guess is thatnydus-imagedidn't handle overlayfs-format whiteouts at the timenydusify commitwas written. This logic duplicates some of the worknydus-imageis about to do anyway, and isn't implemented in the most efficient way (for example, it stats all upper-layer files on the lower layer as well, to check if they are identical).This PR just calls
nydus-image create --whiteout-spec overlayfsto do effectively the same thing. In my benchmarks, this typically improves performance by at least 25% on fast disks.nydus-image createhas the--parent-bootstrapoption performs a merge internally, so this PR also removes the explicit calls tonydus-image mergeto simplify things further.Test Results
I have manually tested committing, including with deleted files, for correctness.
Change Type
Please select the type of change your pull request relates to:
Self-Checklist
Before submitting a pull request, please ensure you have completed the following:
Remaining items I'm unsure about:
nydus-image create. If this is an important feature, then we might be out of luck (unless we add the feature tonydus-image create)