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

Rationalize build pull #3863

Merged
merged 2 commits into from Nov 7, 2022
Merged

Conversation

deitch
Copy link
Collaborator

@deitch deitch commented Nov 1, 2022

- What I did

The current lkt pkg build process is treated as:

  1. See if the pkg is in the cache
  2. If it is not, try to pull it from the registry
  3. If not in the registry, build it

That is not quite as efficient as it could be. There is no reason to pull it from registry to local cache unless you really want it. Much of the time, pkg build really is just saying, "I want to build it if it doesn't exist anywhere", not "I also need it in my cache." This tends to bloat the cache unnecessarily.

The change now does the following:

  1. See if the pkg is in the cache
  2. It it is not, see if it it is in the registry (unless overridden with --pull, in which case pull too)
  3. If not in the registry, build it

You still can get the current behaviour with lkt pkg build --pull, but now package building is not confused by default with cache filling.

Of course, when you actually build an image with lkt build, it checks in the cache and, if not found, pulls it down anyways, so lkt build is unchanged.

- How I did it

Added an option to pkg build --pull and changed the pull logic.

- How to verify it

Run CI. Also tested manually.

- Description for the changelog

Default for building packages is not to pull from registry unless explicitly requested.

Signed-off-by: Avi Deitcher <avi@deitcher.net>
@deitch deitch force-pushed the rationalize-build-pull branch 3 times, most recently from 809e417 to c1ef4dc Compare November 1, 2022 19:07
Signed-off-by: Avi Deitcher <avi@deitcher.net>
@deitch deitch merged commit 860163a into linuxkit:master Nov 7, 2022
@deitch deitch deleted the rationalize-build-pull branch November 7, 2022 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant