From 5e1b3d8f84cff71031c5c40f41c06fc8d90230c6 Mon Sep 17 00:00:00 2001 From: Lucas Fernandez Date: Thu, 23 May 2024 02:37:21 +0200 Subject: [PATCH] Fix inconsistency in token section for model serving --- .../cypress/cypress/pages/modelServing.ts | 4 +++ .../modelServing/servingRuntimeList.cy.ts | 31 +++++++++++++++++-- .../home/aiFlows/DeployAndMonitorGallery.tsx | 4 +-- .../KServeInferenceServiceTableRow.tsx | 2 +- .../screens/projects/ModelServingPlatform.tsx | 2 +- .../AuthServingRuntimeSection.tsx | 10 +++--- .../ServingRuntimeTokenSection.tsx | 2 +- .../kServeModal/ManageKServeModal.tsx | 6 ++-- 8 files changed, 46 insertions(+), 15 deletions(-) diff --git a/frontend/src/__tests__/cypress/cypress/pages/modelServing.ts b/frontend/src/__tests__/cypress/cypress/pages/modelServing.ts index 9284c27644..7d600af7f6 100644 --- a/frontend/src/__tests__/cypress/cypress/pages/modelServing.ts +++ b/frontend/src/__tests__/cypress/cypress/pages/modelServing.ts @@ -171,6 +171,10 @@ class ServingRuntimeModal extends Modal { return this.find().findByTestId('serving-runtime-template-selection'); } + findAuthenticationSection() { + return this.find().findByTestId('auth-section'); + } + findModelRouteCheckbox() { return this.find().findByTestId('alt-form-checkbox-route'); } diff --git a/frontend/src/__tests__/cypress/cypress/tests/mocked/modelServing/servingRuntimeList.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/mocked/modelServing/servingRuntimeList.cy.ts index c920156135..09d9be6541 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/mocked/modelServing/servingRuntimeList.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/mocked/modelServing/servingRuntimeList.cy.ts @@ -931,6 +931,33 @@ describe('Serving Runtime List', () => { kserveModal.findLocationPathInput().type('correct-path'); kserveModal.findSubmitButton().should('be.enabled'); }); + + it('Check authentication section', () => { + initIntercepts({ + disableModelMeshConfig: false, + disableKServeConfig: false, + servingRuntimes: [], + requiredCapabilities: [StackCapability.SERVICE_MESH, StackCapability.SERVICE_MESH_AUTHZ], + }); + projectDetails.visitSection('test-project', 'model-server'); + + modelServingSection.getServingPlatformCard('single-serving').findDeployModelButton().click(); + + kserveModal.shouldBeOpen(); + + kserveModal.findSubmitButton().should('be.disabled'); + + // Test labels are correct + expect( + kserveModal.findAuthenticationSection().findByText('Token authentication').should('exist'), + ); + expect( + kserveModal + .findAuthenticationSection() + .findByText('Require token authentication') + .should('exist'), + ); + }); }); describe('ModelMesh model server', () => { @@ -1565,7 +1592,7 @@ describe('Serving Runtime List', () => { const kserveRow = modelServingSection.getKServeRow('Llama Caikit'); kserveRow.findExpansion().should(be.collapsed); kserveRow.findToggleButton().click(); - kserveRow.findDescriptionListItem('Token authorization').should('exist'); + kserveRow.findDescriptionListItem('Token authentication').should('exist'); }); it('Check token section is disabled if capability is disabled', () => { @@ -1579,7 +1606,7 @@ describe('Serving Runtime List', () => { const kserveRow = modelServingSection.getKServeRow('Llama Caikit'); kserveRow.findExpansion().should(be.collapsed); kserveRow.findToggleButton().click(); - kserveRow.findDescriptionListItem('Token authorization').should('not.exist'); + kserveRow.findDescriptionListItem('Token authentication').should('not.exist'); }); }); diff --git a/frontend/src/pages/home/aiFlows/DeployAndMonitorGallery.tsx b/frontend/src/pages/home/aiFlows/DeployAndMonitorGallery.tsx index 45da98f2b1..7860d6e1e3 100644 --- a/frontend/src/pages/home/aiFlows/DeployAndMonitorGallery.tsx +++ b/frontend/src/pages/home/aiFlows/DeployAndMonitorGallery.tsx @@ -24,8 +24,8 @@ const DeployAndMonitorGallery: React.FC<{ onClose: () => void }> = ({ onClose }) Use model servers to deploy models for testing and implementing in intelligent applications. Configuring a model server includes specifying the number of replicas - being deployed, the server size, the token authorization, the serving runtime, and how - the project that the model server belongs to is accessed. + being deployed, the server size, the token authentication, the serving runtime, and + how the project that the model server belongs to is accessed. } diff --git a/frontend/src/pages/modelServing/screens/projects/KServeSection/KServeInferenceServiceTableRow.tsx b/frontend/src/pages/modelServing/screens/projects/KServeSection/KServeInferenceServiceTableRow.tsx index e6bffc8749..2bcf8154b2 100644 --- a/frontend/src/pages/modelServing/screens/projects/KServeSection/KServeInferenceServiceTableRow.tsx +++ b/frontend/src/pages/modelServing/screens/projects/KServeSection/KServeInferenceServiceTableRow.tsx @@ -109,7 +109,7 @@ const KServeInferenceServiceTableRow: React.FC - Token authorization + Token authentication { title={modelMeshEnabled ? 'Start by adding a model server' : 'Start by deploying a model'} description={ modelMeshEnabled - ? 'Model servers are used to deploy models and to allow apps to send requests to your models. Configuring a model server includes specifying the number of replicas being deployed, the server size, the token authorization, the serving runtime, and how the project that the model server belongs to is accessed.\n' + ? 'Model servers are used to deploy models and to allow apps to send requests to your models. Configuring a model server includes specifying the number of replicas being deployed, the server size, the token authentication, the serving runtime, and how the project that the model server belongs to is accessed.\n' : 'Each model is deployed on its own model server.' } createButton={ diff --git a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/AuthServingRuntimeSection.tsx b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/AuthServingRuntimeSection.tsx index b0dd5b7bcd..5726b31c11 100644 --- a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/AuthServingRuntimeSection.tsx +++ b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/AuthServingRuntimeSection.tsx @@ -49,21 +49,21 @@ const AuthServingRuntimeSection: React.FC = ({ }, [data.tokens, setData]); return ( - + {!allowCreate && ( diff --git a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ServingRuntimeTokenSection.tsx b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ServingRuntimeTokenSection.tsx index ec938c4e28..2ed8b7f496 100644 --- a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ServingRuntimeTokenSection.tsx +++ b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ServingRuntimeTokenSection.tsx @@ -32,7 +32,7 @@ const ServingRuntimeTokenSection: React.FC = ({ allowCreate, createNewToken, }) => ( - + = ({ isExpandable isInline variant="warning" - title="Token authorization service not installed" + title="Token authentication service not installed" actionClose={ setAlertVisible(false)} />} >

The single model serving platform used by this project allows deployed models to - be accessible via external routes. It is recommended that token authorization be + be accessible via external routes. It is recommended that token authentication be enabled to protect these routes. The serving platform requires the Authorino - operator be installed on the cluster for token authorization. Contact a cluster + operator be installed on the cluster for token authentication. Contact a cluster administrator to install the operator.