From d9788f8fd59c6a4edf903cddc9b951f56c52de82 Mon Sep 17 00:00:00 2001 From: olavtar <94576904+olavtar@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:14:33 -0700 Subject: [PATCH] Validation for model names and disabled NIM metrics hyperlink (#3314) * fix: added validation for model names and disabled the NIM models metrics hyperlink on the Models tab Signed-off-by: Olga Lavtar * fix: RHOAIENG-13881 - model deployment name allowed illegal chars Signed-off-by: Olga Lavtar * fix: disabling NIM models metrics hyperlink on the Models tab Signed-off-by: Olga Lavtar * fix: fix not to allow numbers in the Model deployment name Signed-off-by: Olga Lavtar --------- Signed-off-by: Olga Lavtar --- .../global/InferenceServiceTableRow.tsx | 24 ++++++------------- .../NIMServiceModal/DeployNIMServiceModal.tsx | 2 +- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/frontend/src/pages/modelServing/screens/global/InferenceServiceTableRow.tsx b/frontend/src/pages/modelServing/screens/global/InferenceServiceTableRow.tsx index 76eb371eeb..765e235ec7 100644 --- a/frontend/src/pages/modelServing/screens/global/InferenceServiceTableRow.tsx +++ b/frontend/src/pages/modelServing/screens/global/InferenceServiceTableRow.tsx @@ -35,34 +35,24 @@ const InferenceServiceTableRow: React.FC = ({ isGlobal, columnNames, }) => { + const { projects } = React.useContext(ProjectsContext); + const project = projects.find(byName(inferenceService.metadata.namespace)) ?? null; + const isKServeNIMEnabled = project ? isProjectNIMSupported(project) : false; + const [modelMetricsEnabled] = useModelMetricsEnabled(); const kserveMetricsEnabled = useIsAreaAvailable(SupportedArea.K_SERVE_METRICS).status; const modelMesh = isModelMesh(inferenceService); const modelMeshMetricsSupported = modelMetricsEnabled && modelMesh; - const kserveMetricsSupported = modelMetricsEnabled && kserveMetricsEnabled && !modelMesh; + const kserveMetricsSupported = + modelMetricsEnabled && kserveMetricsEnabled && !modelMesh && !isKServeNIMEnabled; const displayName = getDisplayNameFromK8sResource(inferenceService); - const { projects } = React.useContext(ProjectsContext); - const project = projects.find(byName(inferenceService.metadata.namespace)) ?? null; - const isKServeNIMEnabled = project ? isProjectNIMSupported(project) : false; - return ( <> - {modelMeshMetricsSupported ? ( - - {displayName} - - ) : kserveMetricsSupported ? ( + {modelMeshMetricsSupported || kserveMetricsSupported ? ( = ({ const servingRuntimeName = editInfo?.inferenceServiceEditInfo?.spec.predictor.model?.runtime || - translateDisplayNameForK8s(createDataInferenceService.name); + translateDisplayNameForK8s(createDataInferenceService.name, { safeK8sPrefix: 'nim-' }); const nimPVCName = getUniqueId('nim-pvc');