diff --git a/apis/components/v1alpha1/datasciencepipelines/types.go b/apis/components/v1alpha1/datasciencepipelines/types.go index 787a9b1e9bc..275006b53ef 100644 --- a/apis/components/v1alpha1/datasciencepipelines/types.go +++ b/apis/components/v1alpha1/datasciencepipelines/types.go @@ -6,14 +6,16 @@ package datasciencepipelines import operatorv1 "github.com/openshift/api/operator/v1" type PreloadedPipelinesSpec struct { - InstructLab InstructLabPipelineSpec `json:"instructLab,omitempty"` + // Configure whether to auto import the InstructLab pipeline pon any new pipeline server (or DSPA) creation. + // Please note that the pipeline requires that trainingoperator be enabled in the DSC to run. + InstructLab PreloadedPipelineOptions `json:"instructLab,omitempty"` } -type InstructLabPipelineSpec struct { +type PreloadedPipelineOptions struct { // Set to one of the following values: // - // - "Managed" : TODO - // - "Removed" : TODO + // - "Managed" : Upon any new pipeline server (or DSPA) creation this pipeline is auto imported + // - "Removed" : Upon any new pipeline server (or DSPA) creation this pipeline is not auto imported // // +kubebuilder:validation:Enum=Managed;Removed // +kubebuilder:default=Removed diff --git a/apis/components/v1alpha1/datasciencepipelines/zz_generated.deepcopy.go b/apis/components/v1alpha1/datasciencepipelines/zz_generated.deepcopy.go index b21f9a6fda2..e56c2b7527a 100644 --- a/apis/components/v1alpha1/datasciencepipelines/zz_generated.deepcopy.go +++ b/apis/components/v1alpha1/datasciencepipelines/zz_generated.deepcopy.go @@ -23,16 +23,16 @@ package datasciencepipelines import () // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InstructLabPipelineSpec) DeepCopyInto(out *InstructLabPipelineSpec) { +func (in *PreloadedPipelineOptions) DeepCopyInto(out *PreloadedPipelineOptions) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstructLabPipelineSpec. -func (in *InstructLabPipelineSpec) DeepCopy() *InstructLabPipelineSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreloadedPipelineOptions. +func (in *PreloadedPipelineOptions) DeepCopy() *PreloadedPipelineOptions { if in == nil { return nil } - out := new(InstructLabPipelineSpec) + out := new(PreloadedPipelineOptions) in.DeepCopyInto(out) return out } diff --git a/bundle/manifests/components.platform.opendatahub.io_datasciencepipelines.yaml b/bundle/manifests/components.platform.opendatahub.io_datasciencepipelines.yaml index 6bf4ebd075b..9c410a5c568 100644 --- a/bundle/manifests/components.platform.opendatahub.io_datasciencepipelines.yaml +++ b/bundle/manifests/components.platform.opendatahub.io_datasciencepipelines.yaml @@ -78,14 +78,17 @@ spec: preloadedPipelines: properties: instructLab: + description: |- + Configure whether to auto import the InstructLab pipeline pon any new pipeline server (or DSPA) creation. + Please note that the pipeline requires that trainingoperator be enabled in the DSC to run. properties: state: default: Removed description: |- Set to one of the following values: - - "Managed" : TODO - - "Removed" : TODO + - "Managed" : Upon any new pipeline server (or DSPA) creation this pipeline is auto imported + - "Removed" : Upon any new pipeline server (or DSPA) creation this pipeline is not auto imported enum: - Managed - Removed diff --git a/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml b/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml index 6ab5c4f237b..53092810166 100644 --- a/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml +++ b/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml @@ -189,14 +189,17 @@ spec: preloadedPipelines: properties: instructLab: + description: |- + Configure whether to auto import the InstructLab pipeline pon any new pipeline server (or DSPA) creation. + Please note that the pipeline requires that trainingoperator be enabled in the DSC to run. properties: state: default: Removed description: |- Set to one of the following values: - - "Managed" : TODO - - "Removed" : TODO + - "Managed" : Upon any new pipeline server (or DSPA) creation this pipeline is auto imported + - "Removed" : Upon any new pipeline server (or DSPA) creation this pipeline is not auto imported enum: - Managed - Removed diff --git a/config/crd/bases/components.platform.opendatahub.io_datasciencepipelines.yaml b/config/crd/bases/components.platform.opendatahub.io_datasciencepipelines.yaml index 2a82f2bd13b..db2562be985 100644 --- a/config/crd/bases/components.platform.opendatahub.io_datasciencepipelines.yaml +++ b/config/crd/bases/components.platform.opendatahub.io_datasciencepipelines.yaml @@ -78,14 +78,17 @@ spec: preloadedPipelines: properties: instructLab: + description: |- + Configure whether to auto import the InstructLab pipeline pon any new pipeline server (or DSPA) creation. + Please note that the pipeline requires that trainingoperator be enabled in the DSC to run. properties: state: default: Removed description: |- Set to one of the following values: - - "Managed" : TODO - - "Removed" : TODO + - "Managed" : Upon any new pipeline server (or DSPA) creation this pipeline is auto imported + - "Removed" : Upon any new pipeline server (or DSPA) creation this pipeline is not auto imported enum: - Managed - Removed diff --git a/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml b/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml index 3bac62a8305..fc1c4e3030f 100644 --- a/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml +++ b/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml @@ -189,14 +189,17 @@ spec: preloadedPipelines: properties: instructLab: + description: |- + Configure whether to auto import the InstructLab pipeline pon any new pipeline server (or DSPA) creation. + Please note that the pipeline requires that trainingoperator be enabled in the DSC to run. properties: state: default: Removed description: |- Set to one of the following values: - - "Managed" : TODO - - "Removed" : TODO + - "Managed" : Upon any new pipeline server (or DSPA) creation this pipeline is auto imported + - "Removed" : Upon any new pipeline server (or DSPA) creation this pipeline is not auto imported enum: - Managed - Removed diff --git a/controllers/components/datasciencepipelines/datasciencepipelines_controller_actions.go b/controllers/components/datasciencepipelines/datasciencepipelines_controller_actions.go index 56bb206c79b..bcc77a3c8e9 100644 --- a/controllers/components/datasciencepipelines/datasciencepipelines_controller_actions.go +++ b/controllers/components/datasciencepipelines/datasciencepipelines_controller_actions.go @@ -83,6 +83,11 @@ func initialize(_ context.Context, rr *odhtypes.ReconciliationRequest) error { return fmt.Errorf("marshalling preloaded pipelines failed: %w", err) } + data, err = json.Marshal(string(data)) + if err != nil { + return fmt.Errorf("marshalling preloaded pipelines failed: %w", err) + } + extraParamsMap := map[string]string{ "PREINSTALLEDPIPELINES": string(data), } diff --git a/tests/e2e/helper_test.go b/tests/e2e/helper_test.go index 76694c5668f..7b81430d938 100644 --- a/tests/e2e/helper_test.go +++ b/tests/e2e/helper_test.go @@ -158,7 +158,7 @@ func setupDSCInstance(name string) *dscv1.DataScienceCluster { }, DataSciencePipelinesCommonSpec: componentApi.DataSciencePipelinesCommonSpec{ PreloadedPipelines: datasciencepipelines.PreloadedPipelinesSpec{ - InstructLab: datasciencepipelines.InstructLabPipelineSpec{ + InstructLab: datasciencepipelines.PreloadedPipelineOptions{ State: operatorv1.Removed, }, },