GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Added pvc accessModes support by dandawg · Pull Request #4851 · feast-dev/feast

feat: Added pvc accessModes support #4851

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.

Sign up for GitHub

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

Merged
tchughesiv merged 4 commits into feast-dev:master from dandawg:pvc-accessmodes
Dec 20, 2024

Uh oh!

There was an error while loading. Please reload this page.

Merged

feat: Added pvc accessModes support #4851

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
4 commits
Select commit Hold shift + click to select a range
af4acbf
added pvc accessModes support
dandawg Dec 13, 2024
f23bd04
made accessModes doc line more clear for users
dandawg Dec 16, 2024
6a5807e
Added multiple accessModes to PVC accessModes test
dandawg Dec 16, 2024
f02f797
function for pvc.Create
dandawg Dec 19, 2024
File filter
Filter by extension

Clear filters
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
Diff view

There are no files selected for viewing

2 changes: 2 additions & 0 deletions 2 infra/feast-operator/api/v1alpha1/featurestore_types.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ type PvcConfig struct {
// The PVC name is the same as the associated deployment name.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="PvcCreate is immutable"
type PvcCreate struct {
// AccessModes k8s persistent volume access modes. Defaults to ["ReadWriteOnce"].
AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"`
// StorageClassName is the name of an existing StorageClass to which this persistent volume belongs. Empty value
// means that this volume does not belong to any StorageClass and the cluster default will be used.
StorageClassName *string `json:"storageClassName,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions 5 infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go
Show comments
View file
Open in desktop

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

Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

37 changes: 37 additions & 0 deletions 37 infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ spec:
create:
description: Settings for creating a new PVC
properties:
accessModes:
description: AccessModes k8s persistent volume
access modes. Defaults to ["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down Expand Up @@ -622,6 +628,12 @@ spec:
create:
description: Settings for creating a new PVC
properties:
accessModes:
description: AccessModes k8s persistent volume
access modes. Defaults to ["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down Expand Up @@ -1006,6 +1018,12 @@ spec:
create:
description: Settings for creating a new PVC
properties:
accessModes:
description: AccessModes k8s persistent
volume access modes. Defaults to ["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down Expand Up @@ -1506,6 +1524,12 @@ spec:
create:
description: Settings for creating a new PVC
properties:
accessModes:
description: AccessModes k8s persistent
volume access modes. Defaults to ["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down Expand Up @@ -1879,6 +1903,12 @@ spec:
create:
description: Settings for creating a new PVC
properties:
accessModes:
description: AccessModes k8s persistent
volume access modes. Defaults to ["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down Expand Up @@ -2272,6 +2302,13 @@ spec:
description: Settings for creating a new
PVC
properties:
accessModes:
description: AccessModes k8s persistent
volume access modes. Defaults to
["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down
37 changes: 37 additions & 0 deletions 37 infra/feast-operator/dist/install.yaml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ spec:
create:
description: Settings for creating a new PVC
properties:
accessModes:
description: AccessModes k8s persistent volume
access modes. Defaults to ["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down Expand Up @@ -630,6 +636,12 @@ spec:
create:
description: Settings for creating a new PVC
properties:
accessModes:
description: AccessModes k8s persistent volume
access modes. Defaults to ["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down Expand Up @@ -1014,6 +1026,12 @@ spec:
create:
description: Settings for creating a new PVC
properties:
accessModes:
description: AccessModes k8s persistent
volume access modes. Defaults to ["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down Expand Up @@ -1514,6 +1532,12 @@ spec:
create:
description: Settings for creating a new PVC
properties:
accessModes:
description: AccessModes k8s persistent
volume access modes. Defaults to ["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down Expand Up @@ -1887,6 +1911,12 @@ spec:
create:
description: Settings for creating a new PVC
properties:
accessModes:
description: AccessModes k8s persistent
volume access modes. Defaults to ["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down Expand Up @@ -2280,6 +2310,13 @@ spec:
description: Settings for creating a new
PVC
properties:
accessModes:
description: AccessModes k8s persistent
volume access modes. Defaults to
["ReadWriteOnce"].
items:
type: string
type: array
resources:
description: |-
Resources describes the storage resource requirements for a volume.
Expand Down
8 changes: 8 additions & 0 deletions 8 infra/feast-operator/internal/controller/featurestore_controller_pvc_test.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
onlineStoreMountPath := "/online"
registryMountPath := "/registry"

accessModes := []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce, corev1.ReadWriteMany}
storageClassName := "test"

onlineStoreMountedPath := path.Join(onlineStoreMountPath, onlineStorePath)
Expand All @@ -85,6 +86,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
Type: offlineType,
PvcConfig: &feastdevv1alpha1.PvcConfig{
Create: &feastdevv1alpha1.PvcCreate{
AccessModes: accessModes,
StorageClassName: &storageClassName,
},
MountPath: offlineStoreMountPath,
Expand Down Expand Up @@ -162,6 +164,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
Expect(resource.Status.Applied.Services.OfflineStore.Persistence.FilePersistence.Type).To(Equal(offlineType))
Expect(resource.Status.Applied.Services.OfflineStore.Persistence.FilePersistence.PvcConfig).NotTo(BeNil())
Expect(resource.Status.Applied.Services.OfflineStore.Persistence.FilePersistence.PvcConfig.Create).NotTo(BeNil())
Expect(resource.Status.Applied.Services.OfflineStore.Persistence.FilePersistence.PvcConfig.Create.AccessModes).To(Equal(accessModes))
Expect(resource.Status.Applied.Services.OfflineStore.Persistence.FilePersistence.PvcConfig.Create.StorageClassName).To(Equal(&storageClassName))
expectedResources := corev1.VolumeResourceRequirements{
Requests: corev1.ResourceList{
Expand All @@ -179,6 +182,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
Expect(resource.Status.Applied.Services.OnlineStore.Persistence.FilePersistence.Path).To(Equal(onlineStorePath))
Expect(resource.Status.Applied.Services.OnlineStore.Persistence.FilePersistence.PvcConfig).NotTo(BeNil())
Expect(resource.Status.Applied.Services.OnlineStore.Persistence.FilePersistence.PvcConfig.Create).NotTo(BeNil())
Expect(resource.Status.Applied.Services.OnlineStore.Persistence.FilePersistence.PvcConfig.Create.AccessModes).To(Equal(services.DefaultPVCAccessModes))
Expect(resource.Status.Applied.Services.OnlineStore.Persistence.FilePersistence.PvcConfig.Create.StorageClassName).To(BeNil())
expectedResources = corev1.VolumeResourceRequirements{
Requests: corev1.ResourceList{
Expand All @@ -198,6 +202,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
Expect(resource.Status.Applied.Services.Registry.Local.Persistence.FilePersistence.Path).To(Equal(registryPath))
Expect(resource.Status.Applied.Services.Registry.Local.Persistence.FilePersistence.PvcConfig).NotTo(BeNil())
Expect(resource.Status.Applied.Services.Registry.Local.Persistence.FilePersistence.PvcConfig.Create).NotTo(BeNil())
Expect(resource.Status.Applied.Services.Registry.Local.Persistence.FilePersistence.PvcConfig.Create.AccessModes).To(Equal(services.DefaultPVCAccessModes))
Expect(resource.Status.Applied.Services.Registry.Local.Persistence.FilePersistence.PvcConfig.Create.StorageClassName).To(BeNil())
expectedResources = corev1.VolumeResourceRequirements{
Requests: corev1.ResourceList{
Expand Down Expand Up @@ -283,6 +288,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
Expect(err).NotTo(HaveOccurred())
Expect(pvc.Name).To(Equal(deploy.Name))
Expect(pvc.Spec.StorageClassName).To(Equal(&storageClassName))
Expect(pvc.Spec.AccessModes).To(Equal(accessModes))
Expect(pvc.Spec.Resources.Requests.Storage().String()).To(Equal(services.DefaultOfflineStorageRequest))
Expect(pvc.DeletionTimestamp).To(BeNil())

Expand Down Expand Up @@ -313,6 +319,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
pvc)
Expect(err).NotTo(HaveOccurred())
Expect(pvc.Name).To(Equal(deploy.Name))
Expect(pvc.Spec.AccessModes).To(Equal(services.DefaultPVCAccessModes))
Expect(pvc.Spec.Resources.Requests.Storage().String()).To(Equal(services.DefaultOnlineStorageRequest))
Expect(pvc.DeletionTimestamp).To(BeNil())

Expand Down Expand Up @@ -343,6 +350,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
pvc)
Expect(err).NotTo(HaveOccurred())
Expect(pvc.Name).To(Equal(deploy.Name))
Expect(pvc.Spec.AccessModes).To(Equal(services.DefaultPVCAccessModes))
Expect(pvc.Spec.Resources.Requests.Storage().String()).To(Equal(services.DefaultRegistryStorageRequest))
Expect(pvc.DeletionTimestamp).To(BeNil())

Expand Down
2 changes: 1 addition & 1 deletion 2 infra/feast-operator/internal/controller/services/services.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ func (feast *FeastServices) createNewPVC(pvcCreate *feastdevv1alpha1.PvcCreate,
pvc := feast.initPVC(feastType)

pvc.Spec = corev1.PersistentVolumeClaimSpec{
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteMany},
AccessModes: pvcCreate.AccessModes,
Resources: pvcCreate.Resources,
}
if pvcCreate.StorageClassName != nil {
Expand Down
10 changes: 6 additions & 4 deletions 10 infra/feast-operator/internal/controller/services/services_types.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/feast-dev/feast/infra/feast-operator/api/feastversion"
feastdevv1alpha1 "github.com/feast-dev/feast/infra/feast-operator/api/v1alpha1"
handler "github.com/feast-dev/feast/infra/feast-operator/internal/controller/handler"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -80,10 +81,11 @@ const (
)

var (
DefaultImage = "feastdev/feature-server:" + feastversion.FeastVersion
DefaultReplicas = int32(1)
NameLabelKey = feastdevv1alpha1.GroupVersion.Group + "/name"
ServiceTypeLabelKey = feastdevv1alpha1.GroupVersion.Group + "/service-type"
DefaultImage = "feastdev/feature-server:" + feastversion.FeastVersion
DefaultReplicas = int32(1)
DefaultPVCAccessModes = []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}
NameLabelKey = feastdevv1alpha1.GroupVersion.Group + "/name"
ServiceTypeLabelKey = feastdevv1alpha1.GroupVersion.Group + "/service-type"

FeastServiceConstants = map[FeastServiceType]deploymentSettings{
OfflineFeastType: {
Expand Down
30 changes: 21 additions & 9 deletions 30 infra/feast-operator/internal/controller/services/util.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ func ApplyDefaultsToStatus(cr *feastdevv1alpha1.FeatureStore) {

if services.Registry.Local.Persistence.FilePersistence.PvcConfig != nil {
pvc := services.Registry.Local.Persistence.FilePersistence.PvcConfig
if pvc.Create != nil {
ensureRequestedStorage(&pvc.Create.Resources, DefaultRegistryStorageRequest)
}
ensurePVCDefaults(pvc, RegistryFeastType)
}
}

Expand All @@ -116,9 +114,7 @@ func ApplyDefaultsToStatus(cr *feastdevv1alpha1.FeatureStore) {

if services.OfflineStore.Persistence.FilePersistence.PvcConfig != nil {
pvc := services.OfflineStore.Persistence.FilePersistence.PvcConfig
if pvc.Create != nil {
ensureRequestedStorage(&pvc.Create.Resources, DefaultOfflineStorageRequest)
}
ensurePVCDefaults(pvc, OfflineFeastType)
}
}

Expand All @@ -141,9 +137,7 @@ func ApplyDefaultsToStatus(cr *feastdevv1alpha1.FeatureStore) {

if services.OnlineStore.Persistence.FilePersistence.PvcConfig != nil {
pvc := services.OnlineStore.Persistence.FilePersistence.PvcConfig
if pvc.Create != nil {
ensureRequestedStorage(&pvc.Create.Resources, DefaultOnlineStorageRequest)
}
ensurePVCDefaults(pvc, OnlineFeastType)
}
}

Expand Down Expand Up @@ -182,6 +176,24 @@ func ensureRequestedStorage(resources *v1.VolumeResourceRequirements, requestedS
}
}

func ensurePVCDefaults(pvc *feastdevv1alpha1.PvcConfig, feastType FeastServiceType) {
var storageRequest string
switch feastType {
case OnlineFeastType:
storageRequest = DefaultOnlineStorageRequest
case OfflineFeastType:
storageRequest = DefaultOfflineStorageRequest
case RegistryFeastType:
storageRequest = DefaultRegistryStorageRequest
}
Comment thread
tchughesiv marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

if pvc.Create != nil {
ensureRequestedStorage(&pvc.Create.Resources, storageRequest)
if pvc.Create.AccessModes == nil {
pvc.Create.AccessModes = DefaultPVCAccessModes
}
}
}

func defaultOnlineStorePath(persistence *feastdevv1alpha1.OnlineStoreFilePersistence) string {
if persistence.PvcConfig == nil {
return DefaultOnlineStoreEphemeralPath
Expand Down
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.