Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge f/model-serving to main #2123

Merged
merged 70 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
d68ec6b
Revamp add server button and add tooltip
DaoDaoNoCode Sep 29, 2023
0370c9b
Show alert when external route is set while token is not set for mode…
DaoDaoNoCode Sep 25, 2023
51594ce
Merge pull request #1885 from DaoDaoNoCode/upstream-issue-1579
openshift-ci[bot] Oct 3, 2023
101411f
Merge pull request #1862 from DaoDaoNoCode/upstream-issue-1582
openshift-ci[bot] Oct 5, 2023
1f057e6
Improvements to edit model server modal
DaoDaoNoCode Sep 28, 2023
5203c79
Merge pull request #1878 from DaoDaoNoCode/upstream-issue-1626
openshift-ci[bot] Oct 9, 2023
756f19b
Merge branch 'main' into f/model-serving
lucferbux Oct 10, 2023
d760850
Make data connection bucket field mandatory
DaoDaoNoCode Oct 10, 2023
a9b3aae
Merge pull request #1949 from DaoDaoNoCode/upstream-issue-1583
openshift-ci[bot] Oct 13, 2023
2078e9f
Check serving runtime kind at creation time
DaoDaoNoCode Oct 9, 2023
d1228e0
Merge pull request #1936 from DaoDaoNoCode/upstream-issue-1353
openshift-ci[bot] Oct 17, 2023
46f2023
Update ovms and add Caikit Custom Serving Runtime
lucferbux Oct 17, 2023
f1bb65a
Merge pull request #1972 from lucferbux/issue-1940
openshift-ci[bot] Oct 18, 2023
b60188e
Create dashboard configuration to control kserve and modelmesh
lucferbux Oct 11, 2023
3eaf078
Merge pull request #1957 from lucferbux/issue-1939
openshift-ci[bot] Oct 18, 2023
aa6fb2b
Merge branch 'main' into f/model-serving
lucferbux Oct 18, 2023
390a3a1
Adapt custom serving runtimes to KServe
DaoDaoNoCode Oct 12, 2023
4f62765
Merge pull request #1969 from DaoDaoNoCode/upstream-issue-1912
openshift-ci[bot] Oct 19, 2023
5c15171
Merge branch 'main' into f/model-serving
lucferbux Oct 19, 2023
d4c2636
Update ovms with gpu support and remove the other template
lucferbux Oct 20, 2023
9bc4fa3
Add check for dsc status and utility types to check serving platform …
lucferbux Oct 19, 2023
3178441
Merge pull request #1999 from lucferbux/issue-1989
openshift-ci[bot] Oct 23, 2023
bfb3aa8
Merge pull request #1990 from lucferbux/issue-1946
openshift-ci[bot] Oct 23, 2023
5b9e0e8
handle kserve in global model serving page
christianvogt Oct 25, 2023
14920ea
Add model serving platform settings
DaoDaoNoCode Oct 18, 2023
c5c3596
Merge pull request #1982 from DaoDaoNoCode/upstream-issue-1913
openshift-ci[bot] Oct 25, 2023
7ec208c
Merge pull request #2001 from christianvogt/global-model-serving
openshift-ci[bot] Oct 25, 2023
a5e0541
Refactor model serving section on the project details page
DaoDaoNoCode Oct 25, 2023
7acae2a
Merge pull request #2012 from DaoDaoNoCode/upstream-issue-1944
openshift-ci[bot] Oct 27, 2023
aa6ce80
Merge branch 'main' into f/model-serving
lucferbux Oct 27, 2023
83cce23
Implement KServe table on project details page
DaoDaoNoCode Oct 27, 2023
411c83d
Merge pull request #2025 from DaoDaoNoCode/upstream-issue-1947
openshift-ci[bot] Oct 27, 2023
0128087
Refactor modals and add kserve deployment modal
lucferbux Oct 26, 2023
7dc0f0c
Merge pull request #2026 from lucferbux/issue-1943
openshift-ci[bot] Oct 30, 2023
61f21c1
apply ownerReference to ServingRuntime related resources
christianvogt Oct 30, 2023
0ac1401
Merge pull request #2019 from christianvogt/ownerReferences
openshift-ci[bot] Oct 31, 2023
33650e1
omit enable-auth and enable-route annotations for ServingRuntime when…
christianvogt Oct 31, 2023
693ffc6
Merge pull request #2037 from christianvogt/kserve-annotations
openshift-ci[bot] Nov 2, 2023
51a6415
visually disable resources with a deletionTimestamp
christianvogt Nov 2, 2023
389a7bc
Add tooltips to Model Server Modal
uidoyen Oct 23, 2023
06266ca
Merge pull request #2054 from christianvogt/deletion-timestamp
openshift-merge-bot[bot] Nov 6, 2023
9710948
Add annotations for inferenceservice in kserve
lucferbux Nov 7, 2023
0541a8b
Merge pull request #2080 from lucferbux/issue-2079
openshift-merge-bot[bot] Nov 7, 2023
77b4111
Automatically generate first token when enable route when adding mode…
DaoDaoNoCode Nov 7, 2023
d1e238d
Adapt logic for Custom Serving Runtime migration and adapt OVMS OOTB
lucferbux Nov 6, 2023
b1ef17c
Merge branch 'main' into f/model-serving
lucferbux Nov 7, 2023
a158347
Merge pull request #2068 from lucferbux/issue-2059
openshift-merge-bot[bot] Nov 8, 2023
435bc9e
Merge pull request #2003 from uidoyen/odh-1580
openshift-merge-bot[bot] Nov 8, 2023
088120d
Merge pull request #2081 from DaoDaoNoCode/upstream-issue-2049
openshift-merge-bot[bot] Nov 8, 2023
ed488b6
Merge branch 'f/model-serving' into merge-main and solve conflicts
lucferbux Nov 8, 2023
a9a0bfa
Add info alert to kserve on settings page
DaoDaoNoCode Nov 7, 2023
50015df
Merge pull request #2103 from lucferbux/merge-main
openshift-merge-bot[bot] Nov 8, 2023
4ccc506
Merge pull request #2082 from DaoDaoNoCode/upstream-issue-2047
openshift-ci[bot] Nov 9, 2023
82408ab
Add empty state when no serving platform is enabled
DaoDaoNoCode Nov 8, 2023
11e2189
Merge pull request #2109 from DaoDaoNoCode/upstream-issue-1994
openshift-merge-bot[bot] Nov 10, 2023
9fbc49e
Merge branch 'main' into f/model-serving
lucferbux Nov 10, 2023
dff907d
Fix merging issues
lucferbux Nov 10, 2023
555f354
Merge pull request #2126 from lucferbux/fix-merging-issues
openshift-merge-bot[bot] Nov 10, 2023
7f2742f
Fix suffix in kserve
lucferbux Nov 10, 2023
4f88647
Merge pull request #2115 from lucferbux/issue-2053
openshift-merge-bot[bot] Nov 10, 2023
789e779
Add deployment to global view and fix status
lucferbux Nov 10, 2023
d3f3e8d
Support Caikit Serving Runtime with REST
lucferbux Nov 9, 2023
a9d0f1a
Merge pull request #2113 from lucferbux/issue-2058
openshift-merge-bot[bot] Nov 10, 2023
8344e6d
Merge pull request #2121 from lucferbux/issue-1956
openshift-merge-bot[bot] Nov 10, 2023
c96eaf7
Change base image of text generation inference container
lucferbux Nov 11, 2023
263e7a1
Change empty global model mesh serving link text to project display name
DaoDaoNoCode Nov 13, 2023
42914d0
Merge pull request #2133 from DaoDaoNoCode/upstream-issue-2132
openshift-merge-bot[bot] Nov 13, 2023
47298e6
Merge pull request #2128 from lucferbux/issue-2058-follow-up
openshift-merge-bot[bot] Nov 13, 2023
28be8d2
Show error state on global serving page when the platform in not inst…
DaoDaoNoCode Nov 13, 2023
051fe59
Merge pull request #2136 from DaoDaoNoCode/upstream-issue-2134
openshift-merge-bot[bot] Nov 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions backend/src/routes/api/cluster-settings/clusterSettingsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const DEFAULT_CLUSTER_SETTINGS: ClusterSettings = {
cullerTimeout: DEFAULT_CULLER_TIMEOUT,
userTrackingEnabled: false,
notebookTolerationSettings: { enabled: false, key: 'NotebooksOnly' },
modelServingPlatformEnabled: {
kServe: true,
modelMesh: false,
},
};

export const updateClusterSettings = async (
Expand All @@ -28,10 +32,30 @@ export const updateClusterSettings = async (
): Promise<{ success: boolean; error: string }> => {
const coreV1Api = fastify.kube.coreV1Api;
const namespace = fastify.kube.namespace;
const { pvcSize, cullerTimeout, userTrackingEnabled, notebookTolerationSettings } = request.body;
const {
pvcSize,
cullerTimeout,
userTrackingEnabled,
notebookTolerationSettings,
modelServingPlatformEnabled,
} = request.body;
const dashConfig = getDashboardConfig();
const isJupyterEnabled = checkJupyterEnabled();
try {
if (
modelServingPlatformEnabled.kServe !== !dashConfig.spec.dashboardConfig.disableKServe ||
modelServingPlatformEnabled.modelMesh !== !dashConfig.spec.dashboardConfig.disableModelMesh
) {
await setDashboardConfig(fastify, {
spec: {
dashboardConfig: {
disableKServe: !modelServingPlatformEnabled.kServe,
disableModelMesh: !modelServingPlatformEnabled.modelMesh,
},
},
});
}

await patchCM(fastify, segmentKeyCfg, {
data: { segmentKeyEnabled: String(userTrackingEnabled) },
}).catch((e) => {
Expand All @@ -41,7 +65,6 @@ export const updateClusterSettings = async (
if (isJupyterEnabled) {
await setDashboardConfig(fastify, {
spec: {
dashboardConfig: dashConfig.spec.dashboardConfig,
notebookController: {
enabled: isJupyterEnabled,
pvcSize: `${pvcSize}Gi`,
Expand Down Expand Up @@ -124,10 +147,14 @@ export const getClusterSettings = async (
): Promise<ClusterSettings | string> => {
const coreV1Api = fastify.kube.coreV1Api;
const namespace = fastify.kube.namespace;
const clusterSettings = {
const dashConfig = getDashboardConfig();
const clusterSettings: ClusterSettings = {
...DEFAULT_CLUSTER_SETTINGS,
modelServingPlatformEnabled: {
kServe: !dashConfig.spec.dashboardConfig.disableKServe,
modelMesh: !dashConfig.spec.dashboardConfig.disableModelMesh,
},
};
const dashConfig = getDashboardConfig();
const isJupyterEnabled = checkJupyterEnabled();
if (!dashConfig.spec.dashboardConfig.disableTracking) {
try {
Expand Down
8 changes: 6 additions & 2 deletions backend/src/routes/api/namespaces/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ export enum NamespaceApplicationCase {
*/
DSG_CREATION,
/**
* Upgrade an existing DSG project to work with model serving.
* Upgrade an existing DSG project to work with model mesh.
*/
MODEL_SERVING_PROMOTION,
MODEL_MESH_PROMOTION,
/**
* Upgrade an existing DSG project to work with model kserve.
*/
KSERVE_PROMOTION,
}
7 changes: 6 additions & 1 deletion backend/src/routes/api/namespaces/namespaceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,16 @@ export const applyNamespaceChange = async (
'opendatahub.io/dashboard': 'true',
};
break;
case NamespaceApplicationCase.MODEL_SERVING_PROMOTION:
case NamespaceApplicationCase.MODEL_MESH_PROMOTION:
labels = {
'modelmesh-enabled': 'true',
};
break;
case NamespaceApplicationCase.KSERVE_PROMOTION:
labels = {
'modelmesh-enabled': 'false',
};
break;
default:
throw createCustomError('Unknown configuration', 'Cannot apply namespace change', 400);
}
Expand Down
8 changes: 7 additions & 1 deletion backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export type DashboardConfig = K8sResourceCommon & {
disableCustomServingRuntimes: boolean;
modelMetricsNamespace: string;
disablePipelines: boolean;
disableKServe: boolean;
disableModelMesh: boolean;
};
groupsConfig?: {
adminGroups: string;
Expand Down Expand Up @@ -100,6 +102,10 @@ export type ClusterSettings = {
cullerTimeout: number;
userTrackingEnabled: boolean;
notebookTolerationSettings: NotebookTolerationSettings | null;
modelServingPlatformEnabled: {
kServe: boolean;
modelMesh: boolean;
};
};

// Add a minimal QuickStart type here as there is no way to get types without pulling in frontend (React) modules
Expand Down Expand Up @@ -947,7 +953,7 @@ type ComponentNames =

export type DataScienceClusterKindStatus = {
conditions: [];
installedComponents: { [key in ComponentNames]: boolean };
installedComponents: { [key in ComponentNames]?: boolean };
phase?: string;
};

Expand Down
2 changes: 2 additions & 0 deletions backend/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export const blankDashboardCR: DashboardConfig = {
disableCustomServingRuntimes: false,
modelMetricsNamespace: '',
disablePipelines: false,
disableKServe: false,
disableModelMesh: true,
},
notebookController: {
enabled: true,
Expand Down
15 changes: 15 additions & 0 deletions backend/src/utils/resourceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ const fetchOrCreateDashboardCR = async (
)
.then((res) => {
const dashboardCR = res?.body as DashboardConfig;
if (
dashboardCR &&
dashboardCR.spec.dashboardConfig.disableKServe === undefined &&
dashboardCR.spec.dashboardConfig.disableModelMesh === undefined
) {
// return a merge between dashboardCR and blankDashboardCR but changing spec.disableKServe to true and spec.disableModelMesh to false
return _.merge({}, blankDashboardCR, dashboardCR, {
spec: {
dashboardConfig: {
disableKServe: true,
disableModelMesh: false,
},
},
});
}
return _.merge({}, blankDashboardCR, dashboardCR); // merge with blank CR to prevent any missing values
})
.catch((e) => {
Expand Down
2 changes: 2 additions & 0 deletions docs/dashboard-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The following are a list of features that are supported, along with there defaul
| disableModelServing | false | Disables Model Serving from the dashboard and from Data Science Projects. |
| disableProjectSharing | false | Disables Project Sharing from Data Science Projects. |
| disableCustomServingRuntimes | false | Disables Custom Serving Runtimes from the Admin Panel. |
| disableKServe | false | Disables the ability to select KServe as a Serving Platform. |
| disableModelMesh | true | Disables the ability to select ModelMesh as a Serving Platform. |
| modelMetricsNamespace | false | Enables the namespace in which the Model Serving Metrics' Prometheus Operator is installed. |

## Defaults
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/__mocks__/mockClusterSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ export const mockClusterSettings = ({
key: 'NotebooksOnlyChange',
enabled: true,
},
modelServingPlatformEnabled = {
kServe: true,
modelMesh: true,
},
}: Partial<ClusterSettingsType>): ClusterSettingsType => ({
userTrackingEnabled,
cullerTimeout,
pvcSize,
notebookTolerationSettings,
modelServingPlatformEnabled,
});
6 changes: 6 additions & 0 deletions frontend/src/__mocks__/mockDashboardConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type MockDashboardConfigType = {
disablePipelines?: boolean;
disableModelServing?: boolean;
disableCustomServingRuntimes?: boolean;
disableKServe?: boolean;
disableModelMesh?: boolean;
};

export const mockDashboardConfig = ({
Expand All @@ -28,6 +30,8 @@ export const mockDashboardConfig = ({
disableModelServing = false,
disableCustomServingRuntimes = false,
disablePipelines = false,
disableKServe = false,
disableModelMesh = true,
}: MockDashboardConfigType): DashboardConfigKind => ({
apiVersion: 'opendatahub.io/v1alpha',
kind: 'OdhDashboardConfig',
Expand Down Expand Up @@ -55,6 +59,8 @@ export const mockDashboardConfig = ({
disablePipelines,
modelMetricsNamespace: 'test-project',
disableProjectSharing: false,
disableKServe,
disableModelMesh,
},
notebookController: {
enabled: true,
Expand Down
104 changes: 100 additions & 4 deletions frontend/src/__mocks__/mockDscStatus.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,116 @@
import { DataScienceClusterKindStatus } from '~/k8sTypes';
import { DataScienceClusterKindStatus, K8sCondition } from '~/k8sTypes';
import { StackComponent } from '~/concepts/areas/types';

type MockDscStatus = {
export type MockDscStatus = {
conditions?: K8sCondition[];
phase?: string;
installedComponents?: DataScienceClusterKindStatus['installedComponents'];
};

export const mockDscStatus = ({
installedComponents,
conditions = [],
phase = 'Ready',
}: MockDscStatus): DataScienceClusterKindStatus => ({
conditions: [],
conditions: [
...[
{
lastHeartbeatTime: '2023-10-20T11:44:48Z',
lastTransitionTime: '2023-10-15T19:04:21Z',
message: 'DataScienceCluster resource reconciled successfully',
reason: 'ReconcileCompleted',
status: 'True',
type: 'ReconcileComplete',
},
{
lastHeartbeatTime: '2023-10-20T11:44:48Z',
lastTransitionTime: '2023-10-15T19:04:21Z',
message: 'DataScienceCluster resource reconciled successfully',
reason: 'ReconcileCompleted',
status: 'True',
type: 'Available',
},
{
lastHeartbeatTime: '2023-10-20T11:44:48Z',
lastTransitionTime: '2023-10-15T19:04:21Z',
message: 'DataScienceCluster resource reconciled successfully',
reason: 'ReconcileCompleted',
status: 'False',
type: 'Progressing',
},
{
lastHeartbeatTime: '2023-10-20T11:44:48Z',
lastTransitionTime: '2023-10-15T19:04:10Z',
message: 'DataScienceCluster resource reconciled successfully',
reason: 'ReconcileCompleted',
status: 'False',
type: 'Degraded',
},
{
lastHeartbeatTime: '2023-10-20T11:44:48Z',
lastTransitionTime: '2023-10-15T19:04:21Z',
message: 'DataScienceCluster resource reconciled successfully',
reason: 'ReconcileCompleted',
status: 'True',
type: 'Upgradeable',
},
{
lastHeartbeatTime: '2023-10-20T11:44:59Z',
lastTransitionTime: '2023-10-20T11:44:59Z',
message: 'Component reconciled successfully',
reason: 'ReconcileCompleted',
status: 'True',
type: 'odh-dashboardReady',
},
{
lastHeartbeatTime: '2023-10-20T11:44:59Z',
lastTransitionTime: '2023-10-20T11:44:59Z',
message: 'Component reconciled successfully',
reason: 'ReconcileCompleted',
status: 'True',
type: 'data-science-pipelines-operatorReady',
},
{
lastHeartbeatTime: '2023-10-20T11:45:01Z',
lastTransitionTime: '2023-10-20T11:45:01Z',
message: 'Component reconciled successfully',
reason: 'ReconcileCompleted',
status: 'True',
type: 'workbenchesReady',
},
{
lastHeartbeatTime: '2023-10-20T11:45:04Z',
lastTransitionTime: '2023-10-20T11:45:04Z',
message: 'Component reconciled successfully',
reason: 'ReconcileCompleted',
status: 'True',
type: 'kserveReady',
},
{
lastHeartbeatTime: '2023-10-20T11:45:04Z',
lastTransitionTime: '2023-10-20T11:45:04Z',
message: 'Component reconciled successfully',
reason: 'ReconcileCompleted',
status: 'True',
type: 'model-meshReady',
},
{
lastHeartbeatTime: '2023-10-20T11:45:06Z',
lastTransitionTime: '2023-10-20T11:45:06Z',
message: 'Component is disabled',
reason: 'ReconcileInit',
status: 'Unknown',
type: 'rayReady',
},
],
...conditions,
],
installedComponents: Object.values(StackComponent).reduce(
(acc, component) => ({
...acc,
[component]: installedComponents?.[component] ?? false,
}),
{},
),
phase: 'Ready',
phase,
});
21 changes: 18 additions & 3 deletions frontend/src/__mocks__/mockInferenceServiceK8sResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ type MockResourceConfigType = {
displayName?: string;
modelName?: string;
secretName?: string;
deleted?: boolean;
isModelMesh?: boolean;
activeModelState?: string;
url?: string;
};

export const mockInferenceServicek8sError = () => ({
Expand Down Expand Up @@ -37,15 +41,26 @@ export const mockInferenceServiceK8sResource = ({
displayName = 'Test Inference Service',
modelName = 'test-model',
secretName = 'test-secret',
deleted = false,
isModelMesh = false,
activeModelState = 'Pending',
url = '',
}: MockResourceConfigType): InferenceServiceKind => ({
apiVersion: 'serving.kserve.io/v1beta1',
kind: 'InferenceService',
metadata: {
annotations: {
'openshift.io/display-name': displayName,
'serving.kserve.io/deploymentMode': 'ModelMesh',
...(isModelMesh
? { 'serving.kserve.io/deploymentMode': 'ModelMesh' }
: {
'serving.knative.openshift.io/enablePassthrough': 'true',
'sidecar.istio.io/inject': 'true',
'sidecar.istio.io/rewriteAppHTTPProbers': 'true',
}),
},
creationTimestamp: '2023-03-17T16:12:41Z',
...(deleted ? { deletionTimestamp: new Date().toUTCString() } : {}),
generation: 1,
labels: {
name: name,
Expand Down Expand Up @@ -73,7 +88,7 @@ export const mockInferenceServiceK8sResource = ({
},
status: {
components: {},
url: '',
url,
conditions: [
{
lastTransitionTime: '2023-03-17T16:12:41Z',
Expand All @@ -99,7 +114,7 @@ export const mockInferenceServiceK8sResource = ({
time: '',
},
states: {
activeModelState: 'Pending',
activeModelState,
targetModelState: '',
},
transitionStatus: '',
Expand Down
Loading