Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cache provider in feature store instance #1924

Merged
merged 2 commits into from
Oct 6, 2021

Conversation

DvirDukhan
Copy link
Collaborator

What this PR does / why we need it:
This PR saves the provider instance, and as such the offline and the online store instances. This will reduce the amount of time spent in functions involving them, as re-instantiation of these objects is no longer necessary.

Which issue(s) this PR fixes:

None

Does this PR introduce a user-facing change?:

None

@feast-ci-bot
Copy link
Collaborator

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

Copy link
Member

@achals achals left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Signed-off-by: DvirDukhan <dvir@redislabs.com>
@felixwang9817
Copy link
Collaborator

/kind housekeeping

@felixwang9817
Copy link
Collaborator

/lgtm

@felixwang9817
Copy link
Collaborator

/ok-to-test

@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2021

Codecov Report

Merging #1924 (63be2b3) into master (b1ccf8d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1924   +/-   ##
=======================================
  Coverage   82.34%   82.35%           
=======================================
  Files          96       96           
  Lines        7490     7492    +2     
=======================================
+ Hits         6168     6170    +2     
  Misses       1322     1322           
Flag Coverage Δ
integrationtests 73.92% <100.00%> (+<0.01%) ⬆️
unittests 60.14% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdk/python/feast/feature_store.py 94.36% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1ccf8d...63be2b3. Read the comment docs.

@@ -118,7 +119,7 @@ def project(self) -> str:

def _get_provider(self) -> Provider:
# TODO: Bake self.repo_path into self.config so that we dont only have one interface to paths
return get_provider(self.config, self.repo_path)
return self._provider
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only nit here is, what if e.g. feature_store.yaml changes?

an alternate approach might be to mimic what we do for the registry. i.e. have a config that specifies the cache TTL (which can be infinite), after which it does a refresh

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it force you to create a new instance? or "refresh" it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it would recreate the provider after the ttl expires.

as is, this would force users to restart the feature server in order to see changes from the yaml config, which seems fine as a default behavior. But I can see a world where someone wants the original behavior eg for debugging

Copy link
Member

@woop woop Oct 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this use case is different. We need caching for the registry for online retrieval. In the case of the provider I dont see a downside to having users create a new feature store instance when config changes, or is there a good use case? It's not super clear to me how debugging would be impacted significantly by having real caching with expiration

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm cool with this going in as is, but i see value in having a feature server running but wanting to mess around with parameters to get it working.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could basically be also a binary debug mode flag that continuously reinstantiates if true instead of a real cache

@felixwang9817 felixwang9817 removed the lgtm label Oct 5, 2021
Signed-off-by: DvirDukhan <dvir@redislabs.com>
Copy link
Collaborator

@adchia adchia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: achals, adchia, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@feast-ci-bot feast-ci-bot merged commit 7f35793 into feast-dev:master Oct 6, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants