Skip to content

Commit

Permalink
feat: Support new status PREPARED of session and kernel (#2848)
Browse files Browse the repository at this point in the history
related to lablup/backend.ai#2647

We decided to add a new session and kernel status called 'PREPARED' to Backend.AI.
This status indicates that the session is ready to be created and doesn't require any miscellaneous tasks such as pulling images.

**Checklist:** (if applicable)

- [ ] Mention to the original issue
- [ ] Documentation
- [x] Minimum required manager version: 24.12.0
- [ ] Specific setting for review (eg., KB link, endpoint or how to setup)
- [ ] Minimum requirements to check during review
- [ ] Test case(s) to demonstrate the difference of before/after
  • Loading branch information
fregataa committed Nov 14, 2024
1 parent 0479273 commit 7265dfb
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface SessionStatusTagProps {
const statusTagColor = {
//prepare
RESTARTING: 'blue',
PREPARED: 'blue',
PREPARING: 'blue',
PULLING: 'blue',
//running
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',
PREPARED: 'blue',
PREPARING: 'blue',
PULLING: 'blue',
//running
Expand Down
3 changes: 2 additions & 1 deletion react/src/components/SessionListColums/SessionInfoCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ const isRunningStatus = (status: string = '') => {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARED',
'PREPARING',
'PULLING',
].includes(status);
};

const isPreparing = (status: string = '') => {
return ['RESTARTING', 'PREPARING', 'PULLING'].includes(status);
return ['RESTARTING', 'PREPARED', 'PREPARING', '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',
'PREPARED',
'PREPARING',
'PULLING',
];
Expand Down
2 changes: 2 additions & 0 deletions src/components/backend-ai-edu-applauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export default class BackendAiEduApplauncher extends BackendAIPage {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARED',
'PREPARING',
'PULLING',
].join(',');
Expand All @@ -267,6 +268,7 @@ export default class BackendAiEduApplauncher extends BackendAIPage {
'RESTARTING',
'TERMINATING',
'PENDING',
'PREPARED',
'PREPARING',
'PULLING',
].join(',');
Expand Down
9 changes: 8 additions & 1 deletion src/components/backend-ai-session-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,12 @@ export default class BackendAISessionList extends BackendAIPage {
}

_isPreparing(status) {
const preparingStatuses = ['RESTARTING', 'PREPARING', 'PULLING'];
const preparingStatuses = [
'RESTARTING',
'PREPARED',
'PREPARING',
'PULLING',
];
if (preparingStatuses.indexOf(status) === -1) {
return false;
}
Expand Down Expand Up @@ -760,6 +765,7 @@ export default class BackendAISessionList extends BackendAIPage {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARED',
'PREPARING',
'PULLING',
'ERROR',
Expand All @@ -775,6 +781,7 @@ export default class BackendAISessionList extends BackendAIPage {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARED',
'PREPARING',
'PULLING',
];
Expand Down
2 changes: 2 additions & 0 deletions src/components/backend-ai-session-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export default class BackendAISessionView extends BackendAIPage {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARED',
'PREPARING',
'PULLING',
'TERMINATED',
Expand All @@ -346,6 +347,7 @@ export default class BackendAISessionView extends BackendAIPage {
'RESTARTING',
'TERMINATING',
'PENDING',
'PREPARED',
'PREPARING',
'PULLING',
'TERMINATED',
Expand Down
1 change: 1 addition & 0 deletions src/pipeline/components/pipeline-job-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export default class PipelineJobList extends BackendAIPage {
[
'PENDING',
'SCHEDULED',
'PREPARED',
'PREPARING',
'BUILDING',
'PULLING',
Expand Down
1 change: 1 addition & 0 deletions src/pipeline/lib/pipeline-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default class PipelineUtils extends LitElement {
case 'BUILDING':
case 'PULLING':
case 'SCHEDULED':
case 'PREPARED':
case 'PREPARING':
case 'PENDING':
color = 'yellow';
Expand Down

0 comments on commit 7265dfb

Please sign in to comment.