-
Notifications
You must be signed in to change notification settings - Fork 208
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
support generating new image with separate blob for prefetched files #1649
support generating new image with separate blob for prefetched files #1649
Conversation
08bff89
to
8437d8d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1649 +/- ##
==========================================
- Coverage 60.10% 60.01% -0.10%
==========================================
Files 147 147
Lines 49513 49583 +70
Branches 46994 47037 +43
==========================================
- Hits 29762 29756 -6
- Misses 17970 18045 +75
- Partials 1781 1782 +1
|
Thanks! |
78717fb
to
e43282e
Compare
Blobs []string `json:"blobs"` | ||
} | ||
|
||
func Build(option BuildOption) (string, error) { |
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.
func Optimize
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.
this conflicts Optimize
declaration in optimizer.go
Major changes: 1. Added compatibility for rafs v5/v6 formats; 2. Set IS_SEPARATED_WITH_PREFETCH_FILES flag in BlobInfo for prefetchblob; 3. Add option output-json to store build output. Signed-off-by: Xing Ma <[email protected]>
We can statically analyze the image entrypoint dependency, or use runtime dynamic analysis technologies such as ebpf, fanotify, metric, etc. to obtain the container file access pattern, and then build this part of data into an independent image layer: * preferentially fetch blob during the image startup phase to reduce network and disk IO. * avoid frequent image builds, allows for better local cache utilization. Implement optimize subcommand of nydusify to generate a new image, which references a new blob included prefetch file chunks. ``` nydusify optimize --policy separated-prefetch-blob \ --source $existed-nydus-image \ --target $new-nydus-image \ --prefetch-files /path/to/prefetch-files ``` More detailed process is as follows: 1. nydusify first downloads the source image and bootstrap, utilize nydus-image to output a new bootstrap along with an independent prefetchblob; 2. nydusify generate&push new meta layer including new bootstrap and the prefetch-files , also generates&push new manifest/config/prefetchblob, completing the incremental image build. Signed-off-by: Xing Ma <[email protected]>
e43282e
to
6b13369
Compare
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.
Thanks, LGTM
Relevant Issue #1589
The objective is to generate a new image, which references a new blob included prefetch file chunks. This will accelerate an startup performance due to high-priority pulling of prefetch blob.
Details
Implement optimize subcommand of nydusify to generate a new image, which references a new blob included prefetch file chunks.
Types of changes
What types of changes does your PullRequest introduce? Put an
x
in all the boxes that apply:Checklist
Go over all the following points, and put an
x
in all the boxes that apply.