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: Added feast Go operator db stores support #4771

Merged
merged 6 commits into from
Nov 26, 2024

Conversation

tmihalac
Copy link
Contributor

@tmihalac tmihalac commented Nov 19, 2024

What this PR does / why we need it:

This PR adds db stores persistence configuration options to the FeatureStore CRD.
DB store para

  • Support is provided to the Online service, Offline service and Registry service.
  • Follows definitions in RFC #42
  • Configuration examples are provided in config/samples
kind: FeatureStore
metadata:
  name: sample-s3-registry
spec:
  feastProject: my_project
  services:
    onlineStore:
      persistence:
        store:
          type: postgres
          secretRef: 
            name: _SECRET_NAME_ # Secret keys should be placed as-is under the `type` (e.g postgres) key or under the secretKeyName if specified
          secretKeyName: my-postgres # The secret key the db parameters are in (optional parameter)
    offlineStore:
      persistence:
        store:
          type: postgres
          secretRef: 
            name: _SECRET_NAME_ # Secret keys should be placed as-is under the `type` (e.g postgres) key or under the secretKeyName if specified
          secretKeyName: my-postgres # The secret key the db parameters are in (optional parameter)
    registry:
      local:
        persistence:
          store:
            type: sql
            secretRef: 
              name: _SECRET_NAME_ # Secret keys should be placed as-is under the `type` (e.g sql) key or under the secretKeyName if specified
            secretKeyName: my-postgres # The secret key the db parameters are in (optional parameter)
kind: Secret
apiVersion: v1
metadata:
  name: my-secret
  namespace: test
  uid: b410b5e5-857b-4611-acc3-1302b8c6c68c
  resourceVersion: '62030'
  creationTimestamp: '2024-11-19T20:25:15Z'
  managedFields:
    - manager: kubectl-create
      operation: Update
      apiVersion: v1
      time: '2024-11-19T20:25:15Z'
      fieldsType: FieldsV1
      fieldsV1:
        'f:data':
          .: {}
          'f:mykey': {}
        'f:type': {}
data:
  postgres: |
    host: DB_HOST
    port: DB_PORT
    database: DB_NAME
    db_schema: DB_SCHEMA
    user: DB_USERNAME
    password: DB_PASSWORD
    sslmode: verify-ca
    sslkey_path: /path/to/client-key.pem
    sslcert_path: /path/to/client-cert.pem
    sslrootcert_path: /path/to/server-ca.pem
  sql: |
    path: postgresql://postgres:mysecretpassword@127.0.0.1:55001/feast
    cache_ttl_seconds: 60
    sqlalchemy_config_kwargs:
        echo: false
        pool_pre_ping: true
type: Opaque

Which issue(s) this PR fixes:

Relates to #4783

@tmihalac tmihalac requested a review from a team as a code owner November 19, 2024 21:12
@dmartinol
Copy link
Contributor

@tmihalac the issue you are referring to is already closed. @tchughesiv should we create a new one or reopen it?

@dmartinol
Copy link
Contributor

In the description, the postgres type is not supported by registry, pls change it to sql (and also add a sql key to the secret name)

    registry:
      local:
        persistence:
          store:
          type: postgres

@tchughesiv
Copy link
Contributor

@tmihalac @dmartinol we should be opening new issues for operator PRs

Copy link
Contributor

@tchughesiv tchughesiv left a comment

Choose a reason for hiding this comment

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

@tmihalac please rebase on master branch

@tmihalac tmihalac force-pushed the go-operator-db-stores branch 2 times, most recently from 59a08d7 to 8a4fd21 Compare November 21, 2024 18:27
Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
@tchughesiv
Copy link
Contributor

@tmihalac please open a new gh issue for this PR

@tchughesiv
Copy link
Contributor

@tmihalac should your descrip example be fixed? i'd imagine it will look like this? with the secretKeyName pulled back to under store?

kind: FeatureStore
metadata:
  name: sample-s3-registry
spec:
  feastProject: my_project
  services:
    onlineStore:
      persistence:
        store:
          type: postgres
          secretRef: 
            name: _SECRET_NAME_ # Secret keys should be placed as-is under the `type` (e.g postgres) key or under the secretKeyName if specified
          secretKeyName: my-postgres # The secret key the db parameters are in (optional parameter)

@tmihalac
Copy link
Contributor Author

@tmihalac should your descrip example be fixed? i'd imagine it will look like this? with the secretKeyName pulled back to under store?

kind: FeatureStore
metadata:
  name: sample-s3-registry
spec:
  feastProject: my_project
  services:
    onlineStore:
      persistence:
        store:
          type: postgres
          secretRef: 
            name: _SECRET_NAME_ # Secret keys should be placed as-is under the `type` (e.g postgres) key or under the secretKeyName if specified
          secretKeyName: my-postgres # The secret key the db parameters are in (optional parameter)

You are right fixing it now

@tmihalac
Copy link
Contributor Author

Done

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
@shuchu
Copy link
Collaborator

shuchu commented Nov 25, 2024

Hi team, I see a lot of contributions here! but please beware that there is a PR which will have lots of Golang code change: #4665

…ype in hasAttrib

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
@dmartinol
Copy link
Contributor

Hi team, I see a lot of contributions here! but please beware that there is a PR which will have lots of Golang code change: #4665

@shuchu I hope the operator lives in a separate folder of the repo, so we're not expecting any "interference" from the other PR. These components seem to be independent of each other, but please advise if you think there is something we should look at instead. Thanks!

@dmartinol
Copy link
Contributor

In the description, the postgres type is not supported by registry, pls change it to sql (and also add a sql key to the secret name)
@tmihalac be aware that the example in the description refers to a secretKeyName: my-postgres that does not exist in the given Secret. Also, for the registry you should use the default key name, e.g. sql instead of either postgres or my-postgres.

@dmartinol dmartinol mentioned this pull request Nov 26, 2024
@dmartinol
Copy link
Contributor

Leftovers are tracked in #4793

@dmartinol dmartinol merged commit 3302363 into feast-dev:master Nov 26, 2024
19 of 20 checks passed
@shuchu
Copy link
Collaborator

shuchu commented Nov 27, 2024

Hi team, I see a lot of contributions here! but please beware that there is a PR which will have lots of Golang code change: #4665

@shuchu I hope the operator lives in a separate folder of the repo, so we're not expecting any "interference" from the other PR. These components seem to be independent of each other, but please advise if you think there is something we should look at instead. Thanks!

sorry, my bad. I didn't pay attention to the folder structure. No advisee from my side. Actually I'm learning form the code write by you all as I'm starting to write Golang codes.

lokeshrangineni pushed a commit to lokeshrangineni/feast that referenced this pull request Dec 2, 2024
* Add support for db stores in feast go operator

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Added CR example for store persistence

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Fixed incorrect yaml tag in RegistryConfig struct

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Removed leftovers comments from hasAttrib function

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Added another check that object parameter type is the same as value type in hasAttrib

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Reverted latest commit

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

---------

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
tmihalac added a commit to tmihalac/feast that referenced this pull request Dec 3, 2024
* Add support for db stores in feast go operator

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Added CR example for store persistence

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Fixed incorrect yaml tag in RegistryConfig struct

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Removed leftovers comments from hasAttrib function

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Added another check that object parameter type is the same as value type in hasAttrib

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Reverted latest commit

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

---------

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
tmihalac added a commit to tmihalac/feast that referenced this pull request Dec 4, 2024
* Add support for db stores in feast go operator

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Added CR example for store persistence

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Fixed incorrect yaml tag in RegistryConfig struct

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Removed leftovers comments from hasAttrib function

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Added another check that object parameter type is the same as value type in hasAttrib

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

* Reverted latest commit

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>

---------

Signed-off-by: Theodor Mihalache <tmihalac@redhat.com>
franciscojavierarceo pushed a commit that referenced this pull request Dec 5, 2024
# [0.42.0](v0.41.0...v0.42.0) (2024-12-05)

### Bug Fixes

* Add adapters for sqlite datetime conversion ([#4797](#4797)) ([e198b17](e198b17))
* Added grpcio extras to default feature-server image ([#4737](#4737)) ([e9cd373](e9cd373))
* Changing node version in release ([7089918](7089918))
* Feast create empty online table when FeatureView attribute online=False ([#4666](#4666)) ([237c453](237c453))
* Fix db store types in Operator CRD ([#4798](#4798)) ([f09339e](f09339e))
* Fix the config issue for postgres ([#4776](#4776)) ([a36f7e5](a36f7e5))
* Fixed example materialize-incremental and improved explanation ([#4734](#4734)) ([ca8a7ab](ca8a7ab))
* Fixed SparkSource docstrings so it wouldn't used inhereted class docstrings ([#4722](#4722)) ([32e6aa1](32e6aa1))
* Fixing PGVector integration tests ([#4778](#4778)) ([88a0320](88a0320))
* Incorrect type passed to assert_permissions in materialize endpoints ([#4727](#4727)) ([b72c2da](b72c2da))
* Issue of DataSource subclasses using parent abstract class docstrings ([#4730](#4730)) ([b24acd5](b24acd5))
* Operator envVar positioning & tls.SecretRef.Name ([#4806](#4806)) ([1115d96](1115d96))
* Populates project created_time correctly according to created ti… ([#4686](#4686)) ([a61b93c](a61b93c))
* Reduce feast-server container image size & fix dev image build ([#4781](#4781)) ([ccc9aea](ccc9aea))
* Removed version func from feature_store.py ([#4748](#4748)) ([f902bb9](f902bb9))
* Support registry instantiation for read-only users ([#4719](#4719)) ([ca3d3c8](ca3d3c8))
* Syntax Error in BigQuery While Retrieving Columns that Start wit… ([#4713](#4713)) ([60fbc62](60fbc62))
* Update release version in a pertinent Operator file ([#4708](#4708)) ([764a8a6](764a8a6))

### Features

* Add api contract to fastapi docs ([#4721](#4721)) ([1a165c7](1a165c7))
* Add Couchbase as an online store ([#4637](#4637)) ([824859b](824859b))
* Add Operator support for spec.feastProject & status.applied fields ([#4656](#4656)) ([430ac53](430ac53))
* Add services functionality to Operator ([#4723](#4723)) ([d1d80c0](d1d80c0))
* Add TLS support to the Operator ([#4796](#4796)) ([a617a6c](a617a6c))
* Added feast Go operator db stores support ([#4771](#4771)) ([3302363](3302363))
* Added support for setting env vars in feast services in feast controller  ([#4739](#4739)) ([84b24b5](84b24b5))
* Adding docs outlining native Python transformations on singletons ([#4741](#4741)) ([0150278](0150278))
* Adding first feast operator e2e test. ([#4791](#4791)) ([8339f8d](8339f8d))
* Adding github action to run the operator end-to-end tests. ([#4762](#4762)) ([d8ccb00](d8ccb00))
* Adding ssl support for registry server. ([#4718](#4718)) ([ccf7a55](ccf7a55))
* Adding SSL support for the React UI server and feast UI command. ([#4736](#4736)) ([4a89252](4a89252))
* Adding support for native Python transformations on a single dictionary  ([#4724](#4724)) ([9bbc1c6](9bbc1c6))
* Adding TLS support for offline server. ([#4744](#4744)) ([5d8d03f](5d8d03f))
* Building the feast image ([#4775](#4775)) ([6635dde](6635dde))
* File persistence definition and implementation ([#4742](#4742)) ([3bad4a1](3bad4a1))
* Object store persistence in operator ([#4758](#4758)) ([0ae86da](0ae86da))
* OIDC authorization in Feast Operator ([#4801](#4801)) ([eb111d6](eb111d6))
* Operator will create k8s serviceaccount for each feast service ([#4767](#4767)) ([cde5760](cde5760))
* Printing more verbose logs when we start the offline server  ([#4660](#4660)) ([9d8d3d8](9d8d3d8))
* PVC configuration and impl ([#4750](#4750)) ([785a190](785a190))
* Qdrant vectorstore support ([#4689](#4689)) ([86573d2](86573d2))
* RBAC Authorization in Feast Operator ([#4786](#4786)) ([0ef5acc](0ef5acc))
* Support for nested timestamp fields in Spark Offline store ([#4740](#4740)) ([d4d94f8](d4d94f8))
* Update the go feature server from Expedia code repo. ([#4665](#4665)) ([6406625](6406625))
* Updated feast Go operator db stores ([#4809](#4809)) ([2c5a6b5](2c5a6b5))
* Updated sample secret following review ([#4811](#4811)) ([dc9f825](dc9f825))
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.

5 participants