Skip to content
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

Add zstd compress level support #1496

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

djdongjin
Copy link
Member

Fix #1367

This PR in stargz adds support for customizing zstd compression level in ctr-remote. This PR does a similar thing to add the support in nerdctl.

I tested the change locally using the stargz main branch. After the new version of stargz is released (with the change in that PR), it should work.

$ nerdctl image convert --oci --zstdchunked ghcr.io/stargz-containers/python:3.7-esgz level-default
sha256:d649464e45963ead9c0a2ec4b1a124eb7f55a924c3eb687c2975012a7a4f397c
$ nerdctl image convert --oci --zstdchunked --zstdchunked-compression-level=9 ghcr.io/stargz-containers/python:3.7-esgz level-9
sha256:c19da79809fc2e2853cb231f8f62dbd7eaa3a0d49a57d0a86d301acfa03ad902
$ nerdctl images
REPOSITORY                          TAG         IMAGE ID        CREATED           PLATFORM       SIZE         BLOB SIZE
alpine                              3.13        100448e45467    34 hours ago      linux/amd64    5.6 MiB      2.7 MiB
level-9                             latest      c19da79809fc    39 seconds ago    linux/amd64    0.0 B        328.4 MiB
level-default                       latest      d649464e4596    3 minutes ago     linux/amd64    0.0 B        334.3 MiB
ghcr.io/stargz-containers/python    3.7-esgz    6a421075162f    4 minutes ago     linux/amd64    903.7 MiB    333.1 MiB

Signed-off-by: Jin Dong jindon@amazon.com

@@ -66,6 +67,10 @@ func newImageConvertCommand() *cobra.Command {
imageConvertCommand.Flags().Int("estargz-compression-level", gzip.BestCompression, "eStargz compression level")
imageConvertCommand.Flags().Int("estargz-chunk-size", 0, "eStargz chunk size")
imageConvertCommand.Flags().Bool("zstdchunked", false, "Use zstd compression instead of gzip (a.k.a zstd:chunked). Should be used in conjunction with '--oci'")
imageConvertCommand.Flags().String("zstdchunked-record-in", "", "Read 'ctr-remote optimize --record-out=<FILE>' record file (EXPERIMENTAL)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AkihiroSuda
Copy link
Member

The commit message doesn’t seem to reflect the actual content of the commit

Signed-off-by: Jin Dong <jindon@amazon.com>
@djdongjin
Copy link
Member Author

@AkihiroSuda Thanks for review. Updated the doc to mention zstdchunked-record-in as experimental and the commit message.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@AkihiroSuda AkihiroSuda added this to the v1.0.1 milestone Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it possible to set the zstd compression level
3 participants