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

Cache support for apko lock #1475

Open
sfc-gh-mhazy opened this issue Jan 10, 2025 · 0 comments
Open

Cache support for apko lock #1475

sfc-gh-mhazy opened this issue Jan 10, 2025 · 0 comments

Comments

@sfc-gh-mhazy
Copy link
Contributor

Hi,
I would like to add cache capabilities for apko lock.

Background

My usecase is that one is developing a large apko image (that must be built with lockfile - imposed by bazel rules_apko). When iteratively changing the config file, one needs to refresh the lockfile multiple times. For large images this takes quite some time.

The assumption for the cache working would be that the package repository does not change the contents of package under given version (True for Wolfi, False for Alpine). But if this is not satisfied, one has larger problems with building with lockfile anyway and needs to use some artifactory proxy.

Proposed changes

I have 2 proposals how this could be implemented:

  1. Add a cache layer for FetchPackage that is used for lock resolution. That cache could be optional and passed only from lock command to not add overhead to apko build
    • We could optimize this to cache hashes as well to not recalculate them every time (potentially useful for large packages)
  2. Use already existing cache (done in ExpandPackage) for lock resolution. That would just require some changes to how we create ApkResolved - to make it from ApkExpanded.

Please let me know if any of these sounds reasonable to you, happy to implement then (@mattmoor @jonjohnsonjr )

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

No branches or pull requests

1 participant