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

feat: PVC configuration and impl #4750

Merged
merged 12 commits into from
Nov 13, 2024

Conversation

dmartinol
Copy link
Contributor

@dmartinol dmartinol commented Nov 8, 2024

What this PR does / why we need it:

Adds durable persistence configuration to Feast services deployed with the operator.

PVC configuration allows to either create a new PVC or use an existing one:

apiVersion: feast.dev/v1alpha1
kind: FeatureStore
metadata:
  name: sample-pvc-persistence
spec:
  feastProject: my_project
  services:
    onlineStore:
      persistence:
        file:
          path: online_store.db
          pvc:
            ref:
              name: online-pvc
            mountPath: /data/online
    offlineStore:
      persistence:
        file:
          type: duckdb
          pvc:
            create:
              storageClassName: standard
              resources:
                requests:
                  storage: 5Gi
            mountPath: /data/offline
    registry:
      local:
        persistence:
          file:
            path: registry.db
            pvc:
              create: {}
              mountPath: /data/registry

Which issue(s) this PR fixes:

Relates to #4561

Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
@dmartinol dmartinol requested a review from a team as a code owner November 8, 2024 17:26
@dmartinol
Copy link
Contributor Author

@tchughesiv @tmihalac I also splitted the controller tests in multiple files to simplify them

Comment on lines 166 to 171
err := feast.setPVC(pvc, pvcCreate, feastType)
if err != nil {
return err
}
if op, err := controllerutil.CreateOrUpdate(feast.Context, feast.Client, pvc, controllerutil.MutateFn(func() error {
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
err := feast.setPVC(pvc, pvcCreate, feastType)
if err != nil {
return err
}
if op, err := controllerutil.CreateOrUpdate(feast.Context, feast.Client, pvc, controllerutil.MutateFn(func() error {
return nil
if op, err := controllerutil.CreateOrUpdate(feast.Context, feast.Client, pvc, controllerutil.MutateFn(func() error {
return feast.setPVC(pvc, pvcCreate, feastType)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the PVC object mods need to happen within the CreateOrUpdate func ()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this moved because of the immutable nature of the PVC?

Copy link
Contributor

@tchughesiv tchughesiv Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if so, we could be explicit with PVC creation and use feast.Client.Create() here instead? it could be used alongside if !apierrors.IsAlreadyExists(err) {}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried the Create option but creation was not an issue. Deletion seems to fail, at least in the tests (just restored them to see the failure)

Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Comment on lines 127 to +130
type RegistryFilePersistence struct {
Path string `json:"path,omitempty"`
Path string `json:"path,omitempty"`
PvcConfig *PvcConfig `json:"pvc,omitempty"`
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OnlineStoreFilePersistence and RegistryFilePersistence are identical. Any reason we shouldn't make a single FilePersistence struct instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registry also supports the s3_additional_kwargs options (which will go under the Registry.Persistence.File section). Will we add it to a new PR dedicated to object store settings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so this is in prep for future work... got it, thanks

Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Copy link
Contributor

@tchughesiv tchughesiv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dmartinol
Copy link
Contributor Author

@lokeshrangineni @redhatHameed can you take a look?

@lokeshrangineni lokeshrangineni enabled auto-merge (squash) November 12, 2024 15:20
Copy link
Contributor

@redhatHameed redhatHameed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks lgtm some minor comments.

Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
@lokeshrangineni lokeshrangineni merged commit 785a190 into feast-dev:master Nov 13, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants