Skip to content

Commit 0331a6b

Browse files
committed
Apply ConfigHash label to APIServer Pod
- Restarts APIServer on SampleConfig JSON changes Signed-off-by: Giulio Frasca <[email protected]>
1 parent aed281a commit 0331a6b

File tree

11 files changed

+136
-94
lines changed

11 files changed

+136
-94
lines changed

api/v1/dspipeline_types.go

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,24 @@ type DSPASpec struct {
5555
*WorkflowController `json:"workflowController,omitempty"`
5656
}
5757

58+
// +kubebuilder:validation:Pattern=`^(Managed|Removed)$`
59+
type ManagedPipelineState string
60+
5861
type ManagedPipelineOptions struct {
59-
// Include managed pipelines with the deployment of this DSP API Server. Default: nil
60-
// Applicable values:"Managed" or "Removed"
62+
// Set to one of the following values:
63+
//
64+
// - "Managed" : This pipeline is automatically imported.
65+
// - "Removed" : This pipeline is not automatically imported when a new pipeline server or DSPA is created. If previously set to "Managed", setting to "Removed" does not remove existing preloaded pipelines but does prevent future updates from being imported.
66+
//
67+
// +kubebuilder:validation:Enum=Managed;Removed
68+
// +kubebuilder:default=Removed
6169
// +kubebuilder:validation:Optional
62-
State string `json:"state,omitempty"`
70+
State ManagedPipelineState `json:"state,omitempty"`
6371
}
6472

6573
type ManagedPipelinesSpec struct {
66-
// Include instructlab multi-phase training pipelines with the deployment of this DSP API Server.
74+
// Configures whether to automatically import the InstructLab pipeline.
75+
// You must enable the trainingoperator component to run the InstructLab pipeline.
6776
// +kubebuilder:validation:Optional
6877
InstructLab *ManagedPipelineOptions `json:"instructLab,omitempty"`
6978
}
@@ -79,7 +88,7 @@ type APIServer struct {
7988
// +kubebuilder:default:=true
8089
// +kubebuilder:validation:Optional
8190
EnableRoute bool `json:"enableOauth"`
82-
// Include Iris sample pipeline with the deployment of this DSP API Server. Default: true
91+
// Include the Iris sample pipeline with the deployment of this DSP API Server. Default: true
8392
// +kubebuilder:default:=false
8493
// +Deprecated
8594
// +kubebuilder:validation:Optional
@@ -96,7 +105,7 @@ type APIServer struct {
96105
ToolboxImage string `json:"toolboxImage,omitempty"`
97106
// RhelAI image used for ilab tasks in managed pipelines.
98107
RHELAIImage string `json:"rhelAIImage,omitempty"`
99-
// Enable various pipelines with the deployment of this DSP API server.
108+
// Enable various managed pipelines on this DSP API server.
100109
ManagedPipelines *ManagedPipelinesSpec `json:"managedPipelines,omitempty"`
101110
// Specify custom Pod resource requirements for this component.
102111
Resources *ResourceRequirements `json:"resources,omitempty"`

api/v1alpha1/dspipeline_types.go

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,26 @@ type DSPASpec struct {
5555
*WorkflowController `json:"workflowController,omitempty"`
5656
}
5757

58-
type ManagedPipelines struct {
59-
// Include instructlab multi-phase training pipelines with the deployment of this DSP API Server. Default: true
60-
// Applicable values:"Managed" or "Removed"
58+
// +kubebuilder:validation:Pattern=`^(Managed|Removed)$`
59+
type ManagedPipelineState string
60+
61+
type ManagedPipelineOptions struct {
62+
// Set to one of the following values:
63+
//
64+
// - "Managed" : This pipeline is automatically imported.
65+
// - "Removed" : This pipeline is not automatically imported when a new pipeline server or DSPA is created. If previously set to "Managed", setting to "Removed" does not remove existing preloaded pipelines but does prevent future updates from being imported.
66+
//
67+
// +kubebuilder:validation:Enum=Managed;Removed
68+
// +kubebuilder:default=Removed
6169
// +kubebuilder:validation:Optional
62-
EnableInstructLabPipeline string `json:"enableInstructLabPipeline,omitempty"`
63-
// Include sample pipelines with the deployment of this DSP API Server. Default: true
64-
// Applicable values:"Managed" or "Removed"
70+
State ManagedPipelineState `json:"state,omitempty"`
71+
}
72+
73+
type ManagedPipelinesSpec struct {
74+
// Configures whether to automatically import the InstructLab pipeline.
75+
// You must enable the trainingoperator component to run the InstructLab pipeline.
6576
// +kubebuilder:validation:Optional
66-
EnableIrisPipeline string `json:"enableIrisPipeline,omitempty"`
77+
InstructLab *ManagedPipelineOptions `json:"instructLab,omitempty"`
6778
}
6879

6980
type APIServer struct {
@@ -77,8 +88,9 @@ type APIServer struct {
7788
// +kubebuilder:default:=true
7889
// +kubebuilder:validation:Optional
7990
EnableRoute bool `json:"enableOauth"`
80-
// Include sample pipelines with the deployment of this DSP API Server. Default: true
91+
// Include the Iris sample pipeline with the deployment of this DSP API Server. Default: true
8192
// +kubebuilder:default:=false
93+
// +Deprecated
8294
// +kubebuilder:validation:Optional
8395
EnableSamplePipeline bool `json:"enableSamplePipeline"`
8496
// Launcher/Executor image used during pipeline execution.
@@ -93,8 +105,8 @@ type APIServer struct {
93105
ToolboxImage string `json:"toolboxImage,omitempty"`
94106
// RhelAI image used for ilab tasks in managed pipelines.
95107
RHELAIImage string `json:"rhelAIImage,omitempty"`
96-
// Enable various pipelines with the deployment of this DSP API server.
97-
ManagedPipelines *ManagedPipelines `json:"managedPipelines,omitempty"`
108+
// Enable various managed pipelines on this DSP API server.
109+
ManagedPipelines *ManagedPipelinesSpec `json:"managedPipelines,omitempty"`
98110
// Specify custom Pod resource requirements for this component.
99111
Resources *ResourceRequirements `json:"resources,omitempty"`
100112
// Specify init container resource requirements. The init container

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 26 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/configmaps/files/config.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,18 @@ Images:
1313
RuntimeGeneric: $(IMAGES_PIPELINESRUNTIMEGENERIC)
1414
Toolbox: $(IMAGES_TOOLBOX)
1515
RHELAI: $(IMAGES_RHELAI)
16-
Samples:
17-
Iris: /pipelines/iris-compiled.yaml
18-
Instructlab: /pipelines/instructlab.yaml
1916
ManagedPipelinesMetadata:
2017
Instructlab:
2118
Name: "[InstructLab] LLM Training Pipeline"
2219
Description:
2320
Filepath: /pipelines/instructlab.yaml
24-
VersionName: "[InstructLab] LLM Training Pipeline - $(PLATFORMVERSION)"
21+
VersionName: "[InstructLab] LLM Training Pipeline"
2522
# VersionDescription: "TODO - Add a Version Description"
26-
Iris:
23+
Iris:
2724
Name: "[Demo] iris-training"
2825
Description: "[source code](https://github.com/opendatahub-io/data-science-pipelines/tree/master/samples/iris-sklearn) A simple pipeline to demonstrate a basic ML Training workflow"
2926
Filepath: /samples/iris-pipeline-compiled.yaml
30-
VersionName: "[Demo] iris-training - $(PLATFORMVERSION)"
27+
VersionName: "[Demo] iris-training"
3128
# VersionDescription: "TODO - Add a Version Description"
3229
DSPO:
3330
HealthCheck:

config/crd/bases/datasciencepipelinesapplications.opendatahub.io_datasciencepipelinesapplications.yaml

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ spec:
114114
type: boolean
115115
enableSamplePipeline:
116116
default: false
117-
description: 'Include Iris sample pipeline with the deployment
117+
description: 'Include the Iris sample pipeline with the deployment
118118
of this DSP API Server. Default: true'
119119
type: boolean
120120
image:
@@ -157,17 +157,27 @@ spec:
157157
type: object
158158
type: object
159159
managedPipelines:
160-
description: Enable various pipelines with the deployment of this
161-
DSP API server.
160+
description: Enable various managed pipelines on this DSP API
161+
server.
162162
properties:
163163
instructLab:
164-
description: Include instructlab multi-phase training pipelines
165-
with the deployment of this DSP API Server.
164+
description: Configures whether to automatically import the
165+
InstructLab pipeline. You must enable the trainingoperator
166+
component to run the InstructLab pipeline.
166167
properties:
167168
state:
168-
description: 'Include managed pipelines with the deployment
169-
of this DSP API Server. Default: nil Applicable values:"Managed"
170-
or "Removed"'
169+
default: Removed
170+
description: "Set to one of the following values: \n -
171+
\"Managed\" : This pipeline is automatically imported.
172+
- \"Removed\" : This pipeline is not automatically imported
173+
when a new pipeline server or DSPA is created. If previously
174+
set to \"Managed\", setting to \"Removed\" does not
175+
remove existing preloaded pipelines but does prevent
176+
future updates from being imported."
177+
enum:
178+
- Managed
179+
- Removed
180+
pattern: ^(Managed|Removed)$
171181
type: string
172182
type: object
173183
type: object
@@ -1063,8 +1073,8 @@ spec:
10631073
type: boolean
10641074
enableSamplePipeline:
10651075
default: false
1066-
description: 'Include sample pipelines with the deployment of
1067-
this DSP API Server. Default: true'
1076+
description: 'Include the Iris sample pipeline with the deployment
1077+
of this DSP API Server. Default: true'
10681078
type: boolean
10691079
image:
10701080
description: Specify a custom image for DSP API Server.
@@ -1111,19 +1121,29 @@ spec:
11111121
DSP V1 only, will be removed in the future.'
11121122
type: boolean
11131123
managedPipelines:
1114-
description: Enable various pipelines with the deployment of this
1115-
DSP API server.
1124+
description: Enable various managed pipelines on this DSP API
1125+
server.
11161126
properties:
1117-
enableInstructLabPipeline:
1118-
description: 'Include instructlab multi-phase training pipelines
1119-
with the deployment of this DSP API Server. Default: true
1120-
Applicable values:"Managed" or "Removed"'
1121-
type: string
1122-
enableIrisPipeline:
1123-
description: 'Include sample pipelines with the deployment
1124-
of this DSP API Server. Default: true Applicable values:"Managed"
1125-
or "Removed"'
1126-
type: string
1127+
instructLab:
1128+
description: Configures whether to automatically import the
1129+
InstructLab pipeline. You must enable the trainingoperator
1130+
component to run the InstructLab pipeline.
1131+
properties:
1132+
state:
1133+
default: Removed
1134+
description: "Set to one of the following values: \n -
1135+
\"Managed\" : This pipeline is automatically imported.
1136+
- \"Removed\" : This pipeline is not automatically imported
1137+
when a new pipeline server or DSPA is created. If previously
1138+
set to \"Managed\", setting to \"Removed\" does not
1139+
remove existing preloaded pipelines but does prevent
1140+
future updates from being imported."
1141+
enum:
1142+
- Managed
1143+
- Removed
1144+
pattern: ^(Managed|Removed)$
1145+
type: string
1146+
type: object
11271147
type: object
11281148
moveResultsImage:
11291149
description: 'Image used for internal artifact passing handling

config/internal/apiserver/default/deployment.yaml.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ spec:
1515
dspa: {{.Name}}
1616
template:
1717
metadata:
18+
annotations:
19+
configHash: {{.APIServerConfigHash}}
1820
labels:
1921
app: {{.APIServerDefaultResourceName}}
2022
component: data-science-pipelines
@@ -330,4 +332,3 @@ spec:
330332
- name: sample-pipeline
331333
configMap:
332334
name: sample-pipeline-{{.Name}}
333-

config/overlays/make-deploy/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ patchesStrategicMerge:
88
- img_patch.yaml
99
images:
1010
- name: controller
11-
newName: quay.io/opendatahub/data-science-pipelines-operator
12-
newTag: main
11+
newName: quay.io/gmfrasca/dspo
12+
newTag: managed-pipelines-v0.0.3

0 commit comments

Comments
 (0)