Skip to content

Commit

Permalink
Add configuration to pipeline stanza of DSC to enable InstructLab pip…
Browse files Browse the repository at this point in the history
…eline
  • Loading branch information
lburgazzoli committed Jan 9, 2025
1 parent 35dcacc commit cb45a5e
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 17 deletions.
10 changes: 6 additions & 4 deletions apis/components/v1alpha1/datasciencepipelines/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
Expand Down

0 comments on commit cb45a5e

Please sign in to comment.