-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
converter: speed up conversion #352
Conversation
d9ec48f
to
80ffde8
Compare
Codecov ReportBase: 29.28% // Head: 29.36% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #352 +/- ##
==========================================
+ Coverage 29.28% 29.36% +0.07%
==========================================
Files 38 38
Lines 3811 3811
==========================================
+ Hits 1116 1119 +3
+ Misses 2563 2560 -3
Partials 132 132
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
80ffde8
to
1bdade8
Compare
16c151e
to
be925b2
Compare
See containerd/nydus-snapshotter#352 It's a internal optimization, so just only bump nydus-snapshotter package to latest version. Signed-off-by: Yan Song <[email protected]>
Default to enable --type tar-rafs option for nydus-image, which converting OCI tar blob stream into nydus blob directly, eliminating the need to decompress it to a local directory first, thus greatly accelerating the pack process. For compatibility, we still support env `NYDUS_DISABLE_TAR2RAFS=true` variable to disable the optimization. It's a internal feature, so we just only bump acceleration-service and nydus-snapshotter packages to latest version. Related PR: containerd/nydus-snapshotter#352 Signed-off-by: Yan Song <[email protected]>
Default to enable `--type tar-rafs` option for nydus-image, which converting OCI tar blob stream into nydus blob directly, eliminating the need to decompress it to a local directory first, thus greatly accelerating the pack process. For compatibility, we still support env `NYDUS_DISABLE_TAR2RAFS=true` variable to disable the optimization. It's an internal feature, so we just only bump acceleration-service and nydus-snapshotter packages to the latest version. Related PR: containerd/nydus-snapshotter#352 Signed-off-by: Yan Song <[email protected]>
Default to enable `--type tar-rafs` option for nydus-image, which converting OCI tar blob stream into nydus blob directly, eliminating the need to decompress it to a local directory first, thus greatly accelerating the pack process. For compatibility, we still support env `NYDUS_DISABLE_TAR2RAFS=true` variable to disable the optimization. It's an internal feature, so we just only bump acceleration-service and nydus-snapshotter packages to the latest version. Related PR: containerd/nydus-snapshotter#352 Signed-off-by: Yan Song <[email protected]>
Does this PR depend on nydusd and nydus-image 2.2+ ? |
// stream into nydus blob directly, the tar2rafs eliminates the | ||
// need to decompress it to a local directory first, thus greatly | ||
// accelerating the pack process. | ||
FeatureTar2Rafs Feature = "--type tar-rafs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As constat string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -392,61 +405,86 @@ func packRef(ctx context.Context, dest io.Writer, opt PackOption) (io.WriteClose | |||
} | |||
}() | |||
|
|||
blobMetaPath := filepath.Join(workDir, "blob.meta") | |||
blobMetaFifo, err := fifo.OpenFifo(ctx, blobMetaPath, syscall.O_CREAT|syscall.O_RDONLY|syscall.O_NONBLOCK, 0644) | |||
rafsBlobPath := filepath.Join(workDir, "blob.rafs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make "blob.rafs" as a constant string ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a temp file, just be used as a unique name.
if err != nil { | ||
return nil, errors.Wrapf(err, "create fifo file") | ||
} | ||
|
||
sourcePath := filepath.Join(workDir, "blob.targz") | ||
sourceFifo, err := fifo.OpenFifo(ctx, sourcePath, syscall.O_CREAT|syscall.O_WRONLY|syscall.O_NONBLOCK, 0644) | ||
tarBlobPath := filepath.Join(workDir, "blob.targz") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make "blob.targz" as a constant string ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. Only a few tiny comments left
Support the new option `--type tar-rafs` of builder for Pack method in converter package, enables converting OCI tar blob stream into nydus blob directly, eliminating the need to decompress it to a local directory first, thus greatly accelerating the pack process. Signed-off-by: Yan Song <[email protected]>
The Pack conversion workflow will hang on `io.Copy` once the builder execution failed, this patch fixes it. Signed-off-by: Yan Song <[email protected]>
The `Features` option enables feature collection for nydus-image builder. Signed-off-by: Yan Song <[email protected]>
Signed-off-by: Yan Song <[email protected]>
We should fallback some cli flags automatically for older versions of builder. Signed-off-by: Yan Song <[email protected]>
The `PrefetchPatterns` option should be paased to the builder (nydus-image) merge subcommand, otherwise the prefetch feature table will not work in the final bootstrap (used in nydus image). Signed-off-by: Yan Song <[email protected]>
Signed-off-by: Yan Song <[email protected]>
63d75c9
to
7850fe7
Compare
Signed-off-by: Yan Song <[email protected]>
See containerd/nydus-snapshotter#352 It's a internal optimization, so just only bump nydus-snapshotter package to latest version. Signed-off-by: Yan Song <[email protected]>
Signed-off-by: Yan Song [email protected]