Skip to content

Commit

Permalink
fix editing modelmesh prefill (#3383)
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvogt authored Oct 24, 2024
1 parent 1531e12 commit d801754
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
createServingRuntimeModal,
editServingRuntimeModal,
inferenceServiceModal,
inferenceServiceModalEdit,
kserveModal,
kserveModalEdit,
modelServingSection,
Expand Down Expand Up @@ -471,6 +472,38 @@ describe('Serving Runtime List', () => {
});
});

it('Edit ModelMesh model', () => {
initIntercepts({
projectEnableModelMesh: true,
disableKServeConfig: false,
disableModelMeshConfig: true,
inferenceServices: [
mockInferenceServiceK8sResource({
name: 'ovms-testing',
displayName: 'OVMS ONNX',
isModelMesh: true,
}),
],
});

projectDetails.visitSection('test-project', 'model-server');

modelServingSection
.getModelMeshRow('OVMS Model Serving')
.findDeployedModelExpansionButton()
.click();
modelServingSection.getInferenceServiceRow('OVMS ONNX').findKebabAction('Edit').click();
inferenceServiceModalEdit.shouldBeOpen();
inferenceServiceModalEdit
.findServingRuntimeSelect()
.should('have.text', 'OVMS Model Serving')
.should('be.enabled');
inferenceServiceModalEdit
.findExistingConnectionSelect()
.should('have.text', 'Test Secret')
.should('be.enabled');
});

it('ModelMesh ServingRuntime list', () => {
initIntercepts({
projectEnableModelMesh: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ const ManageInferenceServiceModal: React.FC<ManageInferenceServiceModalProps> =
registeredModelDeployInfo,
);

const hasEditInfo = !!editInfo;
React.useEffect(() => {
setCreateData('project', currentProjectName);
setCreateData('servingRuntimeName', currentServingRuntimeName);
}, [setCreateData, currentProjectName, currentServingRuntimeName]);
if (!hasEditInfo) {
setCreateData('project', currentProjectName);
setCreateData('servingRuntimeName', currentServingRuntimeName);
}
}, [setCreateData, currentProjectName, currentServingRuntimeName, hasEditInfo]);

const storageCanCreate = (): boolean => {
if (createData.storage.type === InferenceServiceStorageType.EXISTING_STORAGE) {
Expand Down

0 comments on commit d801754

Please sign in to comment.