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

[Investigation] Use HEAD request to determine if the digest had changed #899

Closed
dfreilich opened this issue Oct 19, 2020 · 3 comments · Fixed by #908
Closed

[Investigation] Use HEAD request to determine if the digest had changed #899

dfreilich opened this issue Oct 19, 2020 · 3 comments · Fixed by #908
Labels
size/sm Small level of effort type/enhancement Issue that requests a new feature or improvement. type/research Issue intended to be exploratory.
Milestone

Comments

@dfreilich
Copy link
Member

Description

Currently, when we pack build, we attempt to pull some images (eg, we check whether there is a new version of your builder) over here. With DockerHub rate limits, that can be an issue.

Proposed solution

First use a HEAD request (perhaps using go-containerregistry remote.Head) to check whether the digest has changed, and only pull if it has.

Additional context

Slack discussion here

@dfreilich dfreilich added type/enhancement Issue that requests a new feature or improvement. status/triage Issue or PR that requires contributor attention. size/sm Small level of effort type/research Issue intended to be exploratory. and removed status/triage Issue or PR that requires contributor attention. labels Oct 19, 2020
@jromero jromero added this to the 0.15.0 milestone Oct 19, 2020
@imjasonh
Copy link
Member

It looks like pack's fetcher.go uses github.com/docker/docker/client, which I believe, being maintained by Docker, would already do the right thing and avoid unnecessarily-counted pulls if it can determine it can do so.

That leaves remote's Image.Found which pack calls before pullImage, which can be fixed to use remote.Head instead. Let me know if there's about this code path that I might be missing.

@jromero
Copy link
Member

jromero commented Oct 22, 2020

@imjasonh, got your imgutil feature incorporated in #908.

Based on your statement this is resolved. It's more that it delegates the lookup to the docker daemon that then should already do the right thing. Tomatoes potatoes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/sm Small level of effort type/enhancement Issue that requests a new feature or improvement. type/research Issue intended to be exploratory.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants