GeezerVison is showing github.com — feat: Add feast apply init container to automate registry population … · Marcus-Rosti/feast@6b31a43
File treeExpand file treeCollapse file tree Open diff view settings sdk/python/feast/infra/registry
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .secrets.baseline +9-9Lines changed: 9 additions & 9 deletions Collapse file Copy file name to clipboardExpand all lines: infra/feast-operator/api/v1/featurestore_types.go +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -86,7 +86,7 @@ type FeatureStoreSpec struct { | 86 | 86 | // Mutually exclusive with services.scaling.autoscaling. | 87 | 87 | // +kubebuilder:default=1 | 88 | 88 | // +kubebuilder:validation:Minimum=1 | 89 | | - Replicas *int32 `json:"replicas"` | | 89 | + Replicas *int32 `json:"replicas,omitempty"` | 90 | 90 | } | 91 | 91 |
| 92 | 92 | // FeastProjectDir defines how to create the feast project directory. | @@ -310,6 +310,8 @@ type FeatureStoreServices struct { | 310 | 310 | SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"` | 311 | 311 | // Disable the 'feast repo initialization' initContainer | 312 | 312 | DisableInitContainers bool `json:"disableInitContainers,omitempty"` | | 313 | + // Runs feast apply on pod start to populate the registry. Defaults to true. Ignored when DisableInitContainers is true. | | 314 | + RunFeastApplyOnInit *bool `json:"runFeastApplyOnInit,omitempty"` | 313 | 315 | // 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). | 314 | 316 | Volumes []corev1.Volume `json:"volumes,omitempty"` | 315 | 317 | // Scaling configures horizontal scaling for the FeatureStore deployment (e.g. HPA autoscaling). | |
Collapse file Copy file name to clipboardExpand all lines: infra/feast-operator/api/v1/zz_generated.deepcopy.go +5Lines changed: 5 additions & 0 deletions Collapse file Copy file name to clipboardExpand all lines: infra/feast-operator/api/v1alpha1/featurestore_types.go +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -289,6 +289,8 @@ type FeatureStoreServices struct { | 289 | 289 | SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"` | 290 | 290 | // Disable the 'feast repo initialization' initContainer | 291 | 291 | DisableInitContainers bool `json:"disableInitContainers,omitempty"` | | 292 | + // Runs feast apply on pod start to populate the registry. Defaults to true. Ignored when DisableInitContainers is true. | | 293 | + RunFeastApplyOnInit *bool `json:"runFeastApplyOnInit,omitempty"` | 292 | 294 | // 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). | 293 | 295 | Volumes []corev1.Volume `json:"volumes,omitempty"` | 294 | 296 | } | |
Collapse file Copy file name to clipboardExpand all lines: infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go +5Lines changed: 5 additions & 0 deletions Collapse file Copy file name to clipboardExpand all lines: infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml +18-2Lines changed: 18 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3129,6 +3129,10 @@ spec: | 3129 | 3129 | x-kubernetes-validations: | 3130 | 3130 | - message: One selection required. | 3131 | 3131 | rule: '[has(self.local), has(self.remote)].exists_one(c, c)' | | 3132 | + runFeastApplyOnInit: | | 3133 | + description: Runs feast apply on pod start to populate the registry. | | 3134 | + Defaults to true. Ignored when DisableInitContainers is true. | | 3135 | + type: boolean | 3132 | 3136 | scaling: | 3133 | 3137 | description: Scaling configures horizontal scaling for the FeatureStore | 3134 | 3138 | deployment (e.g. HPA autoscaling). | @@ -5695,7 +5699,6 @@ spec: | 5695 | 5699 | type: object | 5696 | 5700 | required: | 5697 | 5701 | - feastProject | 5698 | | - - replicas | 5699 | 5702 | type: object | 5700 | 5703 | x-kubernetes-validations: | 5701 | 5704 | - message: replicas > 1 and services.scaling.autoscaling are mutually | @@ -8871,6 +8874,11 @@ spec: | 8871 | 8874 | - message: One selection required. | 8872 | 8875 | rule: '[has(self.local), has(self.remote)].exists_one(c, | 8873 | 8876 | c)' | | 8877 | + runFeastApplyOnInit: | | 8878 | + description: Runs feast apply on pod start to populate the | | 8879 | + registry. Defaults to true. Ignored when DisableInitContainers | | 8880 | + is true. | | 8881 | + type: boolean | 8874 | 8882 | scaling: | 8875 | 8883 | description: Scaling configures horizontal scaling for the | 8876 | 8884 | FeatureStore deployment (e.g. HPA autoscaling). | @@ -11458,7 +11466,6 @@ spec: | 11458 | 11466 | type: object | 11459 | 11467 | required: | 11460 | 11468 | - feastProject | 11461 | | - - replicas | 11462 | 11469 | type: object | 11463 | 11470 | x-kubernetes-validations: | 11464 | 11471 | - message: replicas > 1 and services.scaling.autoscaling are mutually | @@ -13920,6 +13927,10 @@ spec: | 13920 | 13927 | x-kubernetes-validations: | 13921 | 13928 | - message: One selection required. | 13922 | 13929 | rule: '[has(self.local), has(self.remote)].exists_one(c, c)' | | 13930 | + runFeastApplyOnInit: | | 13931 | + description: Runs feast apply on pod start to populate the registry. | | 13932 | + Defaults to true. Ignored when DisableInitContainers is true. | | 13933 | + type: boolean | 13923 | 13934 | securityContext: | 13924 | 13935 | description: PodSecurityContext holds pod-level security attributes | 13925 | 13936 | and common container settings. | @@ -18163,6 +18174,11 @@ spec: | 18163 | 18174 | - message: One selection required. | 18164 | 18175 | rule: '[has(self.local), has(self.remote)].exists_one(c, | 18165 | 18176 | c)' | | 18177 | + runFeastApplyOnInit: | | 18178 | + description: Runs feast apply on pod start to populate the | | 18179 | + registry. Defaults to true. Ignored when DisableInitContainers | | 18180 | + is true. | | 18181 | + type: boolean | 18166 | 18182 | securityContext: | 18167 | 18183 | description: PodSecurityContext holds pod-level security attributes | 18168 | 18184 | and common container settings. | |
Collapse file Copy file name to clipboardExpand all lines: infra/feast-operator/dist/install.yaml +18-2Lines changed: 18 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3137,6 +3137,10 @@ spec: | 3137 | 3137 | x-kubernetes-validations: | 3138 | 3138 | - message: One selection required. | 3139 | 3139 | rule: '[has(self.local), has(self.remote)].exists_one(c, c)' | | 3140 | + runFeastApplyOnInit: | | 3141 | + description: Runs feast apply on pod start to populate the registry. | | 3142 | + Defaults to true. Ignored when DisableInitContainers is true. | | 3143 | + type: boolean | 3140 | 3144 | scaling: | 3141 | 3145 | description: Scaling configures horizontal scaling for the FeatureStore | 3142 | 3146 | deployment (e.g. HPA autoscaling). | @@ -5703,7 +5707,6 @@ spec: | 5703 | 5707 | type: object | 5704 | 5708 | required: | 5705 | 5709 | - feastProject | 5706 | | - - replicas | 5707 | 5710 | type: object | 5708 | 5711 | x-kubernetes-validations: | 5709 | 5712 | - message: replicas > 1 and services.scaling.autoscaling are mutually | @@ -8879,6 +8882,11 @@ spec: | 8879 | 8882 | - message: One selection required. | 8880 | 8883 | rule: '[has(self.local), has(self.remote)].exists_one(c, | 8881 | 8884 | c)' | | 8885 | + runFeastApplyOnInit: | | 8886 | + description: Runs feast apply on pod start to populate the | | 8887 | + registry. Defaults to true. Ignored when DisableInitContainers | | 8888 | + is true. | | 8889 | + type: boolean | 8882 | 8890 | scaling: | 8883 | 8891 | description: Scaling configures horizontal scaling for the | 8884 | 8892 | FeatureStore deployment (e.g. HPA autoscaling). | @@ -11466,7 +11474,6 @@ spec: | 11466 | 11474 | type: object | 11467 | 11475 | required: | 11468 | 11476 | - feastProject | 11469 | | - - replicas | 11470 | 11477 | type: object | 11471 | 11478 | x-kubernetes-validations: | 11472 | 11479 | - message: replicas > 1 and services.scaling.autoscaling are mutually | @@ -13928,6 +13935,10 @@ spec: | 13928 | 13935 | x-kubernetes-validations: | 13929 | 13936 | - message: One selection required. | 13930 | 13937 | rule: '[has(self.local), has(self.remote)].exists_one(c, c)' | | 13938 | + runFeastApplyOnInit: | | 13939 | + description: Runs feast apply on pod start to populate the registry. | | 13940 | + Defaults to true. Ignored when DisableInitContainers is true. | | 13941 | + type: boolean | 13931 | 13942 | securityContext: | 13932 | 13943 | description: PodSecurityContext holds pod-level security attributes | 13933 | 13944 | and common container settings. | @@ -18171,6 +18182,11 @@ spec: | 18171 | 18182 | - message: One selection required. | 18172 | 18183 | rule: '[has(self.local), has(self.remote)].exists_one(c, | 18173 | 18184 | c)' | | 18185 | + runFeastApplyOnInit: | | 18186 | + description: Runs feast apply on pod start to populate the | | 18187 | + registry. Defaults to true. Ignored when DisableInitContainers | | 18188 | + is true. | | 18189 | + type: boolean | 18174 | 18190 | securityContext: | 18175 | 18191 | description: PodSecurityContext holds pod-level security attributes | 18176 | 18192 | and common container settings. | |
Collapse file Copy file name to clipboardExpand all lines: infra/feast-operator/docs/api/markdown/ref.md +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -240,6 +240,7 @@ _Appears in:_ | 240 | 240 | | `deploymentStrategy` _[DeploymentStrategy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#deploymentstrategy-v1-apps)_ | | | 241 | 241 | | `securityContext` _[PodSecurityContext](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#podsecuritycontext-v1-core)_ | | | 242 | 242 | | `disableInitContainers` _boolean_ | Disable the 'feast repo initialization' initContainer | | | 243 | +| `runFeastApplyOnInit` _boolean_ | Runs feast apply on pod start to populate the registry. Defaults to true. Ignored when DisableInitContainers is true. | | 243 | 244 | | `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). | | 244 | 245 | | `scaling` _[ScalingConfig](#scalingconfig)_ | Scaling configures horizontal scaling for the FeatureStore deployment (e.g. HPA autoscaling). | 245 | 246 | For static replicas, use spec.replicas instead. | | |
Collapse file Copy file name to clipboardExpand all lines: infra/feast-operator/internal/controller/featurestore_controller.go +5-1Lines changed: 5 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -196,11 +196,15 @@ func (r *FeatureStoreReconciler) deployFeast(ctx context.Context, cr *feastdevv1 | 196 | 196 | } else { | 197 | 197 | isDeployAvailable := services.IsDeploymentAvailable(deployment.Status.Conditions) | 198 | 198 | if !isDeployAvailable { | | 199 | + msg := feastdevv1.DeploymentNotAvailableMessage | | 200 | + if podMsg := feast.GetPodContainerFailureMessage(deployment); podMsg != "" { | | 201 | + msg = msg + ": " + podMsg | | 202 | + } | 199 | 203 | condition = metav1.Condition{ | 200 | 204 | Type: feastdevv1.ReadyType, | 201 | 205 | Status: metav1.ConditionUnknown, | 202 | 206 | Reason: feastdevv1.DeploymentNotAvailableReason, | 203 | | - Message: feastdevv1.DeploymentNotAvailableMessage, | | 207 | + Message: msg, | 204 | 208 | } | 205 | 209 |
| 206 | 210 | result = errResult | |
Collapse file Copy file name to clipboardExpand all lines: infra/feast-operator/internal/controller/featurestore_controller_cronjob_test.go +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -98,6 +98,8 @@ var _ = Describe("FeatureStore Controller - Feast CronJob", func() { | 98 | 98 | Expect(resource.Status).NotTo(BeNil()) | 99 | 99 | Expect(resource.Status.CronJob).To(Equal(objMeta.Name)) | 100 | 100 | Expect(resource.Status.Applied.CronJob.Schedule).NotTo(BeEmpty()) | | 101 | + Expect(resource.Status.Applied.Services.RunFeastApplyOnInit).NotTo(BeNil()) | | 102 | + Expect(*resource.Status.Applied.Services.RunFeastApplyOnInit).To(BeTrue()) | 101 | 103 |
| 102 | 104 | Expect(resource.Status.Conditions).NotTo(BeEmpty()) | 103 | 105 | cond := apimeta.FindStatusCondition(resource.Status.Conditions, feastdevv1.CronJobReadyType) | |
|