-
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.
Merge pull request #1990 from lucferbux/issue-1946
Add check for dsc status and utility types to check serving platform availablity
- Loading branch information
Showing
6 changed files
with
269 additions
and
3 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,129 @@ | ||
import { DataScienceClusterKindStatus, K8sCondition } from '~/k8sTypes'; | ||
|
||
export type MockDataScienceClusterKindStatus = { | ||
conditions?: K8sCondition[]; | ||
phase?: string; | ||
codeFlareEnabled?: boolean; | ||
dataSciencePipelineOperatorEnabled?: boolean; | ||
kserveEnabled?: boolean; | ||
modelMeshEnabled?: boolean; | ||
odhDashboardEnabled?: boolean; | ||
rayEnabled?: boolean; | ||
workbenchesEnabled?: boolean; | ||
}; | ||
|
||
export const mockDataScienceStatus = ({ | ||
conditions = [], | ||
phase = 'Ready', | ||
codeFlareEnabled = true, | ||
dataSciencePipelineOperatorEnabled = true, | ||
kserveEnabled = true, | ||
modelMeshEnabled = true, | ||
odhDashboardEnabled = true, | ||
rayEnabled = true, | ||
workbenchesEnabled = true, | ||
}: MockDataScienceClusterKindStatus): DataScienceClusterKindStatus => ({ | ||
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: { | ||
codeflare: codeFlareEnabled, | ||
'data-science-pipelines-operator': dataSciencePipelineOperatorEnabled, | ||
kserve: kserveEnabled, | ||
'model-mesh': modelMeshEnabled, | ||
'odh-dashboard': odhDashboardEnabled, | ||
ray: rayEnabled, | ||
workbenches: workbenchesEnabled, | ||
}, | ||
phase, | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import axios from 'axios'; | ||
import { DataScienceClusterKindStatus } from '~/k8sTypes'; | ||
|
||
export const fetchClusterStatus = (): Promise<DataScienceClusterKindStatus> => { | ||
const url = '/api/dsc/status'; | ||
return axios | ||
.get(url) | ||
.then((response) => response.data) | ||
.catch((e) => { | ||
throw new Error(e.response.data.message); | ||
}); | ||
}; |