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

Implement an OCI garbage collector #1639

Open
LucaSeri opened this issue May 9, 2024 · 0 comments
Open

Implement an OCI garbage collector #1639

LucaSeri opened this issue May 9, 2024 · 0 comments
Labels
area/oci Issue or PR is related to OCI package management kind/enhancement New feature or request

Comments

@LucaSeri
Copy link
Contributor

LucaSeri commented May 9, 2024

Feature request summary

OCI image packages are stored as layers in the kraftkit runtime directory.

Due to how images are constructed, a layer might be used in more than one package. E.g. two packages might be using the same kernel with a different rootfs. To optimize this, the kernel is not packaged twice, it instead lives in its own layer that is only referenced by the two packages.

The issue occurs when we want to remove a package from our OCI store, as there is currently no reference counting mechanism. This means that we have to pick between two not so great options:

  • remove all the dependencies, potentially breaking other packages
  • remove no dependencies, causing the cache to grow indefinitely (albeit, slowly)

This issue tracks implementing a better garbage collection mechanism to only remove the necessary dependencies.

This involves changes to the DeleteIndex method of the different OCI handlers, e.g.:
https://github.com/unikraft/kraftkit/blob/staging/oci/handler/directory.go#L1087

Describe alternatives

No response

Related architectures

None

Related platforms

None

Additional context

No response

@LucaSeri LucaSeri added the kind/enhancement New feature or request label May 9, 2024
@LucaSeri LucaSeri added cmd/kraft/pkg Issue or PR related to the ukpkg CLI program area/oci Issue or PR is related to OCI package management and removed cmd/kraft/pkg Issue or PR related to the ukpkg CLI program labels May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oci Issue or PR is related to OCI package management kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant