Skip to content

Commit 3302363

Browse files
authored
feat: Added feast Go operator db stores support (#4771)
* Add support for db stores in feast go operator Signed-off-by: Theodor Mihalache <[email protected]> * Added CR example for store persistence Signed-off-by: Theodor Mihalache <[email protected]> * Fixed incorrect yaml tag in RegistryConfig struct Signed-off-by: Theodor Mihalache <[email protected]> * Removed leftovers comments from hasAttrib function Signed-off-by: Theodor Mihalache <[email protected]> * Added another check that object parameter type is the same as value type in hasAttrib Signed-off-by: Theodor Mihalache <[email protected]> * Reverted latest commit Signed-off-by: Theodor Mihalache <[email protected]> --------- Signed-off-by: Theodor Mihalache <[email protected]>
1 parent d2ba4ef commit 3302363

16 files changed

Lines changed: 1176 additions & 163 deletions

‎infra/feast-operator/api/v1alpha1/featurestore_types.go‎

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ type OfflineStore struct {
7575
}
7676

7777
// OfflineStorePersistence configures the persistence settings for the offline store service
78+
// +kubebuilder:validation:XValidation:rule="[has(self.file), has(self.store)].exists_one(c, c)",message="One selection required between file or store."
7879
type OfflineStorePersistence struct {
79-
FilePersistence *OfflineStoreFilePersistence `json:"file,omitempty"`
80+
FilePersistence *OfflineStoreFilePersistence `json:"file,omitempty"`
81+
DBPersistence *OfflineStoreDBStorePersistence `json:"store,omitempty"`
8082
}
8183

82-
// OfflineStorePersistence configures the file-based persistence for the offline store service
84+
// OfflineStoreFilePersistence configures the file-based persistence for the offline store service
8385
type OfflineStoreFilePersistence struct {
8486
// +kubebuilder:validation:Enum=dask;duckdb
8587
Type string `json:"type,omitempty"`
@@ -91,15 +93,35 @@ var ValidOfflineStoreFilePersistenceTypes = []string{
9193
"duckdb",
9294
}
9395

96+
// OfflineStoreDBStorePersistence configures the DB store persistence for the offline store service
97+
type OfflineStoreDBStorePersistence struct {
98+
// +kubebuilder:validation:Enum=snowflake.offline;bigquery;redshift;spark;postgres;feast_trino.trino.TrinoOfflineStore;redis
99+
Type string `json:"type,omitempty"`
100+
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
101+
SecretKeyName string `json:"secretKeyName,omitempty"`
102+
}
103+
104+
var ValidOfflineStoreDBStorePersistenceTypes = []string{
105+
"snowflake.offline",
106+
"bigquery",
107+
"redshift",
108+
"spark",
109+
"postgres",
110+
"feast_trino.trino.TrinoOfflineStore",
111+
"redis",
112+
}
113+
94114
// OnlineStore configures the deployed online store service
95115
type OnlineStore struct {
96116
ServiceConfigs `json:",inline"`
97117
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
98118
}
99119

100120
// OnlineStorePersistence configures the persistence settings for the online store service
121+
// +kubebuilder:validation:XValidation:rule="[has(self.file), has(self.store)].exists_one(c, c)",message="One selection required between file or store."
101122
type OnlineStorePersistence struct {
102-
FilePersistence *OnlineStoreFilePersistence `json:"file,omitempty"`
123+
FilePersistence *OnlineStoreFilePersistence `json:"file,omitempty"`
124+
DBPersistence *OnlineStoreDBStorePersistence `json:"store,omitempty"`
103125
}
104126

105127
// OnlineStoreFilePersistence configures the file-based persistence for the offline store service
@@ -111,6 +133,28 @@ type OnlineStoreFilePersistence struct {
111133
PvcConfig *PvcConfig `json:"pvc,omitempty"`
112134
}
113135

136+
// OnlineStoreDBStorePersistence configures the DB store persistence for the offline store service
137+
type OnlineStoreDBStorePersistence struct {
138+
// +kubebuilder:validation:Enum=snowflake.online;redis;ikv;datastore;dynamodb;bigtable;postgres;cassandra;mysql;hazelcast;singlestore
139+
Type string `json:"type,omitempty"`
140+
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
141+
SecretKeyName string `json:"secretKeyName,omitempty"`
142+
}
143+
144+
var ValidOnlineStoreDBStorePersistenceTypes = []string{
145+
"snowflake.online",
146+
"redis",
147+
"ikv",
148+
"datastore",
149+
"dynamodb",
150+
"bigtable",
151+
"postgres",
152+
"cassandra",
153+
"mysql",
154+
"hazelcast",
155+
"singlestore",
156+
}
157+
114158
// LocalRegistryConfig configures the deployed registry service
115159
type LocalRegistryConfig struct {
116160
ServiceConfigs `json:",inline"`
@@ -119,7 +163,8 @@ type LocalRegistryConfig struct {
119163

120164
// RegistryPersistence configures the persistence settings for the registry service
121165
type RegistryPersistence struct {
122-
FilePersistence *RegistryFilePersistence `json:"file,omitempty"`
166+
FilePersistence *RegistryFilePersistence `json:"file,omitempty"`
167+
DBPersistence *RegistryDBStorePersistence `json:"store,omitempty"`
123168
}
124169

125170
// RegistryFilePersistence configures the file-based persistence for the registry service
@@ -133,6 +178,19 @@ type RegistryFilePersistence struct {
133178
S3AdditionalKwargs *map[string]string `json:"s3_additional_kwargs,omitempty"`
134179
}
135180

181+
// RegistryDBStorePersistence configures the DB store persistence for the registry service
182+
type RegistryDBStorePersistence struct {
183+
// +kubebuilder:validation:Enum=sql;snowflake.registry
184+
Type string `json:"type,omitempty"`
185+
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
186+
SecretKeyName string `json:"secretKeyName,omitempty"`
187+
}
188+
189+
var ValidRegistryDBStorePersistenceTypes = []string{
190+
"snowflake.registry",
191+
"sql",
192+
}
193+
136194
// PvcConfig defines the settings for a persistent file store based on PVCs.
137195
// We can refer to an existing PVC using the `Ref` field, or create a new one using the `Create` field.
138196
// +kubebuilder:validation:XValidation:rule="[has(self.ref), has(self.create)].exists_one(c, c)",message="One selection is required between ref and create."

‎infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go‎

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)