-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2526 from dpanshug/grpc-kserve
Enable GRPC support for model serving routes
- Loading branch information
Showing
26 changed files
with
509 additions
and
176 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
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
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
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
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
34 changes: 34 additions & 0 deletions
34
...end/src/pages/modelServing/customServingRuntimes/CustomServingRuntimeAPIProtocolLabel.tsx
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,34 @@ | ||
import * as React from 'react'; | ||
import { Label, Text, TextVariants } from '@patternfly/react-core'; | ||
import { TemplateKind } from '~/k8sTypes'; | ||
import { | ||
getAPIProtocolFromTemplate, | ||
getEnabledPlatformsFromTemplate, | ||
} from '~/pages/modelServing/customServingRuntimes/utils'; | ||
import { ServingRuntimeAPIProtocol, ServingRuntimePlatform } from '~/types'; | ||
|
||
type CustomServingRuntimeAPIProtocolLabelProps = { | ||
template: TemplateKind; | ||
}; | ||
|
||
const CustomServingRuntimeAPIProtocolLabel: React.FC<CustomServingRuntimeAPIProtocolLabelProps> = ({ | ||
template, | ||
}) => { | ||
const apiProtocol = getAPIProtocolFromTemplate(template); | ||
const isMultiModel = getEnabledPlatformsFromTemplate(template).includes( | ||
ServingRuntimePlatform.MULTI, | ||
); | ||
|
||
// If it is multi-model, we use REST as default | ||
if (!apiProtocol && isMultiModel) { | ||
return <Label color="gold">{ServingRuntimeAPIProtocol.REST}</Label>; | ||
} | ||
|
||
if (!apiProtocol || !Object.values(ServingRuntimeAPIProtocol).includes(apiProtocol)) { | ||
return <Text component={TextVariants.small}>Not defined</Text>; | ||
} | ||
|
||
return <Label color="gold">{apiProtocol}</Label>; | ||
}; | ||
|
||
export default CustomServingRuntimeAPIProtocolLabel; |
Oops, something went wrong.