backend.ai icon indicating copy to clipboard operation
backend.ai copied to clipboard

feat: `session status-history` handler

Open jopemachine opened this issue 2 years ago • 4 comments

refs #412, follow-up to #480

Currently, session status-history raises 404 error because the status-history handler does not exist.

$ ./backend.ai session status-history mysession
✘ BackendAPIError: 404 Not Found
  Unknown URL path.
  ➜ Data: '/session/mysession/status-history'

Result

In this PR, session status-history command prints the status-history like below.

$ ./backend.ai session status-history mysession
∙ status_history: OrderedDict([('PENDING', '2023-02-27T00:48:12.723794+00:00'), ('RUNNING', '2023-02-27T00:48:18.579231+00:00'), ('PREPARING', '2023-02-27T00:48:13.530317+00:00'), ('SCHEDULED', '2023-02-27T00:48:13.498186+00:00')])
✓ Actual Resource Allocation Time: {'result': {'seconds': 0, 'microseconds': 0}}

But I think it would be nice to find better formatting for the status-history instead of just printing OrderedDict.

jopemachine avatar Feb 27 '23 01:02 jopemachine

Please refer ai.backend.client.output and its usage for handling console/json outputs of the client SDK in a single abstraction.

achimnol avatar Feb 27 '23 12:02 achimnol

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 26 '23 03:03 CLAassistant

Please refer ai.backend.client.output and its usage for handling console/json outputs of the client SDK in a single abstraction.

I updated this PR, but I think there might be some missing session types in https://github.com/lablup/backend.ai/pull/1116/files#diff-617867996601b356e12de71696162ef8390144f3ba6aaba12da78cb7efabf4f7R961-R969.

스크린샷 2023-08-14 오후 12 15 45

jopemachine avatar Aug 14 '23 03:08 jopemachine

We will revisit this PR after converting the status history columns from mappings to lists in the chronological order.

achimnol avatar Oct 05 '23 02:10 achimnol

This will be resolved in #3201.

jopemachine avatar Dec 05 '24 06:12 jopemachine