Skip to content

Commit

Permalink
refactor: datasciencepipelines component refactor (#1340)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdelahunt authored Nov 19, 2024
1 parent 77ba8e7 commit e980df6
Show file tree
Hide file tree
Showing 22 changed files with 776 additions and 337 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/modelmeshserving"
"github.com/opendatahub-io/opendatahub-operator/v2/components/workbenches"
Expand All @@ -54,7 +53,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
176 changes: 0 additions & 176 deletions components/datasciencepipelines/datasciencepipelines.go

This file was deleted.

Loading

0 comments on commit e980df6

Please sign in to comment.