Skip to content

Commit

Permalink
fix: resolved double window and NIM modal showing for KServe. Added a…
Browse files Browse the repository at this point in the history
… link to EmptyModelServing for NIM project. (#3268)

Signed-off-by: Olga Lavtar <[email protected]>
  • Loading branch information
olavtar authored Sep 28, 2024
1 parent 250c555 commit 330dfdf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ProjectObjectType, typedEmptyImage } from '~/concepts/design/utils';
import { ProjectSectionID } from '~/pages/projects/screens/detail/types';
import ServeModelButton from '~/pages/modelServing/screens/global/ServeModelButton';
import { getDisplayNameFromK8sResource } from '~/concepts/k8s/utils';
import { isProjectNIMSupported } from '~/pages/modelServing/screens/projects/nimUtils';

const EmptyModelServing: React.FC = () => {
const navigate = useNavigate();
Expand All @@ -18,10 +19,12 @@ const EmptyModelServing: React.FC = () => {
project,
} = React.useContext(ModelServingContext);
const servingPlatformStatuses = useServingPlatformStatuses();
const isKServeNIMEnabled = project ? isProjectNIMSupported(project) : false;

if (
getProjectModelServingPlatform(project, servingPlatformStatuses).platform !==
ServingRuntimePlatform.SINGLE &&
(getProjectModelServingPlatform(project, servingPlatformStatuses).platform !==
ServingRuntimePlatform.SINGLE ||
isKServeNIMEnabled) &&
servingRuntimes.length === 0
) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ import EmptyMultiModelServingCard from '~/pages/modelServing/screens/projects/Em
import { ProjectObjectType, typedEmptyImage } from '~/concepts/design/utils';
import EmptyModelServingPlatform from '~/pages/modelServing/screens/projects/EmptyModelServingPlatform';
import EmptyNIMModelServingCard from '~/pages/modelServing/screens/projects/EmptyNIMModelServingCard';
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 { useDashboardNamespace } from '~/redux/selectors';
import { useIsNIMAvailable } from '~/pages/modelServing/screens/projects/useIsNIMAvailable';
import ManageServingRuntimeModal from './ServingRuntimeModal/ManageServingRuntimeModal';
import ModelMeshServingRuntimeTable from './ModelMeshSection/ServingRuntimeTable';
import ModelServingPlatformButtonAction from './ModelServingPlatformButtonAction';
Expand Down Expand Up @@ -263,23 +263,27 @@ const ModelServingPlatform: React.FC = () => {
onSubmit(submit);
}}
/>
<ManageKServeModal
isOpen={platformSelected === ServingRuntimePlatform.SINGLE}
projectContext={{
currentProject,
dataConnections,
}}
servingRuntimeTemplates={templatesEnabled.filter((template) =>
getTemplateEnabledForPlatform(template, ServingRuntimePlatform.SINGLE),
)}
onClose={(submit: boolean) => {
onSubmit(submit);
}}
/>
{isNIMAvailable && (
{!isKServeNIMEnabled ? (
<ManageKServeModal
isOpen={platformSelected === ServingRuntimePlatform.SINGLE}
projectContext={{
currentProject,
dataConnections,
}}
servingRuntimeTemplates={templatesEnabled.filter((template) =>
getTemplateEnabledForPlatform(template, ServingRuntimePlatform.SINGLE),
)}
onClose={(submit: boolean) => {
onSubmit(submit);
}}
/>
) : (
<DeployNIMServiceModal
isOpen={platformSelected === ServingRuntimePlatform.SINGLE}
projectContext={{ currentProject, dataConnections }}
projectContext={{
currentProject,
dataConnections,
}}
onClose={(submit: boolean) => {
onSubmit(submit);
}}
Expand Down

0 comments on commit 330dfdf

Please sign in to comment.