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

feat: Wrap content to support cache #170

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

PerseidMeteor
Copy link
Collaborator

@PerseidMeteor PerseidMeteor commented Aug 8, 2023

Add remote cache of remote registry.

Changes:

  • Wrap content to support remote cache.
  • Wrap httpreadseeker as content readerat.
  • Make remote cache configable.

Ref: #7

@imeoer
Copy link
Collaborator

imeoer commented Aug 10, 2023

Please split the PR into multiple commits logically, and also add commit messages explaining why and how.

@PerseidMeteor
Copy link
Collaborator Author

PerseidMeteor commented Aug 15, 2023

remote cache design doc

@PerseidMeteor PerseidMeteor force-pushed the feat-remote-cache branch 3 times, most recently from 6d20d39 to 387c86f Compare August 18, 2023 07:46
misc/config/config.nydus.ref.yaml Outdated Show resolved Hide resolved
pkg/content/cache.go Outdated Show resolved Hide resolved
pkg/content/cache.go Show resolved Hide resolved
pkg/content/cache.go Outdated Show resolved Hide resolved
pkg/content/content.go Outdated Show resolved Hide resolved
pkg/driver/nydus/nydus.go Outdated Show resolved Hide resolved
pkg/driver/nydus/nydus.go Show resolved Hide resolved
pkg/driver/nydus/nydus.go Show resolved Hide resolved
pkg/driver/nydus/nydus.go Show resolved Hide resolved
pkg/driver/nydus/nydus.go Show resolved Hide resolved
misc/config/config.nydus.ref.yaml Outdated Show resolved Hide resolved
misc/config/config.nydus.yaml Outdated Show resolved Hide resolved
misc/config/config.nydus.yaml Outdated Show resolved Hide resolved
pkg/content/cache.go Outdated Show resolved Hide resolved
pkg/content/cache.go Outdated Show resolved Hide resolved
pkg/content/cache.go Outdated Show resolved Hide resolved
pkg/adapter/adapter.go Outdated Show resolved Hide resolved
pkg/content/content_test.go Outdated Show resolved Hide resolved
pkg/content/provider.go Outdated Show resolved Hide resolved
pkg/driver/nydus/nydus.go Outdated Show resolved Hide resolved
pkg/content/content.go Outdated Show resolved Hide resolved
We can use  LRU in content store  and wrap some methods to provides  remote cache. Here Info, Update, ReaderAt, Walk methods were wraped and they can get, update, and do other operations in LRU cache.
Also, we can configure whether to enable cache or not with cache_tag_suffix.And we can config cache size.

Signed-off-by: breezeTuT <y_q_email@163.com>
Here we can pull remote cache, use remote cache for conversion, and push the updated cache back to the remote. When updating, we follow a upper->lower order.

Signed-off-by: breezeTuT <y_q_email@163.com>
@imeoer imeoer merged commit 50eaaa3 into goharbor:main Aug 22, 2023
6 checks passed
@PerseidMeteor PerseidMeteor deleted the feat-remote-cache branch August 22, 2023 15:17
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.

3 participants