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

cmd, push: expose --compression-level #18940

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

giuseppe
Copy link
Member

This patch adds the --compression-level option to the push command.

Closes: #18939

Does this PR introduce a user-facing change?

Now the push command supports the --compression-level option

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 20, 2023
@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label Jun 20, 2023
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, vrothberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -435,7 +435,12 @@ var _ = Describe("Podman manifest", func() {
Expect(output).To(ContainSubstring("Writing manifest to image destination"))
Expect(output).To(ContainSubstring("Storing signatures"))

push = podmanTest.Podman([]string{"manifest", "push", "--tls-verify=false", "--creds=podmantest:wrongpasswd", "foo", "localhost:" + registry.Port + "/credstest"})
// Invalid compression format specified for gzip, it must fail
push = podmanTest.Podman([]string{"push", "--compression-format=gzip", "--compression-level=20", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "--format=v2s2", "localhost:" + registry.Port + "/alpine:latest"})
Copy link
Member

Choose a reason for hiding this comment

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

this is running push not manifest push
exit code checks are bad, you must check for the proper error message on stderr.

push = podmanTest.Podman([]string{"push", "--compression-format=gzip", "--compression-level=10", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(125))
Expect(push.ErrorToString()).To(BeEmpty())
Copy link
Member

Choose a reason for hiding this comment

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

why should error be empty? please check for the actual expected error message.

@giuseppe giuseppe force-pushed the add-compression-level branch 4 times, most recently from 5879342 to e3685bc Compare June 20, 2023 11:18
Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

Docs check is failing

@giuseppe giuseppe force-pushed the add-compression-level branch 2 times, most recently from 9d68ccd to 66ce890 Compare June 20, 2023 13:33
@@ -434,7 +434,14 @@ var _ = Describe("Podman manifest", func() {
Expect(output).To(ContainSubstring("Writing manifest to image destination"))
Expect(output).To(ContainSubstring("Storing signatures"))

push = podmanTest.Podman([]string{"manifest", "push", "--tls-verify=false", "--creds=podmantest:wrongpasswd", "foo", "localhost:" + registry.Port + "/credstest"})
// Invalid compression format specified for gzip, it must fail
Copy link
Member

Choose a reason for hiding this comment

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

Is this comment accurate? It says format, but the error-message check (line 442) says level. Comment also says gzip, which seems inconsistent with zstd. Same applies to lines 102-103 in push_test.go below.

@giuseppe giuseppe force-pushed the add-compression-level branch from 66ce890 to 5fff082 Compare June 20, 2023 15:18
@rhatdan
Copy link
Member

rhatdan commented Jun 20, 2023

Should this be configurable in containers.conf? Stored with the compression type?

####> are applicable to all of those.
#### **--compression-level**=*level*

Specifies the compression level to use. The value is specific to the compression algorithm used, e.g. for zstd the accepted values are in the range 1-20 (inclusive), while for gzip it is 1-9 (inclusive).
Copy link
Member

Choose a reason for hiding this comment

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

What are the defaults?

Copy link
Member

Choose a reason for hiding this comment

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

@giuseppe this one's still one

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks. I was waiting for the c/common change to merge before pushing the new version.

Should be addressed now

@giuseppe giuseppe force-pushed the add-compression-level branch from 5fff082 to 92e4282 Compare June 20, 2023 21:14
@giuseppe
Copy link
Member Author

Should this be configurable in containers.conf? Stored with the compression type?

added compressionlevel to containers.conf here: containers/common#1518

@giuseppe giuseppe marked this pull request as draft June 20, 2023 22:22
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 20, 2023
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

####> are applicable to all of those.
#### **--compression-level**=*level*

Specifies the compression level to use. The value is specific to the compression algorithm used, e.g. for zstd the accepted values are in the range 1-20 (inclusive), while for gzip it is 1-9 (inclusive).
Copy link
Member

Choose a reason for hiding this comment

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

@giuseppe this one's still one

@giuseppe giuseppe force-pushed the add-compression-level branch from 92e4282 to d9ed414 Compare June 21, 2023 11:57
@giuseppe giuseppe marked this pull request as ready for review June 21, 2023 11:57
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 21, 2023
@giuseppe giuseppe force-pushed the add-compression-level branch from d9ed414 to c07883b Compare June 21, 2023 12:07
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 21, 2023
@giuseppe giuseppe force-pushed the add-compression-level branch from c07883b to 10a54ed Compare June 21, 2023 12:16
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 21, 2023
giuseppe added 2 commits June 21, 2023 14:28
Signed-off-by: Giuseppe Scrivano <[email protected]>
This patch adds the --compression-level option to the push command.

Closes: containers#18939

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe giuseppe force-pushed the add-compression-level branch from 10a54ed to bb932cc Compare June 21, 2023 12:28
@giuseppe
Copy link
Member Author

addressed all comment, and the CI is green

@rhatdan
Copy link
Member

rhatdan commented Jun 21, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 21, 2023
@openshift-merge-robot openshift-merge-robot merged commit 71b0168 into containers:main Jun 21, 2023
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/api-change Change to remote API; merits scrutiny lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose buildah --compression-level on push command
7 participants