From 26522569838124a7092e1c87cbae1fd9dcf2f436 Mon Sep 17 00:00:00 2001 From: Juntao Wang Date: Mon, 19 Aug 2024 12:54:58 -0400 Subject: [PATCH] Adapt model deployment modals to the latest design --- .../cypress/cypress/pages/modelServing.ts | 6 +- .../components/DeployRegisteredModelModal.tsx | 14 +- .../DataConnectionExistingField.tsx | 4 +- .../DataConnectionFolderPathField.tsx | 1 + .../InferenceServiceFrameworkSection.tsx | 7 +- .../InferenceServiceNameSection.tsx | 23 +-- .../InferenceServiceServingRuntimeSection.tsx | 3 +- .../ManageInferenceServiceModal.tsx | 2 +- .../InferenceServiceModal/ProjectSelector.tsx | 5 +- .../AuthServingRuntimeSection.tsx | 39 +++--- .../ServingRuntimeSizeSection.tsx | 27 ++-- .../ServingRuntimeTemplateSection.tsx | 4 +- .../ServingRuntimeTokenSection.tsx | 132 +++++++++--------- .../KServeAutoscalerReplicaSection.tsx | 75 +++++----- .../kServeModal/ManageKServeModal.tsx | 130 ++++++++--------- .../server/AcceleratorProfileSelectField.tsx | 3 +- 16 files changed, 237 insertions(+), 238 deletions(-) diff --git a/frontend/src/__tests__/cypress/cypress/pages/modelServing.ts b/frontend/src/__tests__/cypress/cypress/pages/modelServing.ts index 16566af7e3..fc8f649392 100644 --- a/frontend/src/__tests__/cypress/cypress/pages/modelServing.ts +++ b/frontend/src/__tests__/cypress/cypress/pages/modelServing.ts @@ -117,7 +117,7 @@ class InferenceServiceModal extends Modal { findExistingConnectionSelect() { return this.find() - .findByRole('group', { name: 'Model location' }) + .findByRole('group', { name: 'Source model location' }) .findByRole('button', { name: 'Options menu' }); } @@ -202,9 +202,7 @@ class ServingRuntimeModal extends Modal { } findModelServerSizeSelect() { - return this.find() - .findByRole('group', { name: 'Compute resources per replica' }) - .findByTestId('model-server-size-selection'); + return this.find().findByTestId('model-server-size-selection'); } findModelServerReplicasMinusButton() { diff --git a/frontend/src/pages/modelRegistry/screens/components/DeployRegisteredModelModal.tsx b/frontend/src/pages/modelRegistry/screens/components/DeployRegisteredModelModal.tsx index e0593b5ccb..659cb1b12a 100644 --- a/frontend/src/pages/modelRegistry/screens/components/DeployRegisteredModelModal.tsx +++ b/frontend/src/pages/modelRegistry/screens/components/DeployRegisteredModelModal.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Alert, Button, Form, Modal, Spinner } from '@patternfly/react-core'; +import { Alert, Button, Form, FormSection, Modal, Spinner } from '@patternfly/react-core'; import { ModelVersion } from '~/concepts/modelRegistry/types'; import { ProjectKind } from '~/k8sTypes'; import useProjectErrorForRegisteredModel from '~/pages/modelRegistry/screens/RegisteredModels/useProjectErrorForRegisteredModel'; @@ -92,11 +92,13 @@ const DeployRegisteredModelModal: React.FC = ({ ) : !deployInfoLoaded ? ( ) : ( - + + + )} diff --git a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionExistingField.tsx b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionExistingField.tsx index f2ab552f28..0f95a8a1aa 100644 --- a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionExistingField.tsx +++ b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionExistingField.tsx @@ -74,9 +74,8 @@ const DataConnectionExistingField: React.FC = ( )} - + ({ @@ -84,6 +83,7 @@ const DataConnectionExistingField: React.FC = ( dropdownLabel: getLabeledOption(connection), label: getDataConnectionDisplayName(connection.dataConnection), }))} + toggleProps={{ id: 'inference-service-data-connection' }} value={data.storage.dataConnection} toggleLabel={ selectedDataConnection ? getLabeledOption(selectedDataConnection) : placeholderText diff --git a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionFolderPathField.tsx b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionFolderPathField.tsx index 3d71404df3..0cb29251e9 100644 --- a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionFolderPathField.tsx +++ b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionFolderPathField.tsx @@ -46,6 +46,7 @@ const DataConnectionFolderPathField: React.FC + { const name = framework.version ? `${framework.name} - ${framework.version}` diff --git a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/InferenceServiceNameSection.tsx b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/InferenceServiceNameSection.tsx index d5ded68074..9a030d189a 100644 --- a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/InferenceServiceNameSection.tsx +++ b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/InferenceServiceNameSection.tsx @@ -24,7 +24,7 @@ const InferenceServiceNameSection: React.FC = const validated = !isNameValid ? 'warning' : 'default'; return ( - + = onChange={(e, name) => setData('name', name)} validated={validated} /> - {validated === 'warning' && ( - - - }> - Cannot exceed 253 characters - - - - )} + + + } + > + {isNameValid + ? 'This is the name of the inference service created when the model is deployed' + : 'Cannot exceed 253 characters'} + + + ); }; diff --git a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/InferenceServiceServingRuntimeSection.tsx b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/InferenceServiceServingRuntimeSection.tsx index 869cf2a90f..c62eaa2ebd 100644 --- a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/InferenceServiceServingRuntimeSection.tsx +++ b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/InferenceServiceServingRuntimeSection.tsx @@ -49,7 +49,7 @@ const InferenceServiceServingRuntimeSection: React.FC< } return ( - + = /> - + = ({ const { projects } = React.useContext(ProjectsContext); return ( - +