Skip to content

Commit

Permalink
fix: Made fixes to Go Operator DB persistence (feast-dev#4830)
Browse files Browse the repository at this point in the history
* Made fixes to Go Operator DB persistence

Signed-off-by: Theodor Mihalache <[email protected]>

* Fixes following review

Signed-off-by: Theodor Mihalache <[email protected]>

---------

Signed-off-by: Theodor Mihalache <[email protected]>
  • Loading branch information
tmihalac authored and dharmisha committed Jan 15, 2025
1 parent 117d464 commit 8b7a98f
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 25 deletions.
23 changes: 21 additions & 2 deletions infra/feast-operator/api/v1alpha1/featurestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,15 @@ type OfflineStorePersistence struct {

// OfflineStoreFilePersistence configures the file-based persistence for the offline store service
type OfflineStoreFilePersistence struct {
<<<<<<< HEAD
<<<<<<< HEAD
// +kubebuilder:validation:Enum=file;dask;duckdb
=======
// +kubebuilder:validation:Enum=dask;duckdb
>>>>>>> 6c1a66ea8 (feat: PVC configuration and impl (#4750))
=======
// +kubebuilder:validation:Enum=file;dask;duckdb
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
Type string `json:"type,omitempty"`
PvcConfig *PvcConfig `json:"pvc,omitempty"`
}
Expand All @@ -128,6 +132,7 @@ var ValidOfflineStoreFilePersistenceTypes = []string{
"dask",
"duckdb",
"file",
<<<<<<< HEAD
}

// OfflineStoreDBStorePersistence configures the DB store persistence for the offline store service
Expand All @@ -150,11 +155,13 @@ var ValidOfflineStoreDBStorePersistenceTypes = []string{
"redis",
"athena",
"mssql",
=======
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
}

// OfflineStoreDBStorePersistence configures the DB store persistence for the offline store service
type OfflineStoreDBStorePersistence struct {
// +kubebuilder:validation:Enum=snowflake.offline;bigquery;redshift;spark;postgres;feast_trino.trino.TrinoOfflineStore;redis
// +kubebuilder:validation:Enum=snowflake.offline;bigquery;redshift;spark;postgres;trino;redis;athena;mssql
Type string `json:"type"`
// Data store parameters should be placed as-is from the "feature_store.yaml" under the secret key. "registry_type" & "type" fields should be removed.
SecretRef corev1.LocalObjectReference `json:"secretRef"`
Expand All @@ -168,8 +175,10 @@ var ValidOfflineStoreDBStorePersistenceTypes = []string{
"redshift",
"spark",
"postgres",
"feast_trino.trino.TrinoOfflineStore",
"trino",
"redis",
"athena",
"mssql",
}

// OnlineStore configures the deployed online store service
Expand Down Expand Up @@ -215,8 +224,12 @@ type OnlineStoreFilePersistence struct {

// OnlineStoreDBStorePersistence configures the DB store persistence for the offline store service
type OnlineStoreDBStorePersistence struct {
<<<<<<< HEAD
<<<<<<< HEAD
// +kubebuilder:validation:Enum=snowflake.online;redis;ikv;datastore;dynamodb;bigtable;postgres;cassandra;mysql;hazelcast;singlestore;hbase;elasticsearch;qdrant;couchbase;milvus
=======
// +kubebuilder:validation:Enum=snowflake.online;redis;ikv;datastore;dynamodb;bigtable;postgres;cassandra;mysql;hazelcast;singlestore;hbase;elasticsearch;qdrant;couchbase
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
Type string `json:"type"`
// Data store parameters should be placed as-is from the "feature_store.yaml" under the secret key. "registry_type" & "type" fields should be removed.
SecretRef corev1.LocalObjectReference `json:"secretRef"`
Expand Down Expand Up @@ -257,10 +270,14 @@ var ValidOnlineStoreDBStorePersistenceTypes = []string{
"hazelcast",
"singlestore",
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
"hbase",
"elasticsearch",
"qdrant",
"couchbase",
<<<<<<< HEAD
"milvus",
=======
type OnlineStoreFilePersistence struct {
Expand All @@ -269,6 +286,8 @@ type OnlineStoreFilePersistence struct {
>>>>>>> 6c1a66ea8 (feat: PVC configuration and impl (#4750))
=======
>>>>>>> 863a82cb7 (feat: Added feast Go operator db stores support (#4771))
=======
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
}

// LocalRegistryConfig configures the deployed registry service
Expand Down
14 changes: 14 additions & 0 deletions infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ spec:
- spark
- postgres
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
- trino
- redis
- athena
Expand Down Expand Up @@ -949,6 +952,10 @@ spec:
- mysql
- hazelcast
- singlestore
- hbase
- elasticsearch
- qdrant
- couchbase
type: string
required:
- secretRef
Expand Down Expand Up @@ -2012,6 +2019,9 @@ spec:
- spark
- postgres
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
- trino
- redis
- athena
Expand Down Expand Up @@ -2530,6 +2540,10 @@ spec:
- mysql
- hazelcast
- singlestore
- hbase
- elasticsearch
- qdrant
- couchbase
type: string
required:
- secretRef
Expand Down
14 changes: 14 additions & 0 deletions infra/feast-operator/dist/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@ spec:
- spark
- postgres
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
- trino
- redis
- athena
Expand Down Expand Up @@ -957,6 +960,10 @@ spec:
- mysql
- hazelcast
- singlestore
- hbase
- elasticsearch
- qdrant
- couchbase
type: string
required:
- secretRef
Expand Down Expand Up @@ -2020,6 +2027,9 @@ spec:
- spark
- postgres
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
- trino
- redis
- athena
Expand Down Expand Up @@ -2538,6 +2548,10 @@ spec:
- mysql
- hazelcast
- singlestore
- hbase
- elasticsearch
- qdrant
- couchbase
type: string
required:
- secretRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,15 @@ sqlalchemy_config_kwargs:
pool_pre_ping: true
`

<<<<<<< HEAD
<<<<<<< HEAD
var secretContainingValidTypeYamlString = `
=======
var invalidSecretContainingTypeYamlString = `
>>>>>>> 966b02846 (feat: Updated feast Go operator db stores (#4809))
=======
var secretContainingValidTypeYamlString = `
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
type: cassandra
hosts:
- 192.168.1.1
Expand Down Expand Up @@ -323,6 +327,7 @@ var _ = Describe("FeatureStore Controller - db storage services", func() {

Expect(err.Error()).To(Equal("secret key invalid.secret.key doesn't exist in secret online-store-secret"))

<<<<<<< HEAD
<<<<<<< HEAD
By("Referring to a secret that contains parameter named type with invalid value")
=======
Expand Down Expand Up @@ -354,12 +359,14 @@ var _ = Describe("FeatureStore Controller - db storage services", func() {

Expect(err.Error()).To(Equal("secret key cassandra in secret online-store-secret contains invalid tag named type"))

=======
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
By("Referring to a secret that contains parameter named type with invalid value")
resource = &feastdevv1alpha1.FeatureStore{}
err = k8sClient.Get(ctx, typeNamespacedName, resource)
Expect(err).NotTo(HaveOccurred())

secret = &corev1.Secret{}
secret := &corev1.Secret{}
err = k8sClient.Get(ctx, onlineSecretNamespacedName, secret)
Expect(err).NotTo(HaveOccurred())
>>>>>>> 966b02846 (feat: Updated feast Go operator db stores (#4809))
Expand All @@ -378,6 +385,7 @@ var _ = Describe("FeatureStore Controller - db storage services", func() {
})
Expect(err).To(HaveOccurred())

<<<<<<< HEAD
<<<<<<< HEAD
Expect(err.Error()).To(Equal("secret key cassandra in secret online-store-secret contains tag named type with value wrong"))
=======
Expand Down Expand Up @@ -415,6 +423,9 @@ var _ = Describe("FeatureStore Controller - db storage services", func() {

Expect(err.Error()).To(Equal("secret key sql in secret registry-store-secret contains invalid tag named registry_type"))
>>>>>>> 966b02846 (feat: Updated feast Go operator db stores (#4809))
=======
Expect(err.Error()).To(Equal("secret key cassandra in secret online-store-secret contains tag named type with value wrong"))
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
})

It("should successfully reconcile the resource", func() {
Expand Down Expand Up @@ -550,6 +561,9 @@ var _ = Describe("FeatureStore Controller - db storage services", func() {
Expect(controllerutil.HasControllerReference(svc)).To(BeTrue())
Expect(svc.Spec.Ports[0].TargetPort).To(Equal(intstr.FromInt(int(services.FeastServiceConstants[services.RegistryFeastType].TargetHttpPort))))
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))

By("Referring to a secret that contains parameter named type")
resource = &feastdevv1alpha1.FeatureStore{}
Expand Down Expand Up @@ -604,8 +618,11 @@ var _ = Describe("FeatureStore Controller - db storage services", func() {
NamespacedName: typeNamespacedName,
})
Expect(err).To(Not(HaveOccurred()))
<<<<<<< HEAD
=======
>>>>>>> 966b02846 (feat: Updated feast Go operator db stores (#4809))
=======
>>>>>>> 4b8378c2a (fix: Made fixes to Go Operator DB persistence (#4830))
})

It("should properly encode a feature_store.yaml config", func() {
Expand Down
Loading

0 comments on commit 8b7a98f

Please sign in to comment.