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 5, 2024
1 parent e273140 commit 0fa34e4
Show file tree
Hide file tree
Showing 49 changed files with 2,305 additions and 1,202 deletions.
45 changes: 29 additions & 16 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 = "datasciencepipelines"
// 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,6 +42,20 @@ 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
}
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"`
}
37 changes: 36 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.

1 change: 1 addition & 0 deletions apis/components/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 @@ -59,7 +58,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
1 change: 1 addition & 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.

1 change: 1 addition & 0 deletions apis/dscinitialization/v1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions apis/features/v1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions apis/infrastructure/v1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions components/codeflare/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions components/datasciencepipelines/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions components/kserve/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions components/kueue/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions components/modelmeshserving/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions components/modelregistry/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions components/trainingoperator/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions components/trustyai/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions components/workbenches/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions components/zz_generated.deepcopy.go

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

66 changes: 37 additions & 29 deletions config/crd/bases/components.opendatahub.io_codeflares.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: codeflares.components.opendatahub.io
spec:
group: components.opendatahub.io
Expand All @@ -20,19 +21,14 @@ spec:
description: CodeFlare is the Schema for the codeflares API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand All @@ -49,35 +45,43 @@ spec:
properties:
conditions:
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
description: "Condition contains details for one aspect of the current
state of this API Resource. --- This struct is intended for direct
use as an array at the field path .status.conditions. For example,
\n type FooStatus struct{ // Represents the observations of a
foo's current state. // Known .status.conditions.type are: \"Available\",
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
// +listType=map // +listMapKey=type Conditions []metav1.Condition
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should be when
the underlying condition changed. If that is not known, then
using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
description: message is a human readable message indicating
details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance, if .metadata.generation
is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the current
state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
description: reason contains a programmatic identifier indicating
the reason for the condition's last transition. Producers
of specific condition types may define expected values and
meanings for this field, and whether the values are considered
a guaranteed API. The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
Expand All @@ -92,6 +96,10 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
--- Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
Expand Down
Loading

0 comments on commit 0fa34e4

Please sign in to comment.