Skip to content

Conversation

@rumpl
Copy link
Member

@rumpl rumpl commented Jan 5, 2023

- What I did

Upstreaming:

Implements docker pull with containerd.

Also includes stargz and nydus snapshotter handling, these two are lazy ones and need additional handlers during pull (pre-emptively removing this from the changeset to avoid too much comments, will add this one later)

Limiting concurrent downloads is not yet implemented, see here for the discussion, the way containerd handles limits is different than what moby does, I think we can implement limiting in a followup

Note: I will squash the commits once it's reviewed, it's easier to review with different commits

@rumpl rumpl marked this pull request as ready for review January 5, 2023 21:30
@rumpl rumpl force-pushed the containerd-image-pull branch from 96c03ec to af4507f Compare January 5, 2023 21:38
@rumpl rumpl added the containerd-integration Issues and PRs related to containerd integration label Jan 5, 2023
@thaJeztah thaJeztah added area/distribution Image Distribution status/2-code-review area/images Image Distribution labels Jan 6, 2023
@thaJeztah thaJeztah added this to the v-next milestone Jan 6, 2023
@rumpl rumpl force-pushed the containerd-image-pull branch 3 times, most recently from b4cf150 to 8ee91f3 Compare January 6, 2023 09:57
Copy link
Contributor

@corhere corhere left a comment

Choose a reason for hiding this comment

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

The big picture looks good, but some more work is needed in the details.

func (f httpFallback) RoundTrip(r *http.Request) (*http.Response, error) {
resp, err := f.super.RoundTrip(r)
if err != nil {
if strings.Contains(err.Error(), "http: server gave HTTP response to HTTPS client") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Lame, but there's no alternative. The standard library returns an errors.New error for this case. Anyone wanna write a Go language proposal?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll leave that one to you :)

@rumpl rumpl force-pushed the containerd-image-pull branch from 8ee91f3 to 86028fd Compare January 9, 2023 16:41

type updateProgressFunc func(ctx context.Context, ongoing *jobs, output progress.Output, start time.Time) error

func showProgress(ctx context.Context, ongoing *jobs, out progress.Output, updateFunc updateProgressFunc) func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since jobs is only useful in conjunction with showProgress and vice versa, I feel that association should be formalized.

Suggested change
func showProgress(ctx context.Context, ongoing *jobs, out progress.Output, updateFunc updateProgressFunc) func() {
func (j *jobs) showProgress(ctx context.Context, out progress.Output, updateFunc updateProgressFunc) func() {

@rumpl
Copy link
Member Author

rumpl commented Jan 10, 2023

CI failures look unrelated

Copy link
Contributor

@corhere corhere left a comment

Choose a reason for hiding this comment

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

LGTM, aside from one thing I missed in my earlier reviews. My bad.

ndeloof and others added 4 commits January 11, 2023 17:00
Signed-off-by: Nicolas De Loof <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>

containerd: Push progress

Signed-off-by: Paweł Gronowski <[email protected]>
We pass WithPullUnpack anyway

Signed-off-by: Paweł Gronowski <[email protected]>
Signed-off-by: Paweł Gronowski <[email protected]>
Signed-off-by: Nicolas De Loof <[email protected]>
@rumpl rumpl force-pushed the containerd-image-pull branch from 30af35f to 9032e67 Compare January 11, 2023 16:00
@rumpl rumpl requested a review from corhere January 11, 2023 16:02
@neersighted
Copy link
Member

Going to bring this one in as it has reached acceptance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/distribution Image Distribution area/images Image Distribution containerd-integration Issues and PRs related to containerd integration status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants