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: Add Resource Allocation stats to trial detail #9533

Merged
merged 11 commits into from
Jun 28, 2024

Conversation

gt2345
Copy link
Contributor

@gt2345 gt2345 commented Jun 17, 2024

Ticket

MD-440

Description

Add Resource Allocation information to trial details page. When clicking on the stats card, a modal will display allocation details. The font of the card is the theme color, to indicate it's clickable.
Screenshot 2024-06-17 at 10 12 28 AM

For a local cpu experiment

Screenshot 2024-06-17 at 11 01 20 AM

More screenshots using mock data

Screenshot 2024-06-17 at 10 52 08 AM Screenshot 2024-06-17 at 10 54 02 AM Screenshot 2024-06-17 at 10 57 37 AM Screenshot 2024-06-17 at 10 58 47 AM

Test Plan

Checklist

  • Changes have been manually QA'd
  • New features have been approved by the corresponding PM
  • User-facing API changes have the "User-facing API Change" label
  • Release notes have been added as a separate file under docs/release-notes/
    See Release Note for details.
  • Licenses have been included for new code which was copied and/or modified from any external code

Copy link

netlify bot commented Jun 17, 2024

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit 0505bd5
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/667ee8e3a3c3e00008bba1e5

@keita-determined
Copy link
Contributor

keita-determined commented Jun 17, 2024

im not a reviewer but i remembered we've decided not to show the allocation images as of this March because that causes design collapse with many slots. Is that fixed?

#8814 (comment)

@gt2345
Copy link
Contributor Author

gt2345 commented Jun 17, 2024

im not a reviewer but i remembered we've decided not to show the allocation images as of this March because that causes design collapse with many slots. Is that fixed?

#8814 (comment)

@keita-determined Thanks for the information. As far as I knew, Aleph Alpha is still requesting this feature, also we decided to only show the used slots (blue part), and ignore the total/available slots (grey part)

@keita-determined
Copy link
Contributor

@gt2345 got it, thanks

Copy link

codecov bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 75.44910% with 41 lines in your changes missing coverage. Please review.

Project coverage is 51.35%. Comparing base (4760d95) to head (0505bd5).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9533      +/-   ##
==========================================
+ Coverage   51.31%   51.35%   +0.04%     
==========================================
  Files        1252     1252              
  Lines      152028   152173     +145     
  Branches     3019     3023       +4     
==========================================
+ Hits        78007    78150     +143     
- Misses      73862    73865       +3     
+ Partials      159      158       -1     
Flag Coverage Δ
backend 43.96% <100.00%> (+0.01%) ⬆️
harness 72.80% <ø> (ø)
web 47.98% <73.02%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
master/internal/api_tasks.go 49.04% <100.00%> (+1.21%) ⬆️
webui/react/src/services/api.ts 97.66% <100.00%> (+0.01%) ⬆️
webui/react/src/types.ts 99.68% <100.00%> (+<0.01%) ⬆️
webui/react/src/services/apiConfig.ts 73.90% <90.90%> (+0.09%) ⬆️
webui/react/src/services/decoder.ts 21.64% <0.00%> (-0.03%) ⬇️
webui/react/src/pages/ResourcePool/Topology.tsx 30.66% <22.22%> (+30.66%) ⬆️
...ebui/react/src/pages/TrialDetails/TrialInfoBox.tsx 87.72% <78.26%> (-10.41%) ⬇️

... and 5 files with indirect coverage changes

}, [canceler, stopPolling]);

useEffect(() => {
if (acceleratorData && !pausableRunStates.has(experiment.state)) stopPolling();
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@@ -341,7 +345,14 @@ func (a *apiServer) GetTaskAcceleratorData(

var accelerationData []*apiv1.AcceleratorData
for _, r := range res {
accelerationData = append(accelerationData, r.Proto())
accelerationData = append(accelerationData, &apiv1.AcceleratorData{
Copy link
Contributor

Choose a reason for hiding this comment

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

why not modify the Proto() method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm hesitate to change the model.AcceleratorData type, it will no longer match the allocation_accelerators table, also there are use cases where the resource_pool field is not necessary

Copy link
Contributor

@azhou-determined azhou-determined left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@NicholasBlaskey NicholasBlaskey left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The 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 v1PostAllocationAcceleratorDataRequest but I think this is fine

ResourcePool string
}{}

err := db.Bun().NewSelect().ColumnExpr("alloc_acc.*").
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course, test added

@gt2345 gt2345 merged commit 875e326 into main Jun 28, 2024
80 of 94 checks passed
@gt2345 gt2345 deleted the gt/440-resource-allocation branch June 28, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants