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

[WIP] feat: add cache provider implementation #4169

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Commits on Nov 23, 2023

  1. feat: add cache provider implementation

    currently the only two implementation of cache are redis and inmemory.
    This commit introduces cache providers that let you implement your own
    blbodescriptor cache of choice and plug it in.
    
    Co-authored-by: Gladkov Alexey <agladkov@redhat.com>
    Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
    milosgajdos and legionus committed Nov 23, 2023
    Configuration menu
    Copy the full SHA
    d38096a View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2023

  1. Update registry/storage/cache/provider/cacheprovider.go

    Co-authored-by: Cory Snider <corhere@gmail.com>
    Signed-off-by: Milos Gajdos <milosgajdos83@gmail.com>
    milosgajdos and corhere committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    30f8cf7 View commit details
    Browse the repository at this point in the history
  2. update: make cacheprovider.Register panic on error

    This func is meant to be used from init funcs of specific cacheprovider
    implementations. If they fail to register we should panic.
    
    Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
    milosgajdos committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    90665be View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2023

  1. refactor: complete refactoring of cache providers and cache config

    This commit reworks cache provider setup and configuration.
    Cache now has a dedicated configuration structure instead of
    being part of the storage configuration. This simplifies the
    code quite a bit at the expense of sad configuration decoding.
    
    This commit now allows for adding of new cache providers should there be
    such need in the future. Currently we continue to provide only redis and
    inmemory cache.
    
    In line with this the existing cache implementation: inmemory and redis
    have now been "turned" into cache providers which also simplifies the code.
    
    Cache configuration is now expected to be set the following options:
    provider - name of the cache provider
    params - arbitrary set of config params for the given cache provider.
    
    Each cache provider must register itself via init func so it's loaded
    on startup and available if the config requires it.
    
    Redis configuration has been removed from the main configuration because
    its only ever been used for configuring caches and nothing else so it
    makes no sense to keep it in the global config.
    
    Documentation has been updated accordingly.
    
    Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
    milosgajdos committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    15bdb51 View commit details
    Browse the repository at this point in the history
  2. Update cache.go

    Co-authored-by: Cory Snider <corhere@gmail.com>
    Signed-off-by: Milos Gajdos <milosgajdos83@gmail.com>
    milosgajdos and corhere committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    6e079b8 View commit details
    Browse the repository at this point in the history
  3. Update redis.go

    Co-authored-by: Cory Snider <corhere@gmail.com>
    Signed-off-by: Milos Gajdos <milosgajdos83@gmail.com>
    milosgajdos and corhere committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    7bf9aae View commit details
    Browse the repository at this point in the history