-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify Accelerator support for kserve
- Loading branch information
Showing
16 changed files
with
411 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { AcceleratorKind } from '~/k8sTypes'; | ||
import { genUID } from './mockUtils'; | ||
|
||
type MockResourceConfigType = { | ||
name?: string; | ||
namespace?: string; | ||
displayName?: string; | ||
identifier?: string; | ||
enabled?: boolean; | ||
tolerations?: { | ||
key: string; | ||
operator: string; | ||
effect: string; | ||
}[]; | ||
}; | ||
|
||
export const mockAcceleratork8sResource = ({ | ||
name = 'migrated-gpu', | ||
namespace = 'test-project', | ||
displayName = 'Nvidia GPU', | ||
identifier = 'nvidia.com/gpu', | ||
enabled = true, | ||
tolerations = [ | ||
{ | ||
key: 'nvidia.com/gpu', | ||
operator: 'Exists', | ||
effect: 'NoSchedule', | ||
}, | ||
], | ||
}: MockResourceConfigType): AcceleratorKind => ({ | ||
apiVersion: 'dashboard.opendatahub.io/v1', | ||
kind: 'AcceleratorProfile', | ||
metadata: { | ||
creationTimestamp: '2023-03-17T16:12:41Z', | ||
generation: 1, | ||
name, | ||
namespace, | ||
resourceVersion: '1309350', | ||
uid: genUID('service'), | ||
}, | ||
spec: { | ||
identifier, | ||
displayName, | ||
enabled, | ||
tolerations, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { | ||
CreatingInferenceServiceObject, | ||
InferenceServiceStorageType, | ||
} from '~/pages/modelServing/screens/types'; | ||
|
||
type MockResourceConfigType = Partial<CreatingInferenceServiceObject>; | ||
|
||
export const mockInferenceServiceModalData = ({ | ||
name = 'my-inference-service', | ||
project = 'caikit-example', | ||
servingRuntimeName = 'caikit', | ||
storage = { | ||
type: InferenceServiceStorageType.NEW_STORAGE, | ||
path: '/caikit-llama', | ||
dataConnection: 'aws-data-connection', | ||
awsData: [], | ||
}, | ||
format = { | ||
name: 'caikit', | ||
version: '1.0.0', | ||
}, | ||
}: MockResourceConfigType): CreatingInferenceServiceObject => ({ | ||
name, | ||
project, | ||
servingRuntimeName, | ||
storage, | ||
format, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { CreatingServingRuntimeObject } from '~/pages/modelServing/screens/types'; | ||
|
||
type MockResourceConfigType = Partial<CreatingServingRuntimeObject>; | ||
|
||
export const mockServingRuntimeModalData = ({ | ||
name = 'my-inference-service', | ||
servingRuntimeTemplateName = 'caikit', | ||
numReplicas = 1, | ||
modelSize = { | ||
name: 'small', | ||
resources: { | ||
requests: { | ||
cpu: '1', | ||
memory: '1Gi', | ||
}, | ||
limits: { | ||
cpu: '1', | ||
memory: '1Gi', | ||
}, | ||
}, | ||
}, | ||
externalRoute = false, | ||
tokenAuth = false, | ||
tokens = [], | ||
}: MockResourceConfigType): CreatingServingRuntimeObject => ({ | ||
name, | ||
servingRuntimeTemplateName, | ||
numReplicas, | ||
modelSize, | ||
externalRoute, | ||
tokenAuth, | ||
tokens, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.