Skip to content

Commit 3bad4a1

Browse files
authored
feat: File persistence definition and implementation (#4742)
* File persistence definition and implementation Signed-off-by: Daniele Martinoli <dmartino@redhat.com> * removed optional and default markers Signed-off-by: Daniele Martinoli <dmartino@redhat.com> * removed global cfg variable Signed-off-by: Daniele Martinoli <dmartino@redhat.com> * reviewed ApplyDefaultsToStatus Signed-off-by: Daniele Martinoli <dmartino@redhat.com> * extended checks in ApplyDefaultsToStatus Signed-off-by: Daniele Martinoli <dmartino@redhat.com> * removed var error Signed-off-by: Daniele Martinoli <dmartino@redhat.com> * added IsValidOfflineStoreFilePersistenceType to the API definitions Signed-off-by: Daniele Martinoli <dmartino@redhat.com> * moved IsValidOfflineStoreFilePersistenceType to services package and use it in deploy flow Signed-off-by: Daniele Martinoli <dmartino@redhat.com> * renamed isValidOfflineStoreFilePersistenceType to checkOfflineStoreFilePersistenceType Signed-off-by: Daniele Martinoli <dmartino@redhat.com> * adding controller tests for ephemeral stores Signed-off-by: Daniele Martinoli <dmartino@redhat.com> * using slices package Signed-off-by: Daniele Martinoli <dmartino@redhat.com> --------- Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
1 parent f902bb9 commit 3bad4a1

File tree

15 files changed

+1218
-65
lines changed

15 files changed

+1218
-65
lines changed

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,55 @@ type FeatureStoreServices struct {
7171
// OfflineStore configures the deployed offline store service
7272
type OfflineStore struct {
7373
ServiceConfigs `json:",inline"`
74+
Persistence *OfflineStorePersistence `json:"persistence,omitempty"`
75+
}
76+
77+
// OfflineStorePersistence configures the persistence settings for the offline store service
78+
type OfflineStorePersistence struct {
79+
FilePersistence *OfflineStoreFilePersistence `json:"file,omitempty"`
80+
}
81+
82+
// OfflineStorePersistence configures the file-based persistence for the offline store service
83+
type OfflineStoreFilePersistence struct {
84+
// +kubebuilder:validation:Enum=dask;duckdb
85+
Type string `json:"type,omitempty"`
86+
}
87+
88+
var ValidOfflineStoreFilePersistenceTypes = []string{
89+
"dask",
90+
"duckdb",
7491
}
7592

7693
// OnlineStore configures the deployed online store service
7794
type OnlineStore struct {
7895
ServiceConfigs `json:",inline"`
96+
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
97+
}
98+
99+
// OnlineStorePersistence configures the persistence settings for the online store service
100+
type OnlineStorePersistence struct {
101+
FilePersistence *OnlineStoreFilePersistence `json:"file,omitempty"`
102+
}
103+
104+
// OnlineStoreFilePersistence configures the file-based persistence for the offline store service
105+
type OnlineStoreFilePersistence struct {
106+
Path string `json:"path,omitempty"`
79107
}
80108

81109
// LocalRegistryConfig configures the deployed registry service
82110
type LocalRegistryConfig struct {
83111
ServiceConfigs `json:",inline"`
112+
Persistence *RegistryPersistence `json:"persistence,omitempty"`
113+
}
114+
115+
// RegistryPersistence configures the persistence settings for the registry service
116+
type RegistryPersistence struct {
117+
FilePersistence *RegistryFilePersistence `json:"file,omitempty"`
118+
}
119+
120+
// RegistryFilePersistence configures the file-based persistence for the registry service
121+
type RegistryFilePersistence struct {
122+
Path string `json:"path,omitempty"`
84123
}
85124

86125
// Registry configures the registry service. One selection is required. Local is the default setting.

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

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

infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,21 @@ spec:
181181
description: PullPolicy describes a policy for if/when to
182182
pull a container image
183183
type: string
184+
persistence:
185+
description: OfflineStorePersistence configures the persistence
186+
settings for the offline store service
187+
properties:
188+
file:
189+
description: OfflineStorePersistence configures the file-based
190+
persistence for the offline store service
191+
properties:
192+
type:
193+
enum:
194+
- dask
195+
- duckdb
196+
type: string
197+
type: object
198+
type: object
184199
resources:
185200
description: ResourceRequirements describes the compute resource
186201
requirements.
@@ -361,6 +376,18 @@ spec:
361376
description: PullPolicy describes a policy for if/when to
362377
pull a container image
363378
type: string
379+
persistence:
380+
description: OnlineStorePersistence configures the persistence
381+
settings for the online store service
382+
properties:
383+
file:
384+
description: OnlineStoreFilePersistence configures the
385+
file-based persistence for the offline store service
386+
properties:
387+
path:
388+
type: string
389+
type: object
390+
type: object
364391
resources:
365392
description: ResourceRequirements describes the compute resource
366393
requirements.
@@ -546,6 +573,18 @@ spec:
546573
description: PullPolicy describes a policy for if/when
547574
to pull a container image
548575
type: string
576+
persistence:
577+
description: RegistryPersistence configures the persistence
578+
settings for the registry service
579+
properties:
580+
file:
581+
description: RegistryFilePersistence configures the
582+
file-based persistence for the registry service
583+
properties:
584+
path:
585+
type: string
586+
type: object
587+
type: object
549588
resources:
550589
description: ResourceRequirements describes the compute
551590
resource requirements.
@@ -780,6 +819,21 @@ spec:
780819
description: PullPolicy describes a policy for if/when
781820
to pull a container image
782821
type: string
822+
persistence:
823+
description: OfflineStorePersistence configures the persistence
824+
settings for the offline store service
825+
properties:
826+
file:
827+
description: OfflineStorePersistence configures the
828+
file-based persistence for the offline store service
829+
properties:
830+
type:
831+
enum:
832+
- dask
833+
- duckdb
834+
type: string
835+
type: object
836+
type: object
783837
resources:
784838
description: ResourceRequirements describes the compute
785839
resource requirements.
@@ -962,6 +1016,19 @@ spec:
9621016
description: PullPolicy describes a policy for if/when
9631017
to pull a container image
9641018
type: string
1019+
persistence:
1020+
description: OnlineStorePersistence configures the persistence
1021+
settings for the online store service
1022+
properties:
1023+
file:
1024+
description: OnlineStoreFilePersistence configures
1025+
the file-based persistence for the offline store
1026+
service
1027+
properties:
1028+
path:
1029+
type: string
1030+
type: object
1031+
type: object
9651032
resources:
9661033
description: ResourceRequirements describes the compute
9671034
resource requirements.
@@ -1151,6 +1218,19 @@ spec:
11511218
description: PullPolicy describes a policy for if/when
11521219
to pull a container image
11531220
type: string
1221+
persistence:
1222+
description: RegistryPersistence configures the persistence
1223+
settings for the registry service
1224+
properties:
1225+
file:
1226+
description: RegistryFilePersistence configures
1227+
the file-based persistence for the registry
1228+
service
1229+
properties:
1230+
path:
1231+
type: string
1232+
type: object
1233+
type: object
11541234
resources:
11551235
description: ResourceRequirements describes the compute
11561236
resource requirements.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: feast.dev/v1alpha1
2+
kind: FeatureStore
3+
metadata:
4+
name: sample-ephemeral-persistence
5+
spec:
6+
feastProject: my_project
7+
services:
8+
onlineStore:
9+
persistence:
10+
file:
11+
path: /data/online_store.db
12+
offlineStore:
13+
persistence:
14+
file:
15+
type: dask
16+
registry:
17+
local:
18+
persistence:
19+
file:
20+
path: /data/registry.db

0 commit comments

Comments
 (0)