-
Notifications
You must be signed in to change notification settings - Fork 156
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: Replace sessions
, kernels
's status_history
's type map
with list
#2113
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
222dd6d
to
24dfca2
Compare
5495f32
to
b707634
Compare
2b525ff
to
2d3e2b4
Compare
…manager.models.utils - This eliminates the necessity to use stringified enum arguments in the `ai.backend.manager.models` codes. - In the client SDK, add a copy of it using relaxed str-only arguments. Since this is a fairly simple logic, I think it is not worth to introduce additional complexity to share and reuse the code between the client SDK and the manager. (Note that originally `ai.backend.common` was not the dependency of the client SDK...) - I think it would be better to introduce a JSON-fied TypedDict of each status history records. - Also fix several merge errors.
2d3e2b4
to
5eeb502
Compare
if (preparing := get_first_timestamp_for_status(status_history, "PREPARING")) is None: | ||
elapsed = timedelta() | ||
elif ( | ||
terminated := get_first_timestamp_for_status(status_history, "TERMINATED") | ||
) is None: | ||
elapsed = datetime.now(tzutc()) - preparing | ||
else: | ||
alloc_time: timedelta = isoparse(terminated) - isoparse(preparing) | ||
result = { | ||
"result": { | ||
"seconds": alloc_time.seconds, | ||
"microseconds": alloc_time.microseconds, | ||
}, | ||
} | ||
print_done(f"Actual Resource Allocation Time: {result}") | ||
elapsed = terminated - preparing | ||
|
||
print_done(f"Actual Resource Allocation Time: {elapsed.total_seconds()}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've probably kept the existing behavior based on dict
, but since you've changed the structure based on list
, shouldn't you show the whole history change?
sessions
, kernels
's status_history
's type map
with list
sessions
, kernels
's status_history
's type map
with list
Since this PR adds or modifies the API, it has been changed to "feat". |
This original PR has become too outdated, requiring excessive effort to update, so a new PR has been created. |
Refs #412, follow-up to #480.
Related PR: #1116.
The current implementation saves only the most recent timestamp whenever status information in
status_history
is updated, and all previous information is deleted.This PR prevents the loss of timestamp information by changing the data structure of
sessions
,kernels
'sstatus_history
to List.Previous format:
New format:
Checklist: (if applicable)
📚 Documentation preview 📚: https://sorna--2113.org.readthedocs.build/en/2113/
📚 Documentation preview 📚: https://sorna-ko--2113.org.readthedocs.build/ko/2113/