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

Feature request: manage local layer caches #141

Closed
Desiki-high opened this issue May 24, 2023 · 3 comments
Closed

Feature request: manage local layer caches #141

Desiki-high opened this issue May 24, 2023 · 3 comments
Assignees
Labels
feat New feature or request

Comments

@Desiki-high
Copy link
Collaborator

Before #140, the local layer caches were managed by contained service, nowadays we need to manage the layer caches ourselves.

Inspired by contained , we can add a bolt to record the changes of the local layers and clear them by LRU.

@Desiki-high
Copy link
Collaborator Author

GarbageCollect Design:

  1. We need to know the latest use of each layer. Such as key: digest value: used, we can refactor LocalProvider.images.
  2. GarbageCollect will delete the layer by digest one by one until the local cache size < cache_capacity.
  3. When to garbage collect? We can't gc if any task is working, so we need to lock the LocalAdapter to prevent new tasks and wait for all tasks completed, then gc start.
  4. Where to check local cache size. It seems LocalAdapter.Convert can do it.

Note: It seems gc also has a concurrency problem. This problem can be solved by gc func self or single flight.

cc @imeoer.

@Desiki-high
Copy link
Collaborator Author

Desiki-high commented Aug 29, 2023

Remaining work:

cc @imeoer.

This was referenced Aug 30, 2023
@Desiki-high
Copy link
Collaborator Author

@imeoer It looks like this job is done, let's close this issue and make a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants