-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Registry store plugin #1812
Registry store plugin #1812
Conversation
Hi @DvirDukhan. Thanks for your PR. I'm waiting for a feast-dev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Codecov Report
@@ Coverage Diff @@
## master #1812 +/- ##
==========================================
+ Coverage 84.87% 84.96% +0.08%
==========================================
Files 91 92 +1
Lines 6961 7029 +68
==========================================
+ Hits 5908 5972 +64
- Misses 1053 1057 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
/ok-to-test |
e643b53
to
e37ec13
Compare
I'm going to review this today. |
sdk/python/feast/registry.py
Outdated
f"Supported schemes are file and gs." | ||
) | ||
self.cached_registry_proto_ttl = cache_ttl | ||
registry_store_provider = str(registry_store_provider) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it makes sense to pull out the RegistryStore abstract class into it's own file for simplicity
sdk/python/feast/repo_config.py
Outdated
@@ -52,6 +52,9 @@ class Config: | |||
class RegistryConfig(FeastBaseModel): | |||
""" Metadata Store Configuration. Configuration that relates to reading from and writing to the Feast registry.""" | |||
|
|||
registry_store_provider: Optional[StrictStr] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reusing the name provider
here is quite confusing since we have a provider
concept already. Is it possible for us to infer the backend based on the URI, or use something like type:
to specify the class location? That would be consistent with OnlineStore, OfflineStore, and Provider.
e37ec13
to
9f337b9
Compare
Rebased and addressed comments. |
sdk/python/feast/registry.py
Outdated
if "." not in registry_store_type: | ||
if uri.scheme == "gs": | ||
from feast.infra.gcp import GCSRegistryStore | ||
|
||
self._registry_store = GCSRegistryStore(registry_path) | ||
elif uri.scheme == "s3": | ||
from feast.infra.aws import S3RegistryStore | ||
|
||
self._registry_store = S3RegistryStore(registry_path) | ||
elif uri.scheme == "file" or uri.scheme == "": | ||
from feast.infra.local import LocalRegistryStore | ||
|
||
self._registry_store = LocalRegistryStore( | ||
repo_path=repo_path, registry_path_string=registry_path | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would we hit this case? When users specified registry_store_type: S3RegistryStore
, something like that?
I think that in that case, we probably want to have a dict of the "shortcut" types mapping to the fully qualified type (like in https://github.com/feast-dev/feast/blob/master/sdk/python/feast/repo_config.py#L22), and use the dynamic importer.get_class_from_type
path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@achals thanks for the review.
I did the modifications, however, since there is a single constructor call self._registry_store = cls(registry_config, repo_path)
this enforces S3RegistryStore
and GCSRegistryStore
constructors to have the signature:
def __init__(self, registry_config: RegistryConfig, repo_path: Path):
This is a bit awkward IMO since repo_path
is not being used in those classes, it is just for the LocalRegistryStore
Let me know if you think there is a better approach to consolidate those constructors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to have a single interface even if it means passing in an unused parameter in some of the implementations, so I'd be okay with that change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, @achals. The change is already in the latest modification on the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the second back and forth @DvirDukhan , but I think that's the only other major concern I have. If we address that then i'm happy to lgtm
sdk/python/feast/registry_store.py
Outdated
@abstractmethod | ||
def teardown(self): | ||
""" | ||
Tear down all resources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All resources or the registry?
sdk/python/feast/registry_store.py
Outdated
""" | ||
|
||
@abstractmethod | ||
def get_registry_proto(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the return type be a part of this method?
sdk/python/feast/registry_store.py
Outdated
|
||
class RegistryStore(ABC): | ||
""" | ||
RegistryStore: abstract base class implemented by specific backends (local file system, GCS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment can be made tighter. We already know the class is RegistryStore
, and an abstract base class, so that doesn't need to be repeated.
What about
A registry store is a storage backend for the Feast registry.
or if we prefer classes.
RegistryStore is a storage backend for the Registry class.
Signed-off-by: DvirDukhan <dvir@redislabs.com>
Signed-off-by: DvirDukhan <dvir@redislabs.com>
Signed-off-by: DvirDukhan <dvir@redislabs.com>
Signed-off-by: DvirDukhan <dvir@redislabs.com>
Signed-off-by: DvirDukhan <dvir@redislabs.com>
Signed-off-by: DvirDukhan <dvir@redislabs.com>
Signed-off-by: DvirDukhan <dvir@redislabs.com>
Signed-off-by: DvirDukhan <dvir@redislabs.com>
Signed-off-by: DvirDukhan <dvir@redislabs.com>
Signed-off-by: DvirDukhan <dvir@redislabs.com>
Signed-off-by: DvirDukhan <dvir@redislabs.com>
9f337b9
to
b795399
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: achals, DvirDukhan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thanks @DvirDukhan ! The change looks good to me. |
What this PR does / why we need it:
Main feature: This PR allows adding third-party registry stores, to allow saving the registry in custom storage services other than s3/gcs/files.
Additional changes:
Registry
class is now being initialized withRegistryConfig
.Which issue(s) this PR fixes:
None
Does this PR introduce a user-facing change?: