Skip to content

Commit

Permalink
Modify test case based on new change from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhao583 committed Aug 26, 2024
1 parent 70467d0 commit ccb9250
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
6 changes: 6 additions & 0 deletions frontend/src/api/k8s/__tests__/inferenceServices.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ describe('assembleInferenceService', () => {
undefined,
false,
undefined,
undefined,
acceleratorProfileState,
selectedAcceleratorProfile,
);
Expand Down Expand Up @@ -218,6 +219,7 @@ describe('assembleInferenceService', () => {
undefined,
true,
undefined,
undefined,
acceleratorProfileState,
selectedAcceleratorProfile,
);
Expand Down Expand Up @@ -251,6 +253,7 @@ describe('assembleInferenceService', () => {
undefined,
false,
undefined,
undefined,
acceleratorProfileState,
selectedAcceleratorProfile,
);
Expand Down Expand Up @@ -279,6 +282,7 @@ describe('assembleInferenceService', () => {
undefined,
true,
undefined,
undefined,
acceleratorProfileState,
selectedAcceleratorProfile,
);
Expand Down Expand Up @@ -321,6 +325,7 @@ describe('assembleInferenceService', () => {
undefined,
false,
undefined,
undefined,
acceleratorProfileState,
selectedAcceleratorProfile,
);
Expand Down Expand Up @@ -373,6 +378,7 @@ describe('assembleInferenceService', () => {
undefined,
true,
undefined,
undefined,
acceleratorProfileState,
selectedAcceleratorProfile,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import { getDisplayNameFromK8sResource, translateDisplayNameForK8s } from '~/con
import { useAccessReview } from '~/api';
import { SupportedArea, useIsAreaAvailable } from '~/concepts/areas';
import KServeAutoscalerReplicaSection from '~/pages/modelServing/screens/projects/kServeModal/KServeAutoscalerReplicaSection';
import useGenericObjectState from '~/utilities/useGenericObjectState';
import { AcceleratorProfileSelectFieldState } from '~/pages/notebookController/screens/server/AcceleratorProfileSelectField';

const NIM_SECRET_NAME = 'nvidia-nim-secrets';
const NIM_NGC_SECRET_NAME = 'ngc-secret';
Expand Down Expand Up @@ -92,11 +94,19 @@ const DeployNIMServiceModal: React.FC<DeployNIMServiceModalProps> = ({
const isInferenceServiceNameWithinLimit =
translateDisplayNameForK8s(createDataInferenceService.name).length <= 253;

const [acceleratorProfileState, setAcceleratorProfileState, resetAcceleratorProfileData] =
useServingAcceleratorProfile(
editInfo?.servingRuntimeEditInfo?.servingRuntime,
editInfo?.inferenceServiceEditInfo,
);
const acceleratorProfileState = useServingAcceleratorProfile(
editInfo?.servingRuntimeEditInfo?.servingRuntime,
editInfo?.inferenceServiceEditInfo,
);
const [
selectedAcceleratorProfile,
setSelectedAcceleratorProfile,
resetSelectedAcceleratorProfile,
] = useGenericObjectState<AcceleratorProfileSelectFieldState>({
profile: undefined,
count: 0,
useExistingSettings: false,
});
const customServingRuntimesEnabled = useCustomServingRuntimesEnabled();
const [allowCreate] = useAccessReview({
...accessReviewResource,
Expand Down Expand Up @@ -142,7 +152,7 @@ const DeployNIMServiceModal: React.FC<DeployNIMServiceModalProps> = ({
setActionInProgress(false);
resetDataServingRuntime();
resetDataInferenceService();
resetAcceleratorProfileData();
resetSelectedAcceleratorProfile();
setAlertVisible(true);
};

Expand Down Expand Up @@ -172,6 +182,7 @@ const DeployNIMServiceModal: React.FC<DeployNIMServiceModalProps> = ({
editInfo?.servingRuntimeEditInfo,
false,
acceleratorProfileState,
selectedAcceleratorProfile,
NamespaceApplicationCase.KSERVE_PROMOTION,
projectContext?.currentProject,
servingRuntimeName,
Expand All @@ -184,6 +195,7 @@ const DeployNIMServiceModal: React.FC<DeployNIMServiceModalProps> = ({
servingRuntimeName,
false,
acceleratorProfileState,
selectedAcceleratorProfile,
allowCreate,
editInfo?.secrets,
false,
Expand Down Expand Up @@ -296,7 +308,8 @@ const DeployNIMServiceModal: React.FC<DeployNIMServiceModalProps> = ({
sizes={sizes}
servingRuntimeSelected={servingRuntimeSelected}
acceleratorProfileState={acceleratorProfileState}
setAcceleratorProfileState={setAcceleratorProfileState}
selectedAcceleratorProfile={selectedAcceleratorProfile}
setSelectedAcceleratorProfile={setSelectedAcceleratorProfile}
infoContent="Select a server size that will accommodate your largest model. See the product documentation for more information."
/>
</StackItem>
Expand Down

0 comments on commit ccb9250

Please sign in to comment.