Skip to content

Commit

Permalink
fix: session list fetch failure due to missing version condition for …
Browse files Browse the repository at this point in the history
…`PREPARED` (#2854)
  • Loading branch information
yomybaby authored Nov 16, 2024
1 parent b082f8a commit 39e7191
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
16 changes: 12 additions & 4 deletions src/components/backend-ai-edu-applauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,20 +258,28 @@ export default class BackendAiEduApplauncher extends BackendAIPage {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARED',
globalThis.backendaiclient.supports('prepared-session-status')
? 'PREPARED'
: undefined,
'PREPARING',
'PULLING',
].join(',');
]
.filter((v) => !!v)
.join(',');
} else {
statuses = [
'RUNNING',
'RESTARTING',
'TERMINATING',
'PENDING',
'PREPARED',
globalThis.backendaiclient.supports('prepared-session-status')
? 'PREPARED'
: undefined,
'PREPARING',
'PULLING',
].join(',');
]
.filter((v) => !!v)
.join(',');
}

const accessKey = globalThis.backendaiclient._config.accessKey;
Expand Down
8 changes: 6 additions & 2 deletions src/components/backend-ai-session-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,11 +765,13 @@ export default class BackendAISessionList extends BackendAIPage {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARED',
'PREPARING',
'PULLING',
'ERROR',
];
if (globalThis.backendaiclient.supports('prepared-session-status')) {
status.push('PREPARED');
}
break;
case 'finished':
status = ['TERMINATED', 'CANCELLED']; // TERMINATED, CANCELLED
Expand All @@ -781,10 +783,12 @@ export default class BackendAISessionList extends BackendAIPage {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARED',
'PREPARING',
'PULLING',
];
if (globalThis.backendaiclient.supports('prepared-session-status')) {
status.push('PREPARED');
}
}
if (
!globalThis.backendaiclient.supports('avoid-hol-blocking') &&
Expand Down
5 changes: 3 additions & 2 deletions src/components/backend-ai-session-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ export default class BackendAISessionView extends BackendAIPage {
'TERMINATING',
'PENDING',
'SCHEDULED',
'PREPARED',
'PREPARING',
'PULLING',
'TERMINATED',
Expand All @@ -347,14 +346,16 @@ export default class BackendAISessionView extends BackendAIPage {
'RESTARTING',
'TERMINATING',
'PENDING',
'PREPARED',
'PREPARING',
'PULLING',
'TERMINATED',
'CANCELLED',
'ERROR',
];
}
if (globalThis.backendaiclient.supports('prepared-session-status')) {
status.push('PREPARED');
}
if (globalThis.backendaiclient.supports('detailed-session-states')) {
status = status.join(',');
}
Expand Down
1 change: 1 addition & 0 deletions src/lib/backend.ai-client-esm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ class Client {
if (this.isManagerVersionCompatibleWith('24.12.0')) {
this._features['extended-image-info'] = true;
this._features['batch-timeout'] = true;
this._features['prepared-session-status'] = true;
}
}

Expand Down

0 comments on commit 39e7191

Please sign in to comment.