Skip to content

Commit

Permalink
feat: Add online/offline replica support (feast-dev#4812)
Browse files Browse the repository at this point in the history
* added replica support to online/offline store services

Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>

* Removed unneaded if statement

Co-authored-by: Tommy Hughes IV <tchughesiv@gmail.com>
Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>

* fixed missing bracket

Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>

* added doc comments describing replicas

Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>

* Replicas doc wording change

Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>

---------

Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>
Co-authored-by: Tommy Hughes IV <tchughesiv@gmail.com>
  • Loading branch information
2 people authored and dharmisha committed Jan 15, 2025
1 parent 9a23e03 commit 67a9955
Show file tree
Hide file tree
Showing 13 changed files with 299 additions and 4 deletions.
20 changes: 20 additions & 0 deletions infra/feast-operator/api/v1alpha1/featurestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type FeatureStoreServices struct {

// OfflineStore configures the deployed offline store service
type OfflineStore struct {
<<<<<<< HEAD
ServiceConfigs `json:",inline"`
Persistence *OfflineStorePersistence `json:"persistence,omitempty"`
<<<<<<< HEAD
Expand All @@ -92,6 +93,11 @@ type OfflineStore struct {
LogLevel string `json:"logLevel,omitempty"`
=======
TLS *OfflineTlsConfigs `json:"tls,omitempty"`
=======
StoreServiceConfigs `json:",inline"`
Persistence *OfflineStorePersistence `json:"persistence,omitempty"`
TLS *OfflineTlsConfigs `json:"tls,omitempty"`
>>>>>>> 47204bcaf (feat: Add online/offline replica support (#4812))
// 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 @@ -183,13 +189,19 @@ var ValidOfflineStoreDBStorePersistenceTypes = []string{

// OnlineStore configures the deployed online store service
type OnlineStore struct {
<<<<<<< HEAD
ServiceConfigs `json:",inline"`
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
TLS *TlsConfigs `json:"tls,omitempty"`
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> fb0874ae1 (feat: Feast Operator support log level configuration for services (#4808))
=======
StoreServiceConfigs `json:",inline"`
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
TLS *TlsConfigs `json:"tls,omitempty"`
>>>>>>> 47204bcaf (feat: Add online/offline replica support (#4812))
// 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 Down Expand Up @@ -462,6 +474,14 @@ 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: 23 additions & 2 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.

24 changes: 24 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 @@ -467,6 +467,12 @@ 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 @@ -965,6 +971,12 @@ 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 @@ -2047,6 +2059,12 @@ 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 @@ -2554,6 +2572,12 @@ 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
24 changes: 24 additions & 0 deletions infra/feast-operator/dist/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,12 @@ 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 @@ -973,6 +979,12 @@ 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 @@ -2055,6 +2067,12 @@ 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 @@ -2562,6 +2580,12 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ var _ = Describe("FeatureStore Controller - db storage services", func() {
Context("When deploying a resource with all db storage services", func() {
const resourceName = "cr-name"
var pullPolicy = corev1.PullAlways
var replicas = int32(1)

ctx := context.Background()

Expand Down Expand Up @@ -221,8 +222,12 @@ var _ = Describe("FeatureStore Controller - db storage services", func() {
By("creating the custom resource for the Kind FeatureStore")
err = k8sClient.Get(ctx, typeNamespacedName, featurestore)
if err != nil && errors.IsNotFound(err) {
<<<<<<< HEAD
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{})
>>>>>>> 966b02846 (feat: Updated feast Go operator db stores (#4809))
=======
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{})
>>>>>>> 47204bcaf (feat: Add online/offline replica support (#4812))
resource.Spec.Services.OfflineStore.Persistence = &feastdevv1alpha1.OfflineStorePersistence{
DBPersistence: &feastdevv1alpha1.OfflineStoreDBStorePersistence{
Type: string(offlineType),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
const offlineType = "duckdb"
>>>>>>> 668d47b8e (feat: Add TLS support to the Operator (#4796))
var pullPolicy = corev1.PullAlways
var replicas = int32(1)
var testEnvVarName = "testEnvVarName"
var testEnvVarValue = "testEnvVarValue"

Expand Down Expand Up @@ -89,10 +90,14 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
By("creating the custom resource for the Kind FeatureStore")
err := k8sClient.Get(ctx, typeNamespacedName, featurestore)
if err != nil && errors.IsNotFound(err) {
<<<<<<< HEAD
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
<<<<<<< HEAD
{Name: "fieldRefName", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "metadata.namespace"}}}}, withEnvFrom())
=======
=======
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
>>>>>>> 47204bcaf (feat: Add online/offline replica support (#4812))
{Name: "fieldRefName", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "metadata.namespace"}}}})
>>>>>>> 6c1a66ea8 (feat: PVC configuration and impl (#4750))
resource.Spec.Services.OfflineStore.Persistence = &feastdevv1alpha1.OfflineStorePersistence{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var _ = Describe("FeatureStore Controller-Kubernetes authorization", func() {
Context("When deploying a resource with all ephemeral services and Kubernetes authorization", func() {
const resourceName = "kubernetes-authorization"
var pullPolicy = corev1.PullAlways
var replicas = int32(1)

ctx := context.Background()

Expand All @@ -70,8 +71,12 @@ var _ = Describe("FeatureStore Controller-Kubernetes authorization", func() {
By("creating the custom resource for the Kind FeatureStore")
err := k8sClient.Get(ctx, typeNamespacedName, featurestore)
if err != nil && errors.IsNotFound(err) {
<<<<<<< HEAD
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{})
>>>>>>> 39eb4d80c (feat: RBAC Authorization in Feast Operator (#4786))
=======
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{})
>>>>>>> 47204bcaf (feat: Add online/offline replica support (#4812))
resource.Spec.AuthzConfig = &feastdevv1alpha1.AuthzConfig{KubernetesAuthz: &feastdevv1alpha1.KubernetesAuthz{
Roles: roles,
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
Context("When deploying a resource with all ephemeral services", func() {
const resourceName = "services-object-store"
var pullPolicy = corev1.PullAlways
var replicas = int32(1)
var testEnvVarName = "testEnvVarName"
var testEnvVarValue = "testEnvVarValue"

Expand All @@ -79,10 +80,14 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
By("creating the custom resource for the Kind FeatureStore")
err := k8sClient.Get(ctx, typeNamespacedName, featurestore)
if err != nil && errors.IsNotFound(err) {
<<<<<<< HEAD
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
<<<<<<< HEAD
{Name: "fieldRefName", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "metadata.namespace"}}}}, withEnvFrom())
=======
=======
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
>>>>>>> 47204bcaf (feat: Add online/offline replica support (#4812))
{Name: "fieldRefName", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "metadata.namespace"}}}})
>>>>>>> bc64ddfac (feat: Object store persistence in operator (#4758))
resource.Spec.Services.OnlineStore = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var _ = Describe("FeatureStore Controller-OIDC authorization", func() {
const resourceName = "oidc-authorization"
const oidcSecretName = "oidc-secret"
var pullPolicy = corev1.PullAlways
var replicas = int32(1)

ctx := context.Background()

Expand Down Expand Up @@ -81,8 +82,12 @@ var _ = Describe("FeatureStore Controller-OIDC authorization", func() {
By("creating the custom resource for the Kind FeatureStore")
err = k8sClient.Get(ctx, typeNamespacedName, featurestore)
if err != nil && errors.IsNotFound(err) {
<<<<<<< HEAD
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{})
>>>>>>> cd341f8f6 (feat: OIDC authorization in Feast Operator (#4801))
=======
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{})
>>>>>>> 47204bcaf (feat: Add online/offline replica support (#4812))
resource.Spec.AuthzConfig = &feastdevv1alpha1.AuthzConfig{OidcAuthz: &feastdevv1alpha1.OidcAuthz{
SecretRef: corev1.LocalObjectReference{
Name: oidcSecretName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
Context("When deploying a resource with all ephemeral services", func() {
const resourceName = "services-pvc"
var pullPolicy = corev1.PullAlways
var replicas = int32(1)
var testEnvVarName = "testEnvVarName"
var testEnvVarValue = "testEnvVarValue"

Expand Down Expand Up @@ -93,10 +94,14 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
By("creating the custom resource for the Kind FeatureStore")
err := k8sClient.Get(ctx, typeNamespacedName, featurestore)
if err != nil && errors.IsNotFound(err) {
<<<<<<< HEAD
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
<<<<<<< HEAD
{Name: "fieldRefName", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "metadata.namespace"}}}}, withEnvFrom())
=======
=======
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
>>>>>>> 47204bcaf (feat: Add online/offline replica support (#4812))
{Name: "fieldRefName", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "metadata.namespace"}}}})
>>>>>>> 6c1a66ea8 (feat: PVC configuration and impl (#4750))
resource.Spec.Services.OfflineStore.Persistence = &feastdevv1alpha1.OfflineStorePersistence{
Expand Down
Loading

0 comments on commit 67a9955

Please sign in to comment.