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 6, 2024
1 parent a7032c6 commit 5e1b3d8
Show file tree
Hide file tree
Showing 8 changed files with 46 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,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', () => {
Expand Down Expand Up @@ -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', () => {
Expand All @@ -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');
});
});

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.'

Check warning on line 60 in frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/AuthServingRuntimeSection.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/AuthServingRuntimeSection.tsx#L59-L60

Added lines #L59 - L60 were not covered by tests
}
>
<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?"}

Check warning on line 66 in frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/AuthServingRuntimeSection.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/AuthServingRuntimeSection.tsx#L65-L66

Added lines #L65 - L66 were not covered by tests
</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">

Check warning on line 35 in frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ServingRuntimeTokenSection.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/modelServing/screens/projects/ServingRuntimeModal/ServingRuntimeTokenSection.tsx#L35

Added line #L35 was not covered by tests
<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 5e1b3d8

Please sign in to comment.