Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: session status-history handler #1116

Closed
wants to merge 5 commits into from
Closed

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Feb 27, 2023

Follow-up PR to #480.
Ref: #412.

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.

@github-actions github-actions bot added the comp:manager Related to Manager component label Feb 27, 2023
@achimnol
Copy link
Member

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

@CLAassistant
Copy link

CLAassistant commented Mar 26, 2023

CLA assistant check
All committers have signed the CLA.

@Yaminyam Yaminyam added the size:M 30~100 LoC label Apr 13, 2023
@github-actions github-actions bot added the comp:client Related to Client component label Aug 14, 2023
@jopemachine
Copy link
Member Author

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 jopemachine marked this pull request as ready for review August 14, 2023 03:21
@jopemachine jopemachine added this to the 23.09 milestone Sep 6, 2023
@achimnol achimnol added the type:feature Add new features label Sep 22, 2023
Copy link
Member

@achimnol achimnol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's improve the console output:

  • Order the status changes in the state machine order (e.g., PENDING, SCHEDULED, PULLING, PREPARING, RUNNING).
    • I think we could generalize the status history loop.
  • Display relative duration between each status change.
  • Format all relative timedelta values using human readable formats.

@kyujin-cho kyujin-cho modified the milestones: 23.09, 24.03 Oct 4, 2023
@achimnol
Copy link
Member

achimnol commented Oct 5, 2023

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

@achimnol achimnol added the action:on hold Hold it. Wait for the restart. label Oct 5, 2023
@jopemachine jopemachine changed the title feat: Implement session status-history handler feat: session status-history handler Oct 6, 2023
@jopemachine jopemachine marked this pull request as draft October 31, 2023 08:49
@jopemachine
Copy link
Member Author

This will be resolved in #3201.

@jopemachine jopemachine closed this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action:on hold Hold it. Wait for the restart. comp:client Related to Client component comp:manager Related to Manager component size:M 30~100 LoC type:feature Add new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants