-
Notifications
You must be signed in to change notification settings - Fork 357
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: Add Resource Allocation stats to trial detail #9533
Changes from 10 commits
77aaeeb
daa5c53
59b50a2
892e966
7334603
5ac7313
a976752
dc95c5b
e73ac14
f4fa919
0505bd5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -329,19 +329,31 @@ func (a *apiServer) GetTaskAcceleratorData( | |
return nil, err | ||
} | ||
|
||
var res []model.AcceleratorData | ||
err := db.Bun().NewSelect(). | ||
ColumnExpr("alloc_acc.*"). | ||
res := []struct { | ||
model.AcceleratorData | ||
ResourcePool string | ||
}{} | ||
|
||
err := db.Bun().NewSelect().ColumnExpr("alloc_acc.*"). | ||
Column("resource_pool"). | ||
TableExpr("allocation_accelerators alloc_acc"). | ||
Join("LEFT JOIN allocations alloc ON alloc_acc.allocation_id = alloc.allocation_id"). | ||
Order("start_time DESC"). | ||
Where("alloc.task_id = ?", req.TaskId).Scan(ctx, &res) | ||
if err != nil { | ||
return nil, fmt.Errorf("querying allocation accelerators: %w", err) | ||
} | ||
|
||
var accelerationData []*apiv1.AcceleratorData | ||
for _, r := range res { | ||
accelerationData = append(accelerationData, r.Proto()) | ||
accelerationData = append(accelerationData, &apiv1.AcceleratorData{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not modify the Proto() method? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm hesitate to change the |
||
ContainerId: r.ContainerID, | ||
AllocationId: string(r.AllocationID), | ||
NodeName: r.NodeName, | ||
AcceleratorType: r.AcceleratorType, | ||
AcceleratorUuids: r.AcceleratorUuids, | ||
ResourcePool: r.ResourcePool, | ||
}) | ||
} | ||
return &apiv1.GetTaskAcceleratorDataResponse{AcceleratorData: accelerationData}, nil | ||
} | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -595,6 +595,8 @@ message AcceleratorData { | |
string accelerator_type = 5; | ||
// An array of UUIDs of the accelerators associated with the allocation. | ||
repeated string accelerator_uuids = 6; | ||
// The name of the resource pool. | ||
string resource_pool = 7; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its a little awkward to me that we won't use this field when calling |
||
} | ||
|
||
// Arguments to an all gather. | ||
|
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.
can you update a test in
api_tasks_intg_test.go
to check resource pool is set right?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.
Of course, test added