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

fix: Refactor Operator to deploy all feast services to the same Deployment/Pod #4863

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions infra/feast-operator/api/v1alpha1/featurestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type FeatureStoreSpec struct {
AuthzConfig *AuthzConfig `json:"authz,omitempty"`
}

// FeatureStoreServices defines the desired feast service deployments. ephemeral registry is deployed by default.
// FeatureStoreServices defines the desired feast services. An ephemeral registry is deployed by default.
type FeatureStoreServices struct {
OfflineStore *OfflineStore `json:"offlineStore,omitempty"`
OnlineStore *OnlineStore `json:"onlineStore,omitempty"`
Expand All @@ -74,9 +74,9 @@ type FeatureStoreServices struct {

// OfflineStore configures the deployed offline store service
type OfflineStore struct {
StoreServiceConfigs `json:",inline"`
Persistence *OfflineStorePersistence `json:"persistence,omitempty"`
TLS *TlsConfigs `json:"tls,omitempty"`
ServiceConfigs `json:",inline"`
Persistence *OfflineStorePersistence `json:"persistence,omitempty"`
TLS *TlsConfigs `json:"tls,omitempty"`
// LogLevel sets the logging level for the offline store service
// Allowed values: "debug", "info", "warning", "error", "critical".
// +kubebuilder:validation:Enum=debug;info;warning;error;critical
Expand Down Expand Up @@ -127,9 +127,9 @@ var ValidOfflineStoreDBStorePersistenceTypes = []string{

// OnlineStore configures the deployed online store service
type OnlineStore struct {
StoreServiceConfigs `json:",inline"`
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
TLS *TlsConfigs `json:"tls,omitempty"`
ServiceConfigs `json:",inline"`
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
TLS *TlsConfigs `json:"tls,omitempty"`
// LogLevel sets the logging level for the online store service
// Allowed values: "debug", "info", "warning", "error", "critical".
// +kubebuilder:validation:Enum=debug;info;warning;error;critical
Expand All @@ -146,7 +146,7 @@ type OnlineStorePersistence struct {
// OnlineStoreFilePersistence configures the file-based persistence for the offline store service
// +kubebuilder:validation:XValidation:rule="(!has(self.pvc) && has(self.path)) ? self.path.startsWith('/') : true",message="Ephemeral stores must have absolute paths."
// +kubebuilder:validation:XValidation:rule="(has(self.pvc) && has(self.path)) ? !self.path.startsWith('/') : true",message="PVC path must be a file name only, with no slashes."
// +kubebuilder:validation:XValidation:rule="has(self.path) && !self.path.startsWith('s3://') && !self.path.startsWith('gs://')",message="Online store does not support S3 or GS buckets."
// +kubebuilder:validation:XValidation:rule="has(self.path) ? !(self.path.startsWith('s3://') || self.path.startsWith('gs://')) : true",message="Online store does not support S3 or GS buckets."
type OnlineStoreFilePersistence struct {
Path string `json:"path,omitempty"`
PvcConfig *PvcConfig `json:"pvc,omitempty"`
Expand Down Expand Up @@ -235,11 +235,11 @@ type PvcConfig struct {
Create *PvcCreate `json:"create,omitempty"`
// MountPath within the container at which the volume should be mounted.
// Must start by "/" and cannot contain ':'.
MountPath string `json:"mountPath,omitempty"`
MountPath string `json:"mountPath"`
}

// PvcCreate defines the immutable settings to create a new PVC mounted at the given path.
// The PVC name is the same as the associated deployment name.
// The PVC name is the same as the associated deployment & feast service name.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="PvcCreate is immutable"
type PvcCreate struct {
// AccessModes k8s persistent volume access modes. Defaults to ["ReadWriteOnce"].
Expand Down Expand Up @@ -292,14 +292,6 @@ type DefaultConfigs struct {
Image *string `json:"image,omitempty"`
}

// StoreServiceConfigs k8s deployment settings
type StoreServiceConfigs struct {
// Replicas determines the number of pods for the feast service.
// When Replicas > 1, persistence is recommended.
Replicas *int32 `json:"replicas,omitempty"`
ServiceConfigs `json:",inline"`
}

// OptionalConfigs k8s container settings that are optional
type OptionalConfigs struct {
Env *[]corev1.EnvVar `json:"env,omitempty"`
Expand Down
25 changes: 2 additions & 23 deletions infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ spec:
pattern: ^[A-Za-z0-9][A-Za-z0-9_]*$
type: string
services:
description: FeatureStoreServices defines the desired feast service
deployments. ephemeral registry is deployed by default.
description: FeatureStoreServices defines the desired feast services.
An ephemeral registry is deployed by default.
properties:
offlineStore:
description: OfflineStore configures the deployed offline store
Expand Down Expand Up @@ -318,6 +318,8 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
required:
- mountPath
type: object
x-kubernetes-validations:
- message: One selection is required between ref and
Expand Down Expand Up @@ -375,12 +377,6 @@ spec:
x-kubernetes-validations:
- message: One selection required between file or store.
rule: '[has(self.file), has(self.store)].exists_one(c, c)'
replicas:
description: |-
Replicas determines the number of pods for the feast service.
When Replicas > 1, persistence is recommended.
format: int32
type: integer
resources:
description: ResourceRequirements describes the compute resource
requirements.
Expand Down Expand Up @@ -692,6 +688,8 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
required:
- mountPath
type: object
x-kubernetes-validations:
- message: One selection is required between ref and
Expand All @@ -711,8 +709,8 @@ spec:
rule: '(has(self.pvc) && has(self.path)) ? !self.path.startsWith(''/'')
: true'
- message: Online store does not support S3 or GS buckets.
rule: has(self.path) && !self.path.startsWith('s3://')
&& !self.path.startsWith('gs://')
rule: 'has(self.path) ? !(self.path.startsWith(''s3://'')
|| self.path.startsWith(''gs://'')) : true'
store:
description: OnlineStoreDBStorePersistence configures
the DB store persistence for the offline store service
Expand Down Expand Up @@ -760,12 +758,6 @@ spec:
x-kubernetes-validations:
- message: One selection required between file or store.
rule: '[has(self.file), has(self.store)].exists_one(c, c)'
replicas:
description: |-
Replicas determines the number of pods for the feast service.
When Replicas > 1, persistence is recommended.
format: int32
type: integer
resources:
description: ResourceRequirements describes the compute resource
requirements.
Expand Down Expand Up @@ -1082,6 +1074,8 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
required:
- mountPath
type: object
x-kubernetes-validations:
- message: One selection is required between ref
Expand Down Expand Up @@ -1369,8 +1363,8 @@ spec:
pattern: ^[A-Za-z0-9][A-Za-z0-9_]*$
type: string
services:
description: FeatureStoreServices defines the desired feast service
deployments. ephemeral registry is deployed by default.
description: FeatureStoreServices defines the desired feast services.
An ephemeral registry is deployed by default.
properties:
offlineStore:
description: OfflineStore configures the deployed offline
Expand Down Expand Up @@ -1588,6 +1582,8 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
required:
- mountPath
type: object
x-kubernetes-validations:
- message: One selection is required between ref
Expand Down Expand Up @@ -1647,12 +1643,6 @@ spec:
- message: One selection required between file or store.
rule: '[has(self.file), has(self.store)].exists_one(c,
c)'
replicas:
description: |-
Replicas determines the number of pods for the feast service.
When Replicas > 1, persistence is recommended.
format: int32
type: integer
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -1967,6 +1957,8 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
required:
- mountPath
type: object
x-kubernetes-validations:
- message: One selection is required between ref
Expand All @@ -1987,8 +1979,8 @@ spec:
: true'
- message: Online store does not support S3 or GS
buckets.
rule: has(self.path) && !self.path.startsWith('s3://')
&& !self.path.startsWith('gs://')
rule: 'has(self.path) ? !(self.path.startsWith(''s3://'')
|| self.path.startsWith(''gs://'')) : true'
store:
description: OnlineStoreDBStorePersistence configures
the DB store persistence for the offline store service
Expand Down Expand Up @@ -2038,12 +2030,6 @@ spec:
- message: One selection required between file or store.
rule: '[has(self.file), has(self.store)].exists_one(c,
c)'
replicas:
description: |-
Replicas determines the number of pods for the feast service.
When Replicas > 1, persistence is recommended.
format: int32
type: integer
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -2368,6 +2354,8 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
required:
- mountPath
type: object
x-kubernetes-validations:
- message: One selection is required between
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
spec:
feastProject: my_project
services:
# demonstrates using a pre-existing PVC
onlineStore:
persistence:
file:
Expand All @@ -13,6 +14,7 @@ spec:
ref:
name: online-pvc
mountPath: /data/online
# demonstrates specifying a storageClassName and storage size
offlineStore:
persistence:
file:
Expand All @@ -24,6 +26,7 @@ spec:
requests:
storage: 5Gi
mountPath: /data/offline
# demonstrates letting the Operator create a PVC w/ defaults set
registry:
local:
persistence:
Expand All @@ -39,7 +42,7 @@ metadata:
name: online-pvc
spec:
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: 5Gi
Loading
Loading