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: Add Async refresh to Sql Registry #4251

Merged

Conversation

stanconia
Copy link
Contributor

@stanconia stanconia commented Jun 3, 2024

What this PR does / why we need it:

Support Async refresh in Sql Registry to facilitate Registry functions at an Enterprise level

Which issue(s) this PR fixes:

Registry Refresh at an enterprise scale

Fixes

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
@stanconia
Copy link
Contributor Author

ok-to-test

@tokoko
Copy link
Collaborator

tokoko commented Jun 4, 2024

I'm still not sure if I'm opposed to the idea, but just to note: don't we already do something like this "externally", for example a python feature server has an async methods that refresh registry in the background?

@stanconia
Copy link
Contributor Author

stanconia commented Jun 5, 2024

I'm still not sure if I'm opposed to the idea, but just to note: don't we already do something like this "externally", for example a python feature server has an async methods that refresh registry in the background?

I'm still not sure if I'm opposed to the idea, but just to note: don't we already do something like this "externally", for example a python feature server has an async methods that refresh registry in the background?

@tokoko the problem with async refresh changes in Feature Server is, when multiple feature servers perform async refreshes Registry will be overloaded which does not scale at an enterprise leve. We believe aync refresh should be done at the cacheRegistry level.

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
@tokoko
Copy link
Collaborator

tokoko commented Jun 6, 2024

@stanconia I don't particularly buy that argument tbh. If you're running multiple feature servers, each will almost certainly be running in it's own process/container, so each will come with it's own CachingRegistry. The behavior will be exactly the same from a load perspective. Having said that, decoupling all that from feature server and making it more reusable might be a good idea. I'll have to take a closer look at the components involved first and get back to you (feature server, ui server, caching registry, ...)

@stanconia
Copy link
Contributor Author

@stanconia I don't particularly buy that argument tbh. If you're running multiple feature servers, each will almost certainly be running in it's own process/container, so each will come with it's own CachingRegistry. The behavior will be exactly the same from a load perspective. Having said that, decoupling all that from feature server and making it more reusable might be a good idea. I'll have to take a closer look at the components involved first and get back to you (feature server, ui server, caching registry, ...)

You are right for some usecases but in our usecase we are using a Remote Registry proxied to a Sql Registry.

@tokoko
Copy link
Collaborator

tokoko commented Jun 8, 2024

@stanconia oh, great. makes sense. didn't know anyone was already using it, I still have to add remote registry to the docs :)

@stanconia
Copy link
Contributor Author

@stanconia oh, great. makes sense. didn't know anyone was already using it, I still have to add remote registry to the docs :)

@tokoko gentle reminder on reviewing/considering this pr.

@tokoko
Copy link
Collaborator

tokoko commented Jun 10, 2024

How about instead of allow_async_cache, we introduce cache_mode config that can be sync (default), thread (implementation in this PR) and in the future possibly async (similar to this, but with asyncio). async referring to a separate thread in python is a little confusing at first.

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
@stanconia
Copy link
Contributor Author

How about instead of allow_async_cache, we introduce cache_mode config that can be sync (default), thread (implementation in this PR) and in the future possibly async (similar to this, but with asyncio). async referring to a separate thread in python is a little confusing at first.

@tokoko requested change has been implemented.

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
Stanley Opara added 3 commits June 12, 2024 15:55
Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
@stanconia
Copy link
Contributor Author

@tokoko please can you review/approve pr if there are no other concerns. Thanks

@tokoko
Copy link
Collaborator

tokoko commented Jun 20, 2024

@jeremyary the tests need approval here

@stanconia
Copy link
Contributor Author

@jeremyary the tests need approval here

@jeremyary any updates? cc @tokoko

@stanconia
Copy link
Contributor Author

@jeremyary the tests need approval here

@jeremyary any updates? cc @tokoko

@tokoko can you assist here?

@tokoko
Copy link
Collaborator

tokoko commented Jun 25, 2024

@franciscojavierarceo @HaoXuAI can you help here? Tests need a first-time contributor approval.

@HaoXuAI
Copy link
Collaborator

HaoXuAI commented Jul 1, 2024

hey, sorry merged amother PRs and caused conflicts. mind resolve it? I'll follow up from there.

@stanconia
Copy link
Contributor Author

hey, sorry merged amother PRs and caused conflicts. mind resolve it? I'll follow up from there.

@HaoXuAI resolved conflicts please approve

Copy link
Collaborator

@HaoXuAI HaoXuAI left a comment

Choose a reason for hiding this comment

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

lgtm

@stanconia
Copy link
Contributor Author

lgtm

@tokoko please review.

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
Copy link
Collaborator

@tokoko tokoko 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: Stanley Opara <a-sopara@expediagroup.com>
@stanconia
Copy link
Contributor Author

2 workflows awaiting approval

@tokoko how do i get approvals for pending workflows?

@franciscojavierarceo
Copy link
Member

@tokoko can you try /lgtm

@tokoko
Copy link
Collaborator

tokoko commented Jul 4, 2024

/lgtm

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
@stanconia
Copy link
Contributor Author

/lgtm

@tokoko please approve lint workflows

@stanconia
Copy link
Contributor Author

/lgtm

@tokoko please approve lint workflows

@tokoko please can you assist with a merge

@tokoko
Copy link
Collaborator

tokoko commented Jul 9, 2024

@stanconia I don't have merge rights, Francisco can merge as well

@franciscojavierarceo franciscojavierarceo merged commit f569786 into feast-dev:master Jul 9, 2024
15 checks passed
tsisodia10 pushed a commit to tsisodia10/feast that referenced this pull request Jul 23, 2024
* Add sql registry async refresh

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* make refresh code a daemon thread

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Change RegistryConfig to cacheMode

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Only run async when ttl > 0

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* make refresh async run in a loop

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* make refresh async run in a loop

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Reorder async refresh call

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Add documentation

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Update test_universal_registry.py

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Force rerun of tests

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Force rerun of tests

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Format repo config file

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

---------

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
Co-authored-by: Stanley Opara <a-sopara@expediagroup.com>
tsisodia10 pushed a commit to tsisodia10/feast that referenced this pull request Jul 23, 2024
* Add sql registry async refresh

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* make refresh code a daemon thread

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Change RegistryConfig to cacheMode

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Only run async when ttl > 0

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* make refresh async run in a loop

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* make refresh async run in a loop

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Reorder async refresh call

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Add documentation

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Update test_universal_registry.py

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Force rerun of tests

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Force rerun of tests

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Format repo config file

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

---------

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
Co-authored-by: Stanley Opara <a-sopara@expediagroup.com>
nick-amaya-sp pushed a commit to sailpoint/feast that referenced this pull request Jul 23, 2024
* Add sql registry async refresh

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* make refresh code a daemon thread

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Change RegistryConfig to cacheMode

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Only run async when ttl > 0

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* make refresh async run in a loop

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* make refresh async run in a loop

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Reorder async refresh call

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Add documentation

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Update test_universal_registry.py

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Force rerun of tests

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Force rerun of tests

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

* Format repo config file

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>

---------

Signed-off-by: Stanley Opara <a-sopara@expediagroup.com>
Co-authored-by: Stanley Opara <a-sopara@expediagroup.com>
franciscojavierarceo pushed a commit that referenced this pull request Jul 31, 2024
# [0.40.0](v0.39.0...v0.40.0) (2024-07-31)

### Bug Fixes

* Added missing type ([#4315](#4315)) ([86af60a](86af60a))
* Avoid XSS attack from Jinjin2's Environment(). ([#4355](#4355)) ([40270e7](40270e7))
* CGO Memory leak issue in GO Feature server ([#4291](#4291)) ([43e198f](43e198f))
* Deprecated the datetime.utcfromtimestamp(). ([#4306](#4306)) ([21deec8](21deec8))
* Fix SQLite import issue ([#4294](#4294)) ([398ea3b](398ea3b))
* Increment operator to v0.39.0 ([#4368](#4368)) ([3ddb4fb](3ddb4fb))
* Minor typo in the unit test. ([#4296](#4296)) ([6c75e84](6c75e84))
* OnDemandFeatureView type inference for array types ([#4310](#4310)) ([c45ff72](c45ff72))
* Remove redundant batching in PostgreSQLOnlineStore.online_write_batch and fix progress bar ([#4331](#4331)) ([0d89d15](0d89d15))
* Remove typo. ([#4351](#4351)) ([92d17de](92d17de))
* Retire the datetime.utcnow(). ([#4352](#4352)) ([a8bc696](a8bc696))
* Update dask version to support pandas 1.x ([#4326](#4326)) ([a639d61](a639d61))
* Update Feast object metadata in the registry ([#4257](#4257)) ([8028ae0](8028ae0))
* Using one single function call for utcnow(). ([#4307](#4307)) ([98ff63c](98ff63c))

### Features

* Add async feature retrieval for Postgres Online Store ([#4327](#4327)) ([cea52e9](cea52e9))
* Add Async refresh to Sql Registry ([#4251](#4251)) ([f569786](f569786))
* Add SingleStore as an OnlineStore ([#4285](#4285)) ([2c38946](2c38946))
* Add Tornike to maintainers.md ([#4339](#4339)) ([8e8c1f2](8e8c1f2))
* Bump psycopg2 to psycopg3 for all Postgres components ([#4303](#4303)) ([9451d9c](9451d9c))
* Entity key deserialization ([#4284](#4284)) ([83fad15](83fad15))
* Ignore paths feast apply ([#4276](#4276)) ([b4d54af](b4d54af))
* Move get_online_features to OnlineStore interface ([#4319](#4319)) ([7072fd0](7072fd0))
* Port mssql contrib offline store to ibis ([#4360](#4360)) ([7914cbd](7914cbd))

### Reverts

* Revert "fix: Avoid XSS attack from Jinjin2's Environment()." ([#4357](#4357)) ([cdeab48](cdeab48)), closes [#4355](#4355)
redhatHameed pushed a commit to RHEcosystemAppEng/feast that referenced this pull request Aug 5, 2024
# [0.40.0](feast-dev/feast@v0.39.0...v0.40.0) (2024-07-31)

### Bug Fixes

* Added missing type ([feast-dev#4315](feast-dev#4315)) ([86af60a](feast-dev@86af60a))
* Avoid XSS attack from Jinjin2's Environment(). ([feast-dev#4355](feast-dev#4355)) ([40270e7](feast-dev@40270e7))
* CGO Memory leak issue in GO Feature server ([feast-dev#4291](feast-dev#4291)) ([43e198f](feast-dev@43e198f))
* Deprecated the datetime.utcfromtimestamp(). ([feast-dev#4306](feast-dev#4306)) ([21deec8](feast-dev@21deec8))
* Fix SQLite import issue ([feast-dev#4294](feast-dev#4294)) ([398ea3b](feast-dev@398ea3b))
* Increment operator to v0.39.0 ([feast-dev#4368](feast-dev#4368)) ([3ddb4fb](feast-dev@3ddb4fb))
* Minor typo in the unit test. ([feast-dev#4296](feast-dev#4296)) ([6c75e84](feast-dev@6c75e84))
* OnDemandFeatureView type inference for array types ([feast-dev#4310](feast-dev#4310)) ([c45ff72](feast-dev@c45ff72))
* Remove redundant batching in PostgreSQLOnlineStore.online_write_batch and fix progress bar ([feast-dev#4331](feast-dev#4331)) ([0d89d15](feast-dev@0d89d15))
* Remove typo. ([feast-dev#4351](feast-dev#4351)) ([92d17de](feast-dev@92d17de))
* Retire the datetime.utcnow(). ([feast-dev#4352](feast-dev#4352)) ([a8bc696](feast-dev@a8bc696))
* Update dask version to support pandas 1.x ([feast-dev#4326](feast-dev#4326)) ([a639d61](feast-dev@a639d61))
* Update Feast object metadata in the registry ([feast-dev#4257](feast-dev#4257)) ([8028ae0](feast-dev@8028ae0))
* Using one single function call for utcnow(). ([feast-dev#4307](feast-dev#4307)) ([98ff63c](feast-dev@98ff63c))

### Features

* Add async feature retrieval for Postgres Online Store ([feast-dev#4327](feast-dev#4327)) ([cea52e9](feast-dev@cea52e9))
* Add Async refresh to Sql Registry ([feast-dev#4251](feast-dev#4251)) ([f569786](feast-dev@f569786))
* Add SingleStore as an OnlineStore ([feast-dev#4285](feast-dev#4285)) ([2c38946](feast-dev@2c38946))
* Add Tornike to maintainers.md ([feast-dev#4339](feast-dev#4339)) ([8e8c1f2](feast-dev@8e8c1f2))
* Bump psycopg2 to psycopg3 for all Postgres components ([feast-dev#4303](feast-dev#4303)) ([9451d9c](feast-dev@9451d9c))
* Entity key deserialization ([feast-dev#4284](feast-dev#4284)) ([83fad15](feast-dev@83fad15))
* Ignore paths feast apply ([feast-dev#4276](feast-dev#4276)) ([b4d54af](feast-dev@b4d54af))
* Move get_online_features to OnlineStore interface ([feast-dev#4319](feast-dev#4319)) ([7072fd0](feast-dev@7072fd0))
* Port mssql contrib offline store to ibis ([feast-dev#4360](feast-dev#4360)) ([7914cbd](feast-dev@7914cbd))

### Reverts

* Revert "fix: Avoid XSS attack from Jinjin2's Environment()." ([feast-dev#4357](feast-dev#4357)) ([cdeab48](feast-dev@cdeab48)), closes [feast-dev#4355](feast-dev#4355)
shuchu pushed a commit to shuchu/feast that referenced this pull request Aug 14, 2024
# [0.40.0](feast-dev/feast@v0.39.0...v0.40.0) (2024-07-31)

### Bug Fixes

* Added missing type ([feast-dev#4315](feast-dev#4315)) ([86af60a](feast-dev@86af60a))
* Avoid XSS attack from Jinjin2's Environment(). ([feast-dev#4355](feast-dev#4355)) ([40270e7](feast-dev@40270e7))
* CGO Memory leak issue in GO Feature server ([feast-dev#4291](feast-dev#4291)) ([43e198f](feast-dev@43e198f))
* Deprecated the datetime.utcfromtimestamp(). ([feast-dev#4306](feast-dev#4306)) ([21deec8](feast-dev@21deec8))
* Fix SQLite import issue ([feast-dev#4294](feast-dev#4294)) ([398ea3b](feast-dev@398ea3b))
* Increment operator to v0.39.0 ([feast-dev#4368](feast-dev#4368)) ([3ddb4fb](feast-dev@3ddb4fb))
* Minor typo in the unit test. ([feast-dev#4296](feast-dev#4296)) ([6c75e84](feast-dev@6c75e84))
* OnDemandFeatureView type inference for array types ([feast-dev#4310](feast-dev#4310)) ([c45ff72](feast-dev@c45ff72))
* Remove redundant batching in PostgreSQLOnlineStore.online_write_batch and fix progress bar ([feast-dev#4331](feast-dev#4331)) ([0d89d15](feast-dev@0d89d15))
* Remove typo. ([feast-dev#4351](feast-dev#4351)) ([92d17de](feast-dev@92d17de))
* Retire the datetime.utcnow(). ([feast-dev#4352](feast-dev#4352)) ([a8bc696](feast-dev@a8bc696))
* Update dask version to support pandas 1.x ([feast-dev#4326](feast-dev#4326)) ([a639d61](feast-dev@a639d61))
* Update Feast object metadata in the registry ([feast-dev#4257](feast-dev#4257)) ([8028ae0](feast-dev@8028ae0))
* Using one single function call for utcnow(). ([feast-dev#4307](feast-dev#4307)) ([98ff63c](feast-dev@98ff63c))

### Features

* Add async feature retrieval for Postgres Online Store ([feast-dev#4327](feast-dev#4327)) ([cea52e9](feast-dev@cea52e9))
* Add Async refresh to Sql Registry ([feast-dev#4251](feast-dev#4251)) ([f569786](feast-dev@f569786))
* Add SingleStore as an OnlineStore ([feast-dev#4285](feast-dev#4285)) ([2c38946](feast-dev@2c38946))
* Add Tornike to maintainers.md ([feast-dev#4339](feast-dev#4339)) ([8e8c1f2](feast-dev@8e8c1f2))
* Bump psycopg2 to psycopg3 for all Postgres components ([feast-dev#4303](feast-dev#4303)) ([9451d9c](feast-dev@9451d9c))
* Entity key deserialization ([feast-dev#4284](feast-dev#4284)) ([83fad15](feast-dev@83fad15))
* Ignore paths feast apply ([feast-dev#4276](feast-dev#4276)) ([b4d54af](feast-dev@b4d54af))
* Move get_online_features to OnlineStore interface ([feast-dev#4319](feast-dev#4319)) ([7072fd0](feast-dev@7072fd0))
* Port mssql contrib offline store to ibis ([feast-dev#4360](feast-dev#4360)) ([7914cbd](feast-dev@7914cbd))

### Reverts

* Revert "fix: Avoid XSS attack from Jinjin2's Environment()." ([feast-dev#4357](feast-dev#4357)) ([cdeab48](feast-dev@cdeab48)), closes [feast-dev#4355](feast-dev#4355)
@franciscojavierarceo
Copy link
Member

Hi @stanconia I was going to give you a shoutout in the latest food newsletter if you wanted on. Feel free to add your name here: https://docs.google.com/document/d/1sKD1Lt3h4G9vzitbgoOwNX9uOrLCjdzw4bJnUIO4ixU/edit#bookmark=id.909bt66x3owh

@stanconia
Copy link
Contributor Author

stanconia commented Aug 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants