diff --git a/frontend/src/pages/modelServing/screens/global/DeleteInferenceServiceModal.tsx b/frontend/src/pages/modelServing/screens/global/DeleteInferenceServiceModal.tsx index 5b97cf30df..c95541d01b 100644 --- a/frontend/src/pages/modelServing/screens/global/DeleteInferenceServiceModal.tsx +++ b/frontend/src/pages/modelServing/screens/global/DeleteInferenceServiceModal.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import DeleteModal from '~/pages/projects/components/DeleteModal'; import { InferenceServiceKind, ServingRuntimeKind } from '~/k8sTypes'; -import { deleteInferenceService, deletePvc, deleteServingRuntime } from '~/api'; +import { deleteInferenceService, deletePvc, deleteSecret, deleteServingRuntime } from '~/api'; import { getDisplayNameFromK8sResource } from '~/concepts/k8s/utils'; import { byName, ProjectsContext } from '~/concepts/projects/ProjectsContext'; import { isProjectNIMSupported } from '~/pages/modelServing/screens/projects/nimUtils'; @@ -48,6 +48,14 @@ const DeleteInferenceServiceModal: React.FC = const pvcName = servingRuntime?.spec.volumes?.find( (vol) => vol.persistentVolumeClaim?.claimName, )?.persistentVolumeClaim?.claimName; + const containerWithEnv = servingRuntime?.spec.containers.find( + (container) => + container.env && container.env.some((env) => env.valueFrom?.secretKeyRef?.name), + ); + const nimSecretName = containerWithEnv?.env?.find( + (env) => env.valueFrom?.secretKeyRef?.name, + )?.valueFrom?.secretKeyRef?.name; + const imagePullSecretName = servingRuntime?.spec.imagePullSecrets[0]?.name; Promise.all([ deleteInferenceService( inferenceService.metadata.name, @@ -64,6 +72,12 @@ const DeleteInferenceServiceModal: React.FC = ...(isKServeNIMEnabled && pvcName ? [deletePvc(pvcName, inferenceService.metadata.namespace)] : []), + ...(isKServeNIMEnabled && project + ? [ + deleteSecret(project.metadata.name, nimSecretName), + deleteSecret(project.metadata.name, imagePullSecretName), + ] + : []), ]) .then(() => { diff --git a/frontend/src/pages/modelServing/screens/projects/ModelServingPlatform.tsx b/frontend/src/pages/modelServing/screens/projects/ModelServingPlatform.tsx index f0db65a9ec..848d8746d6 100644 --- a/frontend/src/pages/modelServing/screens/projects/ModelServingPlatform.tsx +++ b/frontend/src/pages/modelServing/screens/projects/ModelServingPlatform.tsx @@ -36,6 +36,7 @@ import EmptyNIMModelServingCard from '~/pages/modelServing/screens/projects/Empt import { useIsNIMAvailable } from '~/pages/modelServing/screens/projects/useIsNIMAvailable'; import { isProjectNIMSupported } from '~/pages/modelServing/screens/projects/nimUtils'; import { useDashboardNamespace } from '~/redux/selectors'; +import DeployNIMServiceModal from '~/pages/modelServing/screens/projects/NIMServiceModal/DeployNIMServiceModal'; import ManageServingRuntimeModal from './ServingRuntimeModal/ManageServingRuntimeModal'; import ModelMeshServingRuntimeTable from './ModelMeshSection/ServingRuntimeTable'; import ModelServingPlatformButtonAction from './ModelServingPlatformButtonAction'; @@ -275,6 +276,15 @@ const ModelServingPlatform: React.FC = () => { onSubmit(submit); }} /> + {isNIMAvailable && ( + { + onSubmit(submit); + }} + /> + )} ); }; diff --git a/frontend/src/pages/modelServing/screens/projects/NIMServiceModal/DeployNIMServiceModal.tsx b/frontend/src/pages/modelServing/screens/projects/NIMServiceModal/DeployNIMServiceModal.tsx index f8908cd818..e3d27a932d 100644 --- a/frontend/src/pages/modelServing/screens/projects/NIMServiceModal/DeployNIMServiceModal.tsx +++ b/frontend/src/pages/modelServing/screens/projects/NIMServiceModal/DeployNIMServiceModal.tsx @@ -126,7 +126,7 @@ const DeployNIMServiceModal: React.FC = ({ const [actionInProgress, setActionInProgress] = React.useState(false); const [error, setError] = React.useState(); const [alertVisible, setAlertVisible] = React.useState(true); - const [pvcSize, setPvcSize] = React.useState(''); + const [pvcSize, setPvcSize] = React.useState('30Gi'); React.useEffect(() => { if (currentProjectName && isOpen) { diff --git a/frontend/src/pages/modelServing/screens/projects/NIMServiceModal/NIMModelListSection.tsx b/frontend/src/pages/modelServing/screens/projects/NIMServiceModal/NIMModelListSection.tsx index 120ec8fce2..be19b0ef20 100644 --- a/frontend/src/pages/modelServing/screens/projects/NIMServiceModal/NIMModelListSection.tsx +++ b/frontend/src/pages/modelServing/screens/projects/NIMServiceModal/NIMModelListSection.tsx @@ -85,6 +85,7 @@ const NIMModelListSection: React.FC = ({ return ( => { throw new Error(`Error fetching secret: ${response.statusText}`); } const secretData = await response.json(); - return secretData; + return secretData.body; } catch (error) { throw new Error(`Failed to fetch secret: ${secretName}.`); } }; export const getNIMData = async (isNGC: boolean): Promise | undefined> => { - const nimSecretData = isNGC + const nimSecretData: SecretKind = isNGC ? await getNIMSecretData(NIM_NGC_SECRET_NAME) : await getNIMSecretData(NIM_SECRET_NAME); diff --git a/frontend/src/pages/projects/screens/detail/overview/serverModels/deployedModels/DeployedModelsSection.tsx b/frontend/src/pages/projects/screens/detail/overview/serverModels/deployedModels/DeployedModelsSection.tsx index 0561d4d81e..8f6a360b00 100644 --- a/frontend/src/pages/projects/screens/detail/overview/serverModels/deployedModels/DeployedModelsSection.tsx +++ b/frontend/src/pages/projects/screens/detail/overview/serverModels/deployedModels/DeployedModelsSection.tsx @@ -32,6 +32,7 @@ import AddModelFooter from '~/pages/projects/screens/detail/overview/serverModel import { InferenceServiceKind } from '~/k8sTypes'; import { ProjectSectionID } from '~/pages/projects/screens/detail/types'; import ModelServingContextProvider from '~/pages/modelServing/ModelServingContext'; +import { isProjectNIMSupported } from '~/pages/modelServing/screens/projects/nimUtils'; import DeployedModelsCard from './DeployedModelsCard'; interface DeployedModelsSectionProps { @@ -53,6 +54,8 @@ const DeployedModelsSection: React.FC = ({ isMultiPl ); const [deployedModels, setDeployedModels] = React.useState([]); + const isKServeNIMEnabled = isProjectNIMSupported(currentProject); + React.useEffect(() => { if (!inferenceServicesLoaded || !modelServersLoaded) { return; @@ -176,7 +179,7 @@ const DeployedModelsSection: React.FC = ({ isMultiPl )} - {!platformError ? : null} + {!platformError ? : null} ); }