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: Add Feast Operator component #1498

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ spec:
managementState: Managed
workbenches:
managementState: Managed
feastoperator:
managementState: Managed
```

2. Enable only Dashboard and Workbenches
Expand Down
110 changes: 110 additions & 0 deletions apis/components/v1alpha1/feastoperator_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/*
Copyright 2023.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
"github.com/opendatahub-io/opendatahub-operator/v2/apis/common"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
// FeastOperatorName is the name of the new component
FeastOperatorComponentName = "feastoperator"

// FeastOperatorInstanceName is the singleton name for the FeastOperator instance
// Value must match the validation rule defined below
FeastOperatorInstanceName = "default-" + FeastOperatorComponentName

// FeastOperatorKind represents the Kubernetes kind for FeastOperator
FeastOperatorKind = "FeastOperator"
)

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:validation:XValidation:rule="self.metadata.name == 'default-feastoperator'",message="FeastOperator name must be 'default-feastoperator'"
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`,description="Ready"
// +kubebuilder:printcolumn:name="Reason",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].reason`,description="Reason"

// FeastOperator is the Schema for the FeastOperator API
type FeastOperator struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec FeastOperatorSpec `json:"spec,omitempty"`
Status FeastOperatorStatus `json:"status,omitempty"`
}

// FeastOperatorCommonSpec defines the common spec shared across APIs for FeastOperator
type FeastOperatorCommonSpec struct {
// Spec fields exposed to the DSC API
common.DevFlagsSpec `json:",inline"`
}

// FeastOperatorCommonStatus defines the shared observed state of FeastOperator
type FeastOperatorCommonStatus struct {
}

// FeastOperatorSpec defines the desired state of FeastOperator
type FeastOperatorSpec struct {
FeastOperatorCommonSpec `json:",inline"`
}

// FeastOperatorStatus defines the observed state of FeastOperator
type FeastOperatorStatus struct {
common.Status `json:",inline"`
FeastOperatorCommonStatus `json:",inline"`
}

// GetDevFlags retrieves the development flags from the spec
func (c *FeastOperator) GetDevFlags() *common.DevFlags {
return c.Spec.DevFlags
}

// GetStatus retrieves the status of the FeastOperator component
func (c *FeastOperator) GetStatus() *common.Status {
return &c.Status.Status
}

// +kubebuilder:object:root=true

// FeastOperatorList contains a list of FeastOperator objects
type FeastOperatorList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []FeastOperator `json:"items"`
}

// DSCFeastOperator defines the configuration exposed in the DSC instance for FeastOperator
type DSCFeastOperator struct {
// Fields common across components
common.ManagementSpec `json:",inline"`

// FeastOperator-specific fields
FeastOperatorCommonSpec `json:",inline"`
}

// DSCFeastOperatorStatus struct holds the status for the FeastOperator component exposed in the DSC
type DSCFeastOperatorStatus struct {
common.ManagementSpec `json:",inline"`
*FeastOperatorCommonStatus `json:",inline"`
}

func init() {
// Register the schema with the scheme builder
SchemeBuilder.Register(&FeastOperator{}, &FeastOperatorList{})
}
161 changes: 161 additions & 0 deletions apis/components/v1alpha1/zz_generated.deepcopy.go

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

6 changes: 6 additions & 0 deletions apis/datasciencecluster/v1/datasciencecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ type Components struct {

// Training Operator component configuration.
TrainingOperator componentApi.DSCTrainingOperator `json:"trainingoperator,omitempty"`

// Feast Operator component configuration.
FeastOperator componentApi.DSCFeastOperator `json:"feastoperator,omitempty"`
}

// ComponentsStatus defines the custom status of DataScienceCluster components.
Expand Down Expand Up @@ -105,6 +108,9 @@ type ComponentsStatus struct {

// Training Operator component status.
TrainingOperator componentApi.DSCTrainingOperatorStatus `json:"trainingoperator,omitempty"`

// Feast Operator component status.
FeastOperator componentApi.DSCFeastOperatorStatus `json:"feastoperator,omitempty"`
}

// DataScienceClusterStatus defines the observed state of DataScienceCluster.
Expand Down
2 changes: 2 additions & 0 deletions apis/datasciencecluster/v1/zz_generated.deepcopy.go

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

Loading
Loading