-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use --pull-policy if-not-present
when running pack build
#373
Conversation
This probably means consumers should run a |
CI won't have any cached images (unless using the paid circle ci docker layer caching feature, which we'd never want to use with pack), so will always pull the latest image in the first test run in a job. This PR just means subsequent tests in that job don't needlessly pull again after that. |
libcnb-test/src/pack.rs
Outdated
// Adjust pull-policy to prevent redundant image-pulling, which slows CI and risks hitting registry rate limits. | ||
String::from("--pull-policy"), | ||
String::from("if-not-present"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-ish: PackBuildCommand
was meant to abstract away the building of the pack
command from out actual logic which flags should be passed, etc.
I would love to see a pull_policy
field on PackBuildCommand
that is of type PullPolicy
and the "logic" (even though its a static value at this point) moved to the call-site to keep the separation of concerns.
Marking this as "breaking change". Although unlikely, if users rely on automatic pulling to keep up-to-date, this will break them. I don't think this should be a huge concern for us at this point though. |
Since it: 1. Saves ~2 seconds per integration test re-pulling an image that's already up to date. 2. Helps prevent hitting Docker Hub or ECR rate limits from duplicate (and redundant) image pulling (that counts agains the rate limit even when it's a no-op). Longer term, if Pack CLI supports a periodic pulling mode (buildpacks/pack#1368), we can switch to that, however for now this is the lesser of two evils - and in most cases Pack usage outside of `libcnb-test` will ensure that newer builder images are pulled from time to time. Fixes #306.
c375e22
to
daf7451
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Since it:
Longer term, if Pack CLI supports a periodic pulling mode (buildpacks/pack#1368), we can switch to that, however for now this is the lesser of two evils - and in most cases Pack usage outside of
libcnb-test
will ensure that newer builder images are pulled from time to time.See #306 for more details.
See also:
https://buildpacks.io/docs/tools/pack/cli/pack_config_pull-policy/
Fixes #306.
GUS-W-10799284.