Allow optimizing images with prioritiezed files info shared via registry #642
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.
This commit enables to share the "record file" (a JSON file containing a list of prioritized files) among hosts/users via container registry. The record file is packed as an OCI image called "record file image".
"Record file image" is an OCI image only contains one layer that contains the record file as a tar entry named
stargz.record.json
.ctr-remote image optimize
with--record-out-ref
creates a record file image.ctr-remote image convert
with--estargz-record-in-ref
enables to create an eStargz image with applying the prioritized files information described in the specified record file image.Generating record file image
The following command generates a record file image named
registry2:5000/golang:record-1.15.3-esgz-go-version
.The follwoing is the manifest of the record file image
registry2:5000/golang:record-1.15.3-esgz-go-version
.Layer blob
sha256:5b37372a28490bb0737aaadb48241b72ca6e54e023b15ac481a5a3df0da69dcc
is a tar.gz blob that contains the record file as a tar entry namedstargz.record.json
.Consuming record file image
ctr-remote image convert
command with--estargz-record-in-ref
option allowes you to use the recrod file image for optimizing a new eStargz image. The newly-created eStargz will be applied the prioritized files information described in the record file.Copying prioritized files information from an existing eStargz
This commit also adds an ability to copy prioritized files information from an existing eStargz image to a newly-creating eStargz.
The following example creates a new eStargz image
registry2:5000/golang:1.15.3-esgz-go-version-static
with the same prioritized files configuration as an existing eStargzregistry2:5000/golang:1.15.3-esgz-go-version
.Now we have 3 approaches for creating an eStargz image statically (i.e. without running the profiler).
Updated
ctr-remote.md
docs to describe all of these methods.ctr-remote image convert --estargz-record-copy
)ctr-remote image convert --estargz-record-in
)ctr-remote image convert --estargz-record-in-ref
)