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

[ray dashboard] Sort actor table columns by resource utilization #42788

Merged
merged 13 commits into from
Jan 31, 2024

Conversation

nikitavemuri
Copy link
Contributor

@nikitavemuri nikitavemuri commented Jan 29, 2024

Why are these changes needed?

  • Sorts the Actor table by resource utilization columns (Uptime, Used memory, Total memory, CPU, GPU utilization, GRAM usage). Reverse toggle also available
  • We still apply base sort to bring "Alive" actors to top of list, and user specified sort key applies within set of actors with each state
  • Default sort key is now "Uptime" so newly started actors (with shortest uptime) appear at the top. Previous default sort put actors with longest uptime at top, but showing newly started actors at the top would probably be more useful for many use cases.
Screen Shot 2024-01-29 at 3 44 42 PM

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Nikita Vemuri added 6 commits January 29, 2024 09:56
wip
Signed-off-by: Nikita Vemuri <[email protected]>
Signed-off-by: Nikita Vemuri <[email protected]>
Signed-off-by: Nikita Vemuri <[email protected]>
Signed-off-by: Nikita Vemuri <[email protected]>
fix
Signed-off-by: Nikita Vemuri <[email protected]>
Signed-off-by: Nikita Vemuri <[email protected]>
@nikitavemuri nikitavemuri changed the title [WIP] [ray dashboard] Sort actor table columns by resource utilization [ray dashboard] Sort actor table columns by resource utilization Jan 29, 2024
@nikitavemuri nikitavemuri marked this pull request as ready for review January 29, 2024 20:25
Nikita Vemuri added 3 commits January 29, 2024 12:26
dev
Signed-off-by: Nikita Vemuri <[email protected]>
Signed-off-by: Nikita Vemuri <[email protected]>
Copy link
Contributor

@alanwguo alanwguo left a comment

Choose a reason for hiding this comment

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

What does Sort by "All" mean in your screenshot?

Comment on lines -74 to -81
export const sortActors = (actorList: ActorDetail[]) => {
const sortedActors = [...actorList];
return _.sortBy(sortedActors, (actor) => {
const actorOrder = isActorEnum(actor.state) ? stateOrder[actor.state] : 0;
const actorTime = actor.startTime || 0;
return [actorOrder, actorTime];
});
};
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like we already have sort by state, but is it not working correctly?

#42666 was reported recently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From my testing sort by state for actors seems to be working correctly, I think #42666 is only for the clusters table

Copy link
Contributor

Choose a reason for hiding this comment

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

oh whoops. i got that mixed up.

@@ -99,11 +91,36 @@ const ActorTable = ({
const [actorIdFilterValue, setActorIdFilterValue] = useState(filterToActorId);
const [pageSize, setPageSize] = useState(10);

const defaultSorterKey = "";
Copy link
Contributor

Choose a reason for hiding this comment

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

let's extract this out of the component and name it DEFAULT_SORTER_KEY.

Let's also make the default state something like "actor-state" and make it one of the options in teh "Sort by" input so users can go back to that sort.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What does Sort by "All" mean in your screenshot?

"All" was a menu option added by default to the SearchSelect component to represent whatever the default sorting would be if no keys are specified by the user. This component is also used for the "State" filter on the clusters page where "All" would represent all states. I agree for this sort by input we should just specify one of the keys as the default for clarity.

I'm not sure having a separate sort by state is useful for the actors page given we have a "State" filter to either show alive or dead or all actors. If the state filter isn't set the current behavior of showing "Alive" actors at the top seems reasonable. The user specified sort by key would sort actors within the "Alive" and "Dead" state groups.

Current behavior is to sort by reverse uptime as the default for the "All" option. I think sorting by "Uptime" (newest actors at top) probably makes more sense for many use cases so we can select that as the default key.

Nikita Vemuri added 3 commits January 29, 2024 15:40
Signed-off-by: Nikita Vemuri <[email protected]>
wip
Signed-off-by: Nikita Vemuri <[email protected]>
Signed-off-by: Nikita Vemuri <[email protected]>
// the table by default
const uptime =
startTime && startTime > 0
? getDurationVal({ startTime, endTime })
Copy link
Contributor

Choose a reason for hiding this comment

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

I just realized because duration is very dynamic field (changes every second), the sorting of this list may not update when the durations change.

I think this is probably fine... an edge case most people may not notice. Can you add a comment stating we will only re-sort rows on re-renders.

Signed-off-by: Nikita Vemuri <[email protected]>
@architkulkarni architkulkarni merged commit 65df02e into ray-project:master Jan 31, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants