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

Support gzip and zstd HTTP transport compression to fetch remote resources #8166

Merged
merged 1 commit into from Nov 30, 2023

Conversation

laurazard
Copy link
Member

@laurazard laurazard commented Feb 26, 2023

Golang net/http already transparently supports gzip compression.
This adds support for zstd compression


This PR takes over #7563 since @ndeloof is no longer working on this as per #7563 (comment).

Also took the chance to address some small comments in the previous PR.

@k8s-ci-robot
Copy link

Hi @laurazard. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@laurazard
Copy link
Member Author

/cc @thaJeztah @AkihiroSuda

@thaJeztah
Copy link
Member

Something weird in CI (Vagrant, Fedora 37); should not be related to this PR, but wondering if there's an issue somewhere; https://github.com/containerd/containerd/pull/8166/checks?check_run_id=11607343495

default: + chcon -v -t container_runtime_exec_t /usr/local/sbin/runc /usr/local/sbin/runc
    default: changing security context of '/usr/local/sbin/runc'
    default: changing security context of '/usr/local/sbin/runc'
==> default: Running provisioner: install-gotestsum (shell)...
    default: Running: inline script
    default: + /root/go/src/github.com/containerd/containerd/script/setup/install-gotestsum
    default: gotest.tools/gotestsum: go install gotest.tools/gotestsum: build output "/root/go/bin/gotestsum" already exists and is not an object file
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

@laurazard
Copy link
Member Author

Yeah I noticed it, seems like maybe something got stuck/didn't get cleaned up in the runner.

@dmcgowan dmcgowan added this to the 2.0 milestone Feb 28, 2023
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

changes LGTM

@thaJeztah
Copy link
Member

@dmcgowan I see you added the 2.0 milestone to this; was there a discussion on this one?

@dmcgowan dmcgowan added the status/needs-discussion Needs discussion and decision from maintainers label Mar 8, 2023
@dmcgowan
Copy link
Member

dmcgowan commented Mar 8, 2023

@thaJeztah no, this one never got discussed, labeled it as needs discussion. All PRs which need discussion got put in 2.0 or removed from 1.7 milestone.

For this PR in particular, I think this is missing a few things still. (1) A timeline for when we would expect official support in Golang, moving from built in protocol support to custom parsing/handling is not preferred for this type of functionality. (2) Justification, as @kzys asked in the previous PR, who is using this or trying to use it. (3) Testing, especially if we are going to accept this custom handling over what the built in http library does for us automatically.

@laurazard
Copy link
Member Author

laurazard commented Apr 19, 2023

For (2), I've just updated the PR to add some tests for the custom compression handling. Re: (3), I think it's a bit of a chicken-and-egg problem – no reason for registries to support it if there are no clients, and vice versa, which is why it would be good to optionally add support for it.

thoughts @thaJeztah @dmcgowan?

@gaby
Copy link

gaby commented Apr 19, 2023

@laurazard I'm subscribed to this PR since I'm trying to add zstd support to everything. There is one PR in Docker's official Registry. I'm pretty sure once the official registry add support for zstd others will too.

PR:
distribution/distribution#3784

@laurazard
Copy link
Member Author

Thanks for the additional context @gaby! I can try to ping people about distribution/distribution#3784 too, see if we can get that moving again.

@gaby
Copy link

gaby commented Apr 19, 2023

Found these ones at moby/moby:

moby/moby#43881
moby/moby#43331

@laurazard
Copy link
Member Author

distribution/distribution#3900 got merged, maybe we can start taking a look at this again
/cc @dmcgowan

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

One nit for the test, but otherwise LGTM

remotes/docker/fetcher_test.go Outdated Show resolved Hide resolved
remotes/docker/fetcher.go Show resolved Hide resolved
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

remotes/docker/fetcher.go Outdated Show resolved Hide resolved
@gaby
Copy link

gaby commented Aug 10, 2023

@laurazard @dmcgowan @thaJeztah Any plans to wrap up this feature? Seems to be ready, but there's a comment still unresolved

@laurazard laurazard force-pushed the gzip-gstd-compression branch 2 times, most recently from 3fe668d to 8d0b06c Compare September 12, 2023 04:55
@laurazard
Copy link
Member Author

@gaby Sorry, I've been out on leave a while and haven't looked at this. I've rebased and addressed the remaining comments now! Thoughts @dmcgowan?

@gaby
Copy link

gaby commented Sep 19, 2023

@laurazard No worries, looking forward to this feature getting merged :-)

@gaby
Copy link

gaby commented Nov 16, 2023

@dmcgowan Any chance at looking at this?

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM just a style preference suggestion.

remotes/docker/fetcher.go Outdated Show resolved Hide resolved
…urces

Co-authored-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
@laurazard
Copy link
Member Author

Applied suggestions + rebased ✅

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

still LGTM

@dmcgowan dmcgowan added this pull request to the merge queue Nov 30, 2023
Merged via the queue into containerd:main with commit b8e3259 Nov 30, 2023
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test size/L status/needs-discussion Needs discussion and decision from maintainers
Projects
Development

Successfully merging this pull request may close these issues.

None yet

7 participants