Skip to content

Commit

Permalink
refactor: datasciencepipelines component refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdelahunt committed Nov 12, 2024
1 parent 1209501 commit 32989a4
Show file tree
Hide file tree
Showing 23 changed files with 750 additions and 336 deletions.
47 changes: 30 additions & 17 deletions apis/components/v1/datasciencepipelines_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,17 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// DataSciencePipelinesSpec defines the desired state of DataSciencePipelines
type DataSciencePipelinesSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of DataSciencePipelines. Edit datasciencepipelines_types.go to remove/update
Foo string `json:"foo,omitempty"`
}

// DataSciencePipelinesStatus defines the observed state of DataSciencePipelines
type DataSciencePipelinesStatus struct {
components.Status `json:",inline"`
}
const (
DataSciencePipelinesComponentName = "data-science-pipelines-operator"
// value should match whats set in the XValidation below
DataSciencePipelinesInstanceName = "default-datasciencepipelines"
DataSciencePipelinesKind = "DataSciencePipelines"
)

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:validation:XValidation:rule="self.metadata.name == 'default-datasciencepipelines'",message="DataSciencePipelines name must be default-datasciencepipelines"

// DataSciencePipelines is the Schema for the datasciencepipelines API
type DataSciencePipelines struct {
Expand All @@ -51,8 +42,22 @@ type DataSciencePipelines struct {
Status DataSciencePipelinesStatus `json:"status,omitempty"`
}

// DataSciencePipelinesSpec defines the desired state of DataSciencePipelines
type DataSciencePipelinesSpec struct {
DataSciencePipelinesCommonSpec `json:",inline"`
}

type DataSciencePipelinesCommonSpec struct {
components.DevFlagsSpec `json:",inline"`
}

// DataSciencePipelinesStatus defines the observed state of DataSciencePipelines
type DataSciencePipelinesStatus struct {
components.Status `json:",inline"`
}

func (c *DataSciencePipelines) GetDevFlags() *components.DevFlags {
return nil
return c.Spec.DevFlags
}

func (c *DataSciencePipelines) GetStatus() *components.Status {
Expand All @@ -71,3 +76,11 @@ type DataSciencePipelinesList struct {
func init() {
SchemeBuilder.Register(&DataSciencePipelines{}, &DataSciencePipelinesList{})
}

// DSCDataSciencePipelines contains all the configuration exposed in DSC instance for DataSciencePipelines component
type DSCDataSciencePipelines struct {
// configuration fields common across components
components.ManagementSpec `json:",inline"`
// datasciencepipelines specific field
DataSciencePipelinesCommonSpec `json:",inline"`
}
36 changes: 35 additions & 1 deletion apis/components/v1/zz_generated.deepcopy.go

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

3 changes: 1 addition & 2 deletions apis/datasciencecluster/v1/datasciencecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
componentsv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1"
"github.com/opendatahub-io/opendatahub-operator/v2/components"
"github.com/opendatahub-io/opendatahub-operator/v2/components/codeflare"
"github.com/opendatahub-io/opendatahub-operator/v2/components/datasciencepipelines"
"github.com/opendatahub-io/opendatahub-operator/v2/components/kserve"
"github.com/opendatahub-io/opendatahub-operator/v2/components/kueue"
"github.com/opendatahub-io/opendatahub-operator/v2/components/modelmeshserving"
Expand Down Expand Up @@ -56,7 +55,7 @@ type Components struct {

// DataServicePipeline component configuration.
// Require OpenShift Pipelines Operator to be installed before enable component
DataSciencePipelines datasciencepipelines.DataSciencePipelines `json:"datasciencepipelines,omitempty"`
DataSciencePipelines componentsv1.DSCDataSciencePipelines `json:"datasciencepipelines,omitempty"`

// Kserve component configuration.
// Require OpenShift Serverless and OpenShift Service Mesh Operators to be installed before enable component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,32 @@ spec:
spec:
description: DataSciencePipelinesSpec defines the desired state of DataSciencePipelines
properties:
foo:
description: Foo is an example field of DataSciencePipelines. Edit
datasciencepipelines_types.go to remove/update
type: string
devFlags:
description: Add developer fields
properties:
manifests:
description: List of custom manifests for the given component
items:
properties:
contextDir:
default: manifests
description: contextDir is the relative path to the folder
containing manifests in a repository, default value "manifests"
type: string
sourcePath:
default: ""
description: 'sourcePath is the subpath within contextDir
where kustomize builds start. Examples include any sub-folder
or path: `base`, `overlays/dev`, `default`, `odh` etc.'
type: string
uri:
default: ""
description: uri is the URI point to a git repo with tag/branch.
e.g. https://github.com/org/repo/tarball/<tag/branch>
type: string
type: object
type: array
type: object
type: object
status:
description: DataSciencePipelinesStatus defines the observed state of
Expand Down Expand Up @@ -112,6 +134,9 @@ spec:
type: string
type: object
type: object
x-kubernetes-validations:
- message: DataSciencePipelines name must be default-datasciencepipelines
rule: self.metadata.name == 'default-datasciencepipelines'
served: true
storage: true
subresources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ metadata:
categories: AI/Machine Learning, Big Data
certified: "False"
containerImage: quay.io/opendatahub/opendatahub-operator:v2.19.0
createdAt: "2024-10-30T14:18:10Z"
createdAt: "2024-11-05T09:33:08Z"
olm.skipRange: '>=1.0.0 <2.19.0'
operators.operatorframework.io/builder: operator-sdk-v1.31.0
operators.operatorframework.io/internal-objects: '["featuretrackers.features.opendatahub.io",
Expand Down
176 changes: 0 additions & 176 deletions components/datasciencepipelines/datasciencepipelines.go

This file was deleted.

Loading

0 comments on commit 32989a4

Please sign in to comment.