Skip to content

Commit

Permalink
Fix inconsistency in token section for model serving
Browse files Browse the repository at this point in the history
  • Loading branch information
lucferbux committed Jun 3, 2024
1 parent a7032c6 commit 4b0f487
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 15 deletions.
4 changes: 4 additions & 0 deletions frontend/src/__tests__/cypress/cypress/pages/modelServing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,26 @@ 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 filling in minimum required fields
kserveModal.findAuthenticationCheckbox().contains('Require token authentication');
kserveModal.findAuthenticationCheckbox().contains('Token authentication');
});
});

describe('ModelMesh model server', () => {
Expand Down Expand Up @@ -1565,7 +1585,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', () => {
Expand All @@ -1579,7 +1599,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');
});
});

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/home/aiFlows/DeployAndMonitorGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const DeployAndMonitorGallery: React.FC<{ onClose: () => void }> = ({ onClose })
<Text component="small">
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.
</Text>
</TextContent>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const KServeInferenceServiceTableRow: React.FC<KServeInferenceServiceTableRowPro
<StackItem>
<DescriptionList>
<DescriptionListGroup>
<DescriptionListTerm>Token authorization</DescriptionListTerm>
<DescriptionListTerm>Token authentication</DescriptionListTerm>
<DescriptionListDescription>
<ServingRuntimeTokensTable
obj={obj}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const ModelServingPlatform: React.FC = () => {
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={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ const AuthServingRuntimeSection: React.FC<AuthServingRuntimeSectionProps> = ({
}, [data.tokens, setData]);

return (
<Stack>
<Stack hasGutter>
{!allowCreate && (
<StackItem>
<Popover
showClose
bodyContent={
publicRoute
? 'Model route and token authorization can only be changed by administrator users.'
: 'Token authorization can only be changed by administrator users and component Authorino needs to be installed.'
? 'Model route and token authentication can only be changed by administrator users.'
: 'Token authentication can only be changed by administrator users and component Authorino needs to be installed.'
}
>
<Button variant="link" icon={<OutlinedQuestionCircleIcon />} isInline>
{publicRoute
? "Why can't I change the model route and token authorization fields?"
: "Why can't I change the token authorization field?"}
? "Why can't I change the model route and token authentication fields?"
: "Why can't I change the token authentication field?"}
</Button>
</Popover>
</StackItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ServingRuntimeTokenSection: React.FC<ServingRuntimeTokenSectionProps> = ({
allowCreate,
createNewToken,
}) => (
<FormSection title="Token authorization">
<FormSection title="Token authentication" id="auth-section" data-testid="auth-section">
<FormGroup>
<Checkbox
label="Require token authentication"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,14 @@ const ManageKServeModal: React.FC<ManageKServeModalProps> = ({
isExpandable
isInline
variant="warning"
title="Token authorization service not installed"
title="Token authentication service not installed"
actionClose={<AlertActionCloseButton onClose={() => setAlertVisible(false)} />}
>
<p>
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.
</p>
</Alert>
Expand Down

0 comments on commit 4b0f487

Please sign in to comment.