diff --git a/README.md b/README.md
index 1de5dba1e90..2cb5af53d40 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,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)
@@ -314,6 +315,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 a9727177128..67574844c01 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/rhods-operator.clusterserviceversion.yaml b/bundle/manifests/rhods-operator.clusterserviceversion.yaml
index 2973e8927af..a02968ebe93 100644
--- a/bundle/manifests/rhods-operator.clusterserviceversion.yaml
+++ b/bundle/manifests/rhods-operator.clusterserviceversion.yaml
@@ -30,6 +30,9 @@ metadata:
},
"kserve": {
"managementState": "Managed",
+ "nim": {
+ "managementState": "Managed"
+ },
"serving": {
"ingressGateway": {
"certificate": {
diff --git a/components/kserve/kserve.go b/components/kserve/kserve.go
index 2668810e7ff..e8750adcbf8 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) OverrideManifests(ctx context.Context, _ cluster.Platform) error {
@@ -106,6 +108,9 @@ func (k *Kserve) ReconcileComponent(ctx context.Context, cli client.Client,
monitoringEnabled := dscispec.Monitoring.ManagementState == operatorv1.Managed
if !enabled {
+ if err := deploy.ApplyParams(DependentPath, nil, map[string]string{"nim-state": "removed"}); err != nil {
+ return fmt.Errorf("failed to update NIM flag to removed : %w", err)
+ }
if err := k.removeServerlessFeatures(ctx, cli, owner, dscispec); err != nil {
return err
}
@@ -120,6 +125,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 6a95f9115b7..bc861e5005f 100644
--- a/components/modelmeshserving/modelmeshserving.go
+++ b/components/modelmeshserving/modelmeshserving.go
@@ -11,6 +11,8 @@ import (
"github.com/go-logr/logr"
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"
dsciv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/dscinitialization/v1"
@@ -117,6 +119,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)
}
@@ -169,3 +178,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 59cfce63c3d..020a4f706d7 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 86a6b24bbb4..f33b84ff30b 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 f4259c203f8..f1e082246ab 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