diff --git a/README.md b/README.md
index 9174a78e274..576fdd79a18 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,7 @@ and configure these applications.
- [Deployment](#deployment)
- [Test with customized manifests](#test-with-customized-manifests)
- [Update API docs](#update-api-docs)
+ - [Enabled logging](#enabled-logging)
- [Example DSCInitialization](#example-dscinitialization)
- [Example DataScienceCluster](#example-datasciencecluster)
- [Run functional Tests](#run-functional-tests)
@@ -304,6 +305,8 @@ spec:
managementState: Managed
kserve:
managementState: Managed
+ nim:
+ managementState: Managed
serving:
ingressGateway:
certificate:
diff --git a/apis/infrastructure/v1/nim_types.go b/apis/infrastructure/v1/nim_types.go
new file mode 100644
index 00000000000..e26ba36fc03
--- /dev/null
+++ b/apis/infrastructure/v1/nim_types.go
@@ -0,0 +1,12 @@
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+)
+
+// nimSpec enables NVIDIA NIM integration
+type NimSpec struct {
+ // +kubebuilder:validation:Enum=Managed;Removed
+ // +kubebuilder:default=Managed
+ ManagementState operatorv1.ManagementState `json:"managementState,omitempty"`
+}
diff --git a/apis/infrastructure/v1/zz_generated.deepcopy.go b/apis/infrastructure/v1/zz_generated.deepcopy.go
index e0bf63ff9c9..0e59c4acb20 100644
--- a/apis/infrastructure/v1/zz_generated.deepcopy.go
+++ b/apis/infrastructure/v1/zz_generated.deepcopy.go
@@ -92,6 +92,21 @@ func (in *GatewaySpec) DeepCopy() *GatewaySpec {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *NimSpec) DeepCopyInto(out *NimSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NimSpec.
+func (in *NimSpec) DeepCopy() *NimSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(NimSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceMeshSpec) DeepCopyInto(out *ServiceMeshSpec) {
*out = *in
diff --git a/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml b/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml
index da6d20509c6..34e56260e6a 100644
--- a/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml
+++ b/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml
@@ -245,6 +245,17 @@ spec:
- Removed
pattern: ^(Managed|Unmanaged|Force|Removed)$
type: string
+ nim:
+ description: Configures and enables NVIDIA NIM integration
+ properties:
+ managementState:
+ default: Managed
+ enum:
+ - Managed
+ - Removed
+ pattern: ^(Managed|Unmanaged|Force|Removed)$
+ type: string
+ type: object
serving:
description: |-
Serving configures the KNative-Serving stack used for model serving. A Service
diff --git a/bundle/manifests/opendatahub-operator.clusterserviceversion.yaml b/bundle/manifests/opendatahub-operator.clusterserviceversion.yaml
index 990b4b066ff..76b2ad14a88 100644
--- a/bundle/manifests/opendatahub-operator.clusterserviceversion.yaml
+++ b/bundle/manifests/opendatahub-operator.clusterserviceversion.yaml
@@ -30,6 +30,9 @@ metadata:
},
"kserve": {
"managementState": "Managed",
+ "nim": {
+ "managementState": "Managed"
+ },
"serving": {
"ingressGateway": {
"certificate": {
@@ -103,7 +106,7 @@ metadata:
categories: AI/Machine Learning, Big Data
certified: "False"
containerImage: quay.io/opendatahub/opendatahub-operator:v2.21.0
- createdAt: "2024-11-18T18:28:55Z"
+ createdAt: "2024-11-22T19:16:14Z"
olm.skipRange: '>=1.0.0 <2.21.0'
operators.operatorframework.io/builder: operator-sdk-v1.31.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
diff --git a/components/kserve/kserve.go b/components/kserve/kserve.go
index 3734551ba56..4aac993bfb7 100644
--- a/components/kserve/kserve.go
+++ b/components/kserve/kserve.go
@@ -54,6 +54,8 @@ type Kserve struct {
// This field is optional. If no default deployment mode is specified, Kserve will use Serverless mode.
// +kubebuilder:validation:Enum=Serverless;RawDeployment
DefaultDeploymentMode DefaultDeploymentMode `json:"defaultDeploymentMode,omitempty"`
+ // Configures and enables NVIDIA NIM integration
+ NIM infrav1.NimSpec `json:"nim,omitempty"`
}
func (k *Kserve) Init(ctx context.Context, _ cluster.Platform) error {
@@ -63,7 +65,6 @@ func (k *Kserve) Init(ctx context.Context, _ cluster.Platform) error {
var dependentParamMap = map[string]string{
"odh-model-controller": "RELATED_IMAGE_ODH_MODEL_CONTROLLER_IMAGE",
}
-
// Update image parameters for odh-model-controller
if err := deploy.ApplyParams(DependentPath, dependentParamMap); err != nil {
log.Error(err, "failed to update image", "path", DependentPath)
@@ -131,6 +132,12 @@ func (k *Kserve) ReconcileComponent(ctx context.Context, cli client.Client,
return err
}
}
+ extraParamsMap := map[string]string{
+ "nim-state": string(k.NIM.ManagementState),
+ }
+ if err := deploy.ApplyParams(DependentPath, nil, extraParamsMap); err != nil {
+ return fmt.Errorf("failed to update NIM flag from %s : %w", Path, err)
+ }
}
if err := k.configureServiceMesh(ctx, cli, owner, dscispec); err != nil {
diff --git a/components/kserve/zz_generated.deepcopy.go b/components/kserve/zz_generated.deepcopy.go
index da6e99960b7..4f7ae11d226 100644
--- a/components/kserve/zz_generated.deepcopy.go
+++ b/components/kserve/zz_generated.deepcopy.go
@@ -27,6 +27,7 @@ func (in *Kserve) DeepCopyInto(out *Kserve) {
*out = *in
in.Component.DeepCopyInto(&out.Component)
out.Serving = in.Serving
+ out.NIM = in.NIM
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kserve.
diff --git a/components/modelmeshserving/modelmeshserving.go b/components/modelmeshserving/modelmeshserving.go
index aae48120270..9a49702c6b1 100644
--- a/components/modelmeshserving/modelmeshserving.go
+++ b/components/modelmeshserving/modelmeshserving.go
@@ -10,6 +10,8 @@ import (
operatorv1 "github.com/openshift/api/operator/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+ "k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
logf "sigs.k8s.io/controller-runtime/pkg/log"
@@ -126,6 +128,13 @@ func (m *ModelMeshServing) ReconcileComponent(ctx context.Context,
}
}
+ extraParamsMap := map[string]string{
+ "nim-state": getNimManagementFlag(owner),
+ }
+ if err := deploy.ApplyParams(DependentPath, nil, extraParamsMap); err != nil {
+ return fmt.Errorf("failed to update image from %s : %w", Path, err)
+ }
+
if err := deploy.DeployManifestsFromPath(ctx, cli, owner, Path, dscispec.ApplicationsNamespace, ComponentName, enabled); err != nil {
return fmt.Errorf("failed to apply manifests from %s : %w", Path, err)
}
@@ -173,3 +182,19 @@ func (m *ModelMeshServing) ReconcileComponent(ctx context.Context,
return nil
}
+
+func getNimManagementFlag(obj metav1.Object) string {
+ removed := string(operatorv1.Removed)
+ un, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj)
+ if err != nil {
+ return removed
+ }
+ kserve, foundKserve, _ := unstructured.NestedString(un, "spec", "components", "kserve", "managementState")
+ if foundKserve && kserve != removed {
+ nim, foundNim, _ := unstructured.NestedString(un, "spec", "components", "kserve", "nim", "managementState")
+ if foundNim {
+ return nim
+ }
+ }
+ return removed
+}
diff --git a/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml b/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml
index 41d1c76d658..9d8c107afc6 100644
--- a/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml
+++ b/config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml
@@ -245,6 +245,17 @@ spec:
- Removed
pattern: ^(Managed|Unmanaged|Force|Removed)$
type: string
+ nim:
+ description: Configures and enables NVIDIA NIM integration
+ properties:
+ managementState:
+ default: Managed
+ enum:
+ - Managed
+ - Removed
+ pattern: ^(Managed|Unmanaged|Force|Removed)$
+ type: string
+ type: object
serving:
description: |-
Serving configures the KNative-Serving stack used for model serving. A Service
diff --git a/config/samples/datasciencecluster_v1_datasciencecluster.yaml b/config/samples/datasciencecluster_v1_datasciencecluster.yaml
index 626fc5442d1..4dc9443c956 100644
--- a/config/samples/datasciencecluster_v1_datasciencecluster.yaml
+++ b/config/samples/datasciencecluster_v1_datasciencecluster.yaml
@@ -18,6 +18,9 @@ spec:
managementState: "Managed"
kserve: {
managementState: "Managed",
+ nim: {
+ managementState: "Managed"
+ },
serving: {
ingressGateway: {
certificate: {
diff --git a/docs/api-overview.md b/docs/api-overview.md
index 234d68dfa8b..d9a04053b94 100644
--- a/docs/api-overview.md
+++ b/docs/api-overview.md
@@ -183,6 +183,7 @@ _Appears in:_
| `Component` _[Component](#component)_ | | | |
| `serving` _[ServingSpec](#servingspec)_ | Serving configures the KNative-Serving stack used for model serving. A Service
Mesh (Istio) is prerequisite, since it is used as networking layer. | | |
| `defaultDeploymentMode` _[DefaultDeploymentMode](#defaultdeploymentmode)_ | Configures the default deployment mode for Kserve. This can be set to 'Serverless' or 'RawDeployment'.
The value specified in this field will be used to set the default deployment mode in the 'inferenceservice-config' configmap for Kserve.
This field is optional. If no default deployment mode is specified, Kserve will use Serverless mode. | | Enum: [Serverless RawDeployment]
Pattern: `^(Serverless\|RawDeployment)$`
|
+| `nim` _[NimSpec](#nimspec)_ | Configures and enables NVIDIA NIM integration | | |
@@ -523,6 +524,22 @@ _Appears in:_
| `certificate` _[CertificateSpec](#certificatespec)_ | Certificate specifies configuration of the TLS certificate securing communication
for the gateway. | | |
+#### NimSpec
+
+
+
+nimSpec enables NVIDIA NIM integration
+
+
+
+_Appears in:_
+- [Kserve](#kserve)
+
+| Field | Description | Default | Validation |
+| --- | --- | --- | --- |
+| `managementState` _[ManagementState](#managementstate)_ | | Managed | Enum: [Managed Removed]
|
+
+
#### ServiceMeshSpec