GeezerVison is showing github.com — feat: Add feast apply init container to automate registry population on pod start by ntkathole · Pull Request #6106 · feast-dev/feast
feat: Add feast apply init container to automate registry population on pod start
#6106
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
Uh oh!
There was an error while loading. Please reload this page.
Show file tree
Hide file tree
Changes from all commits
Commits
File filter
Filter by extension
.baseline
(1)
.go
(13)
.md
(1)
.py
(1)
.yaml
(2)
All 5 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Hide whitespace
Diff view
Hide whitespace
There are no files selected for viewing
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Original file line number
Diff line number
Diff line change
Expand Up
@@ -86,7 +86,7 @@ type FeatureStoreSpec struct {
// Mutually exclusive with services.scaling.autoscaling.
// +kubebuilder:default=1
// +kubebuilder:validation:Minimum=1
Replicas *int32 `json:"replicas"`
Replicas *int32 `json:"replicas,omitempty "`
}
// FeastProjectDir defines how to create the feast project directory.
Expand Down
Expand Up
@@ -310,6 +310,8 @@ type FeatureStoreServices struct {
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
// Disable the 'feast repo initialization' initContainer
DisableInitContainers bool `json:"disableInitContainers,omitempty"`
// Runs feast apply on pod start to populate the registry. Defaults to true. Ignored when DisableInitContainers is true.
RunFeastApplyOnInit *bool `json:"runFeastApplyOnInit,omitempty"`
// Volumes specifies the volumes to mount in the FeatureStore deployment. A corresponding `VolumeMount` should be added to whichever feast service(s) require access to said volume(s).
Volumes []corev1.Volume `json:"volumes,omitempty"`
// Scaling configures horizontal scaling for the FeatureStore deployment (e.g. HPA autoscaling).
Expand Down
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Original file line number
Diff line number
Diff line change
Expand Up
@@ -289,6 +289,8 @@ type FeatureStoreServices struct {
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
// Disable the 'feast repo initialization' initContainer
DisableInitContainers bool `json:"disableInitContainers,omitempty"`
// Runs feast apply on pod start to populate the registry. Defaults to true. Ignored when DisableInitContainers is true.
RunFeastApplyOnInit *bool `json:"runFeastApplyOnInit,omitempty"`
// Volumes specifies the volumes to mount in the FeatureStore deployment. A corresponding `VolumeMount` should be added to whichever feast service(s) require access to said volume(s).
Volumes []corev1.Volume `json:"volumes,omitempty"`
}
Expand Down
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Original file line number
Diff line number
Diff line change
Expand Up
@@ -3129,6 +3129,10 @@ spec:
x-kubernetes-validations:
- message: One selection required.
rule: '[has(self.local), has(self.remote)].exists_one(c, c)'
runFeastApplyOnInit:
description: Runs feast apply on pod start to populate the registry.
Defaults to true. Ignored when DisableInitContainers is true.
type: boolean
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
Uh oh!
There was an error while loading. Please reload this page.
scaling:
description: Scaling configures horizontal scaling for the FeatureStore
deployment (e.g. HPA autoscaling).
Expand Down
Expand Up
@@ -5695,7 +5699,6 @@ spec:
type: object
required:
- feastProject
- replicas
type: object
x-kubernetes-validations:
- message: replicas > 1 and services.scaling.autoscaling are mutually
Expand Down
Expand Up
@@ -8871,6 +8874,11 @@ spec:
- message: One selection required.
rule: '[has(self.local), has(self.remote)].exists_one(c,
c)'
runFeastApplyOnInit:
description: Runs feast apply on pod start to populate the
registry. Defaults to true. Ignored when DisableInitContainers
is true.
type: boolean
scaling:
description: Scaling configures horizontal scaling for the
FeatureStore deployment (e.g. HPA autoscaling).
Expand Down
Expand Up
@@ -11458,7 +11466,6 @@ spec:
type: object
required:
- feastProject
- replicas
type: object
x-kubernetes-validations:
- message: replicas > 1 and services.scaling.autoscaling are mutually
Expand Down
Expand Up
@@ -13920,6 +13927,10 @@ spec:
x-kubernetes-validations:
- message: One selection required.
rule: '[has(self.local), has(self.remote)].exists_one(c, c)'
runFeastApplyOnInit:
description: Runs feast apply on pod start to populate the registry.
Defaults to true. Ignored when DisableInitContainers is true.
type: boolean
securityContext:
description: PodSecurityContext holds pod-level security attributes
and common container settings.
Expand Down
Expand Up
@@ -18163,6 +18174,11 @@ spec:
- message: One selection required.
rule: '[has(self.local), has(self.remote)].exists_one(c,
c)'
runFeastApplyOnInit:
description: Runs feast apply on pod start to populate the
registry. Defaults to true. Ignored when DisableInitContainers
is true.
type: boolean
securityContext:
description: PodSecurityContext holds pod-level security attributes
and common container settings.
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -3137,6 +3137,10 @@ spec:
x-kubernetes-validations:
- message: One selection required.
rule: '[has(self.local), has(self.remote)].exists_one(c, c)'
runFeastApplyOnInit:
description: Runs feast apply on pod start to populate the registry.
Defaults to true. Ignored when DisableInitContainers is true.
type: boolean
scaling:
description: Scaling configures horizontal scaling for the FeatureStore
deployment (e.g. HPA autoscaling).
Expand Down
Expand Up
@@ -5703,7 +5707,6 @@ spec:
type: object
required:
- feastProject
- replicas
type: object
x-kubernetes-validations:
- message: replicas > 1 and services.scaling.autoscaling are mutually
Expand Down
Expand Up
@@ -8879,6 +8882,11 @@ spec:
- message: One selection required.
rule: '[has(self.local), has(self.remote)].exists_one(c,
c)'
runFeastApplyOnInit:
description: Runs feast apply on pod start to populate the
registry. Defaults to true. Ignored when DisableInitContainers
is true.
type: boolean
scaling:
description: Scaling configures horizontal scaling for the
FeatureStore deployment (e.g. HPA autoscaling).
Expand Down
Expand Up
@@ -11466,7 +11474,6 @@ spec:
type: object
required:
- feastProject
- replicas
type: object
x-kubernetes-validations:
- message: replicas > 1 and services.scaling.autoscaling are mutually
Expand Down
Expand Up
@@ -13928,6 +13935,10 @@ spec:
x-kubernetes-validations:
- message: One selection required.
rule: '[has(self.local), has(self.remote)].exists_one(c, c)'
runFeastApplyOnInit:
description: Runs feast apply on pod start to populate the registry.
Defaults to true. Ignored when DisableInitContainers is true.
type: boolean
securityContext:
description: PodSecurityContext holds pod-level security attributes
and common container settings.
Expand Down
Expand Up
@@ -18171,6 +18182,11 @@ spec:
- message: One selection required.
rule: '[has(self.local), has(self.remote)].exists_one(c,
c)'
runFeastApplyOnInit:
description: Runs feast apply on pod start to populate the
registry. Defaults to true. Ignored when DisableInitContainers
is true.
type: boolean
securityContext:
description: PodSecurityContext holds pod-level security attributes
and common container settings.
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -240,6 +240,7 @@ _Appears in:_
| `deploymentStrategy` _[DeploymentStrategy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstrategy-v1-apps)_ | |
| `securityContext` _[PodSecurityContext](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#podsecuritycontext-v1-core)_ | |
| `disableInitContainers` _boolean_ | Disable the 'feast repo initialization' initContainer |
| `runFeastApplyOnInit` _boolean_ | Runs feast apply on pod start to populate the registry. Defaults to true. Ignored when DisableInitContainers is true. |
| `volumes` _[Volume](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#volume-v1-core) array_ | Volumes specifies the volumes to mount in the FeatureStore deployment. A corresponding `VolumeMount` should be added to whichever feast service(s) require access to said volume(s). |
| `scaling` _[ScalingConfig](#scalingconfig)_ | Scaling configures horizontal scaling for the FeatureStore deployment (e.g. HPA autoscaling).
For static replicas, use spec.replicas instead. |
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -196,11 +196,15 @@ func (r *FeatureStoreReconciler) deployFeast(ctx context.Context, cr *feastdevv1
} else {
isDeployAvailable := services.IsDeploymentAvailable(deployment.Status.Conditions)
if !isDeployAvailable {
msg := feastdevv1.DeploymentNotAvailableMessage
if podMsg := feast.GetPodContainerFailureMessage(deployment); podMsg != "" {
msg = msg + ": " + podMsg
}
condition = metav1.Condition{
Type: feastdevv1.ReadyType,
Status: metav1.ConditionUnknown,
Reason: feastdevv1.DeploymentNotAvailableReason,
Message: feastdevv1.DeploymentNotAvailableMessage ,
Message: msg ,
}
result = errResult
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -98,6 +98,8 @@ var _ = Describe("FeatureStore Controller - Feast CronJob", func() {
Expect(resource.Status).NotTo(BeNil())
Expect(resource.Status.CronJob).To(Equal(objMeta.Name))
Expect(resource.Status.Applied.CronJob.Schedule).NotTo(BeEmpty())
Expect(resource.Status.Applied.Services.RunFeastApplyOnInit).NotTo(BeNil())
Expect(*resource.Status.Applied.Services.RunFeastApplyOnInit).To(BeTrue())
Expect(resource.Status.Conditions).NotTo(BeEmpty())
cond := apimeta.FindStatusCondition(resource.Status.Conditions, feastdevv1.CronJobReadyType)
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -185,7 +185,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
Expect(err).NotTo(HaveOccurred())
Expect(deploy.Spec.Replicas).To(Equal(int32Ptr(1)))
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1 ))
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2 ))
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(2))
Expect(services.GetRegistryContainer(*deploy)).NotTo(BeNil())
Expect(services.GetOnlineContainer(*deploy)).NotTo(BeNil())
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -221,7 +221,7 @@ var _ = Describe("FeatureStore Controller-OIDC authorization", func() {
Expect(err).NotTo(HaveOccurred())
Expect(deploy.Spec.Replicas).To(Equal(int32Ptr(1)))
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1 ))
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2 ))
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(4))
Expect(deploy.Spec.Template.Spec.Volumes).To(HaveLen(1))
Expect(services.GetOfflineContainer(*deploy).VolumeMounts).To(HaveLen(1))
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -210,8 +210,10 @@ var _ = Describe("FeatureStore Controller", func() {
Expect(deploy.Spec.Replicas).To(Equal(int32Ptr(1)))
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
Expect(deploy.Spec.Template.Spec.ServiceAccountName).To(Equal(deploy.Name))
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1 ))
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2 ))
Expect(deploy.Spec.Template.Spec.InitContainers[0].Args[0]).To(ContainSubstring("feast init"))
Expect(deploy.Spec.Template.Spec.InitContainers[1].Name).To(Equal("feast-apply"))
Expect(deploy.Spec.Template.Spec.InitContainers[1].Command).To(Equal([]string{"feast", "apply"}))
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(1))
deploy.Spec.Replicas = int32Ptr(3)
Expand Down
Expand Up
@@ -264,7 +266,7 @@ var _ = Describe("FeatureStore Controller", func() {
}, deploy)
Expect(err).NotTo(HaveOccurred())
Expect(deploy.Spec.Replicas).To(Equal(int32Ptr(1)))
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1 ))
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2 ))
Expect(deploy.Spec.Template.Spec.InitContainers[0].Args[0]).To(ContainSubstring("git -c http.sslVerify=false clone"))
Expect(deploy.Spec.Template.Spec.InitContainers[0].Args[0]).To(ContainSubstring("git checkout " + ref))
Expect(deploy.Spec.Template.Spec.InitContainers[0].Args[0]).To(ContainSubstring(featureRepoPath))
Expand Down
Expand Up
@@ -294,7 +296,7 @@ var _ = Describe("FeatureStore Controller", func() {
Namespace: objMeta.Namespace,
}, deploy)
Expect(err).NotTo(HaveOccurred())
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1 ))
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2 ))
Expect(deploy.Spec.Template.Spec.InitContainers[0].Args[0]).To(ContainSubstring("feast init -t spark"))
})
Expand Down
Expand Up
@@ -737,6 +739,12 @@ var _ = Describe("FeatureStore Controller", func() {
}, deploy)
Expect(err).NotTo(HaveOccurred())
Expect(deploy.Spec.Template.Spec.ServiceAccountName).To(Equal(deploy.Name))
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2))
Expect(deploy.Spec.Template.Spec.InitContainers[1].Name).To(Equal("feast-apply"))
Expect(deploy.Spec.Template.Spec.InitContainers[1].Env).To(ContainElements(
corev1.EnvVar{Name: testEnvVarName, Value: testEnvVarValue},
))
Expect(deploy.Spec.Template.Spec.InitContainers[1].EnvFrom).NotTo(BeEmpty())
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(4))
registryContainer := services.GetRegistryContainer(*deploy)
Expect(registryContainer.Env).To(HaveLen(1))
Expand Down
Expand Up
@@ -1145,7 +1153,7 @@ var _ = Describe("FeatureStore Controller", func() {
Namespace: objMeta.Namespace,
}, deploy)
Expect(err).NotTo(HaveOccurred())
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1 ))
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2 ))
// check client config
cm := &corev1.ConfigMap{}
Expand Down
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.