Skip to content

Commit

Permalink
Check version compatibility of manager
Browse files Browse the repository at this point in the history
  • Loading branch information
fregataa authored and yomybaby committed Dec 23, 2024
1 parent 1f2fd23 commit 9f88a1a
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const isActive = (session: SessionActionButtonsFragment$data) => {
// 'RESTARTING',
// 'TERMINATING',
// 'PENDING',
// 'PREPARING',
// 'CREATING',
// 'PULLING',
// ].includes(session?.status || '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface SessionStatusTagProps {
const statusTagColor = {
//prepare
RESTARTING: 'blue',
PREPARING: 'blue',
PREPARED: 'blue',
CREATING: 'blue',
PULLING: 'blue',
Expand All @@ -33,6 +34,7 @@ const isTransitional = (session: SessionStatusTagFragment$data) => {
'RESTARTING',
'TERMINATING',
'PENDING',
`PREPARING`,
'CREATING',
'PULLING',
].includes(session?.status || '');
Expand Down
1 change: 1 addition & 0 deletions react/src/components/SessionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const SessionList: React.FC<SessionListProps> = ({
const statusTagColor = {
//prepare
RESTARTING: 'blue',
PREPARING: 'blue',
PREPARED: 'blue',
CREATING: 'blue',
PULLING: 'blue',
Expand Down
9 changes: 8 additions & 1 deletion react/src/components/SessionListColums/SessionInfoCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,21 @@ const isRunningStatus = (status: string = '') => {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARING',
'PREPARED',
'CREATING',
'PULLING',
].includes(status);
};

const isPreparing = (status: string = '') => {
return ['RESTARTING', 'PREPARED', 'CREATING', 'PULLING'].includes(status);
return [
'RESTARTING',
'PREPARING',
'PREPARED',
'CREATING',
'PULLING',
].includes(status);
};

const SessionInfoCell: React.FC<{
Expand Down
1 change: 1 addition & 0 deletions react/src/pages/SessionListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const RUNNINGS = [
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARING',
'PREPARED',
'CREATING',
'PULLING',
Expand Down
10 changes: 8 additions & 2 deletions src/components/backend-ai-edu-applauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ export default class BackendAiEduApplauncher extends BackendAIPage {
globalThis.backendaiclient.supports('prepared-session-status')
? 'PREPARED'
: undefined,
'CREATING',
globalThis.backendaiclient.supports('creating-session-status')
? 'CREATING'
: undefined,
'PREPARING',
'PULLING',
]
.filter((v) => !!v)
Expand All @@ -275,7 +278,10 @@ export default class BackendAiEduApplauncher extends BackendAIPage {
globalThis.backendaiclient.supports('prepared-session-status')
? 'PREPARED'
: undefined,
'CREATING',
globalThis.backendaiclient.supports('creating-session-status')
? 'CREATING'
: undefined,
'PREPARING',
'PULLING',
]
.filter((v) => !!v)
Expand Down
22 changes: 14 additions & 8 deletions src/components/backend-ai-session-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,13 @@ export default class BackendAISessionList extends BackendAIPage {
}

_isPreparing(status) {
const preparingStatuses = ['RESTARTING', 'PREPARED', 'CREATING', 'PULLING'];
const preparingStatuses = [
'RESTARTING',
'PREPARING',
'PREPARED',
'CREATING',
'PULLING',
];
if (preparingStatuses.indexOf(status) === -1) {
return false;
}
Expand Down Expand Up @@ -760,14 +766,16 @@ export default class BackendAISessionList extends BackendAIPage {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARED',
'CREATING',
'PREPARING',
'PULLING',
'ERROR',
];
if (globalThis.backendaiclient.supports('prepared-session-status')) {
status.push('PREPARED');
}
if (globalThis.backendaiclient.supports('creating-session-status')) {
status.push('CREATING');
}
break;
case 'finished':
status = ['TERMINATED', 'CANCELLED']; // TERMINATED, CANCELLED
Expand All @@ -779,17 +787,15 @@ export default class BackendAISessionList extends BackendAIPage {
'TERMINATING',
'PENDING',
'SCHEDULED',
<<<<<<< HEAD
'PREPARING',
=======
'PREPARED',
'CREATING',
>>>>>>> 035be307 (feat: Replace PREPARING status to CREATING)
'PULLING',
];
if (globalThis.backendaiclient.supports('prepared-session-status')) {
status.push('PREPARED');
}
if (globalThis.backendaiclient.supports('creating-session-status')) {
status.push('CREATING');
}
}
if (
!globalThis.backendaiclient.supports('avoid-hol-blocking') &&
Expand Down
9 changes: 5 additions & 4 deletions src/components/backend-ai-session-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ export default class BackendAISessionView extends BackendAIPage {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARED',
'CREATING',
'PREPARING',
'PULLING',
'TERMINATED',
'CANCELLED',
Expand All @@ -347,8 +346,7 @@ export default class BackendAISessionView extends BackendAIPage {
'RESTARTING',
'TERMINATING',
'PENDING',
'PREPARED',
'CREATING',
'PREPARING',
'PULLING',
'TERMINATED',
'CANCELLED',
Expand All @@ -358,6 +356,9 @@ export default class BackendAISessionView extends BackendAIPage {
if (globalThis.backendaiclient.supports('prepared-session-status')) {
status.push('PREPARED');
}
if (globalThis.backendaiclient.supports('creating-session-status')) {
status.push('CREATING');
}
if (globalThis.backendaiclient.supports('detailed-session-states')) {
status = status.join(',');
}
Expand Down
11 changes: 6 additions & 5 deletions src/lib/backend.ai-client-esm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ class Client {
this._features['extended-image-info'] = true;
this._features['batch-timeout'] = true;
this._features['prepared-session-status'] = true;
this._features['creating-session-status'] = true;
}
}

Expand Down Expand Up @@ -2808,7 +2809,7 @@ class Agent {
/**
* List computation agents.
*
* @param {string} status - Status to query. Should be one of 'ALIVE', 'CREATING', 'TERMINATING' and 'TERMINATED'.
* @param {string} status - Status to query. Should be one of 'ALIVE', 'PREPARING', 'TERMINATING' and 'TERMINATED'.
* @param {array} fields - Fields to query. Queryable fields are: 'id', 'status', 'region', 'first_contact', 'cpu_cur_pct', 'mem_cur_bytes', 'available_slots', 'occupied_slots'.
* @param {number} timeout - timeout for the request. Default uses SDK default. (5 sec.)
*/
Expand Down Expand Up @@ -2882,7 +2883,7 @@ class AgentSummary {
/**
* List of agent summary.
*
* @param {string} status - Status to query. Should be one of 'ALIVE', 'CREATING', 'TERMINATING' and 'TERMINATED'.
* @param {string} status - Status to query. Should be one of 'ALIVE', 'PREPARING', 'TERMINATING' and 'TERMINATED'.
* @param {array} fields - Fields to query. Queryable fields are: id, status, scaling_group, schedulable, schedulable, available_slots, occupied_slots.
* @param {number} limit - limit number of query items.
* @param {number} offset - offset for item query. Useful for pagination.
Expand Down Expand Up @@ -3612,7 +3613,7 @@ class ComputeSession {
* Get the number of compute sessions with specific conditions.
*
* @param {string or array} status - status to query. Default is 'RUNNING'.
* Available statuses are: `CREATING`, `BUILDING`, `PENDING`, `SCHEDULED`, `RUNNING`, `RESTARTING`, `RESIZING`, `SUSPENDED`, `TERMINATING`, `TERMINATED`, `ERROR`.
* Available statuses are: `PREPARING`, `CREATING`, `BUILDING`, `PENDING`, `SCHEDULED`, `RUNNING`, `RESTARTING`, `RESIZING`, `SUSPENDED`, `TERMINATING`, `TERMINATED`, `ERROR`.
* @param {string} accessKey - access key that is used to start compute sessions.
* @param {number} limit - limit number of query items.
* @param {number} offset - offset for item query. Useful for pagination.
Expand Down Expand Up @@ -3650,7 +3651,7 @@ class ComputeSession {
*
* @param {array} fields - fields to query. Default fields are: ["id", "name", "image", "created_at", "terminated_at", "status", "status_info", "occupied_slots", "cpu_used", "io_read_bytes", "io_write_bytes"].
* @param {string or array} status - status to query. Default is 'RUNNING'.
* Available statuses are: `CREATING`, `BUILDING`, `PENDING`, `SCHEDULED`, `RUNNING`, `RESTARTING`, `RESIZING`, `SUSPENDED`, `TERMINATING`, `TERMINATED`, `ERROR`.
* Available statuses are:`PREPARING`, `PREPARED`, `CREATING`, `BUILDING`, `PENDING`, `SCHEDULED`, `RUNNING`, `RESTARTING`, `RESIZING`, `SUSPENDED`, `TERMINATING`, `TERMINATED`, `ERROR`.
* @param {string} accessKey - access key that is used to start compute sessions.
* @param {number} limit - limit number of query items.
* @param {number} offset - offset for item query. Useful for pagination.
Expand Down Expand Up @@ -3722,7 +3723,7 @@ class ComputeSession {
'occupied_slots',
'containers {live_stat last_stat}',
],
status = 'RUNNING,RESTARTING,TERMINATING,PENDING,SCHEDULED,CREATING,PULLING,TERMINATED,CANCELLED,ERROR',
status = 'RUNNING,RESTARTING,TERMINATING,PENDING,SCHEDULED,PREPARING,PREPARED,CREATING,PULLING,TERMINATED,CANCELLED,ERROR',
accessKey = '',
limit = 100,
offset = 0,
Expand Down
10 changes: 5 additions & 5 deletions src/lib/backend.ai-client-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@ class Agent {
/**
* List computation agents.
*
* @param {string} status - Status to query. Should be one of 'ALIVE', 'CREATING', 'TERMINATING' and 'TERMINATED'.
* @param {string} status - Status to query. Should be one of 'ALIVE', 'PREPARING', 'TERMINATING' and 'TERMINATED'.
* @param {array} fields - Fields to query. Queryable fields are: 'id', 'status', 'region', 'first_contact', 'cpu_cur_pct', 'mem_cur_bytes', 'available_slots', 'occupied_slots'.
* @param {number} timeout - timeout for the request. Default uses SDK default. (5 sec.)
*/
Expand Down Expand Up @@ -2824,7 +2824,7 @@ class ComputeSession {
* Get the number of compute sessions with specific conditions.
*
* @param {string or array} status - status to query. Default is 'RUNNING'.
* Available statuses are: `CREATING`, `BUILDING`, `PENDING`, `SCHEDULED`, `RUNNING`, `RESTARTING`, `RESIZING`, `SUSPENDED`, `TERMINATING`, `TERMINATED`, `ERROR`.
* Available statuses are: `PREPARING`, `PREPARED`, `CREATING`, `BUILDING`, `PENDING`, `SCHEDULED`, `RUNNING`, `RESTARTING`, `RESIZING`, `SUSPENDED`, `TERMINATING`, `TERMINATED`, `ERROR`.
* @param {string} accessKey - access key that is used to start compute sessions.
* @param {number} limit - limit number of query items.
* @param {number} offset - offset for item query. Useful for pagination.
Expand Down Expand Up @@ -2861,7 +2861,7 @@ class ComputeSession {
*
* @param {array} fields - fields to query. Default fields are: ["id", "name", "image", "created_at", "terminated_at", "status", "status_info", "occupied_slots", "cpu_used", "io_read_bytes", "io_write_bytes"].
* @param {string or array} status - status to query. Default is 'RUNNING'.
* Available statuses are: `CREATING`, `BUILDING`, `PENDING`, `SCHEDULED`, `RUNNING`, `RESTARTING`, `RESIZING`, `SUSPENDED`, `TERMINATING`, `TERMINATED`, `ERROR`.
* Available statuses are: `PREPARING`, `PREPARED`, `CREATING`, `BUILDING`, `PENDING`, `SCHEDULED`, `RUNNING`, `RESTARTING`, `RESIZING`, `SUSPENDED`, `TERMINATING`, `TERMINATED`, `ERROR`.
* @param {string} accessKey - access key that is used to start compute sessions.
* @param {number} limit - limit number of query items.
* @param {number} offset - offset for item query. Useful for pagination.
Expand Down Expand Up @@ -2932,7 +2932,7 @@ class ComputeSession {
'occupied_slots',
'containers {live_stat last_stat}',
],
status = 'RUNNING,RESTARTING,TERMINATING,PENDING,SCHEDULED,CREATING,PULLING,TERMINATED,CANCELLED,ERROR',
status = 'RUNNING,RESTARTING,TERMINATING,PENDING,SCHEDULED,PREPARING,PREPARED,CREATING,PULLING,TERMINATED,CANCELLED,ERROR',
accessKey = '',
limit = 100,
offset = 0,
Expand Down Expand Up @@ -3039,7 +3039,7 @@ class SessionTemplate {
*
* @param {array} fields - fields to query. Default fields are: ["id", "name", "image", "created_at", "terminated_at", "status", "status_info", "occupied_slots", "cpu_used", "io_read_bytes", "io_write_bytes"].
* @param {string or array} status - status to query. Default is 'RUNNING'.
* Available statuses are: `CREATING`, `BUILDING`,`PENDING`, `SCHEDULED`, `RUNNING`, `RESTARTING`, `RESIZING`, `SUSPENDED`, `TERMINATING`, `TERMINATED`, `ERROR`.
* Available statuses are: `PREPARING`, `BUILDING`,`PENDING`, `SCHEDULED`, `RUNNING`, `RESTARTING`, `RESIZING`, `SUSPENDED`, `TERMINATING`, `TERMINATED`, `ERROR`.
* @param {string} accessKey - access key that is used to start compute sessions.
* @param {number} limit - limit number of query items.
* @param {number} offset - offset for item query. Useful for pagination.
Expand Down

0 comments on commit 9f88a1a

Please sign in to comment.