Skip to content

[core] Unnecessary node manager client#54803

Merged
edoakes merged 5 commits intoray-project:masterfrom
dayshah:unnecessary-node-mgr-client
Jul 22, 2025
Merged

[core] Unnecessary node manager client#54803
edoakes merged 5 commits intoray-project:masterfrom
dayshah:unnecessary-node-mgr-client

Conversation

@dayshah
Copy link
Copy Markdown
Contributor

@dayshah dayshah commented Jul 21, 2025

Why are these changes needed?

There were 3 node manager clients NodeManagerClient, NodeManagerWorkerClient, and RayletClient. They all basically do the same thing. RayletClient is the only one we need. This PR kills NodeManagerClient, simplifies NodeManagerWorkerClient and basically boxes NodeManagerWorkerClient inside RayletClient as an implementation detail so callers don't need to be aware of NodeManagerWorkerClient. Makes everything inside NodeManagerWorkerClient private and just makes RayletClient a friend so it's the only thing that can actually use it.

Later hopefully we can kill NodeManagerWorkerClient entirely but that requires renaming a lot of functions.

Doing this so that everything consistently uses RayletClient and we can use raylet client pools everywhere and turn the RayletClient into a retryable grpc client with a lifetime controlled by the pool like the core worker clients.

There were also a lot of unnecessary copies around HandleFormatGlobalMemoryInfo GetNodeStats so cleaned those up.

dayshah added 2 commits July 21, 2025 13:29
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
@dayshah dayshah added the go add ONLY when ready to merge, run all tests label Jul 21, 2025
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @dayshah, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines how clients interact with the Raylet's Node Manager service by refactoring the RayletClient to manage its internal gRPC client directly. This change simplifies the RayletClient's API, consolidates Node Manager client functionality, and cleans up client initialization patterns throughout the Ray core codebase.

Highlights

  • RayletClient API Simplification: The RayletClient's constructors and factory functions have been updated to directly accept the IP address, port, and ClientCallManager. This change makes the RayletClient responsible for internally creating its gRPC client (NodeManagerWorkerClient), thereby simplifying its initialization and reducing boilerplate code across the codebase.
  • Consolidation of Node Manager Clients: The rpc::NodeManagerClient class has been removed, and its GetNodeStats functionality has been integrated into rpc::NodeManagerWorkerClient. This consolidates the Node Manager client-side RPC logic into a single, more focused class.
  • Codebase-wide Client Initialization Update: Various core components of Ray, including CoreWorker, CoreWorkerProcess, and Raylet, have been updated to adopt the new, simplified RayletClient construction pattern, leading to a more consistent and cleaner approach to client initialization.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the RayletClient creation and usage, encapsulating the underlying gRPC client setup. This improves code structure and client instantiation. The changes also include modern C++ features and a virtual destructor to MutableObjectReaderInterface.

Signed-off-by: dayshah <dhyey2019@gmail.com>
@dayshah dayshah marked this pull request as ready for review July 22, 2025 06:12
@dayshah dayshah requested a review from a team as a code owner July 22, 2025 06:12
@edoakes edoakes merged commit 7c38e65 into ray-project:master Jul 22, 2025
5 checks passed
@dayshah dayshah deleted the unnecessary-node-mgr-client branch July 22, 2025 16:34
alimaazamat pushed a commit to alimaazamat/ray that referenced this pull request Jul 24, 2025
There were 3 node manager clients NodeManagerClient,
NodeManagerWorkerClient, and RayletClient. They all basically do the
same thing. RayletClient is the only one we need. This PR kills
NodeManagerClient, simplifies NodeManagerWorkerClient and basically
boxes NodeManagerWorkerClient inside RayletClient as an implementation
detail so callers don't need to be aware of NodeManagerWorkerClient.
Makes everything inside NodeManagerWorkerClient private and just makes
RayletClient a friend so it's the only thing that can actually use it.

Later hopefully we can kill NodeManagerWorkerClient entirely but that
requires renaming a lot of functions.

Doing this so that everything consistently uses RayletClient and we can
use raylet client pools everywhere and turn the RayletClient into a
retryable grpc client with a lifetime controlled by the pool like the
core worker clients.

There were also a lot of unnecessary copies around
HandleFormatGlobalMemoryInfo GetNodeStats so cleaned those up.

---------

Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: alimaazamat <alima.azamat2003@gmail.com>
krishnakalyan3 pushed a commit to krishnakalyan3/ray that referenced this pull request Jul 30, 2025
There were 3 node manager clients NodeManagerClient,
NodeManagerWorkerClient, and RayletClient. They all basically do the
same thing. RayletClient is the only one we need. This PR kills
NodeManagerClient, simplifies NodeManagerWorkerClient and basically
boxes NodeManagerWorkerClient inside RayletClient as an implementation
detail so callers don't need to be aware of NodeManagerWorkerClient.
Makes everything inside NodeManagerWorkerClient private and just makes
RayletClient a friend so it's the only thing that can actually use it.

Later hopefully we can kill NodeManagerWorkerClient entirely but that
requires renaming a lot of functions.

Doing this so that everything consistently uses RayletClient and we can
use raylet client pools everywhere and turn the RayletClient into a
retryable grpc client with a lifetime controlled by the pool like the
core worker clients.

There were also a lot of unnecessary copies around
HandleFormatGlobalMemoryInfo GetNodeStats so cleaned those up.

---------

Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: Krishna Kalyan <krishnakalyan3@gmail.com>
jugalshah291 pushed a commit to jugalshah291/ray_fork that referenced this pull request Sep 11, 2025
There were 3 node manager clients NodeManagerClient,
NodeManagerWorkerClient, and RayletClient. They all basically do the
same thing. RayletClient is the only one we need. This PR kills
NodeManagerClient, simplifies NodeManagerWorkerClient and basically
boxes NodeManagerWorkerClient inside RayletClient as an implementation
detail so callers don't need to be aware of NodeManagerWorkerClient.
Makes everything inside NodeManagerWorkerClient private and just makes
RayletClient a friend so it's the only thing that can actually use it.

Later hopefully we can kill NodeManagerWorkerClient entirely but that
requires renaming a lot of functions.

Doing this so that everything consistently uses RayletClient and we can
use raylet client pools everywhere and turn the RayletClient into a
retryable grpc client with a lifetime controlled by the pool like the
core worker clients.

There were also a lot of unnecessary copies around
HandleFormatGlobalMemoryInfo GetNodeStats so cleaned those up.

---------

Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: jugalshah291 <shah.jugal291@gmail.com>
dstrodtman pushed a commit to dstrodtman/ray that referenced this pull request Oct 6, 2025
There were 3 node manager clients NodeManagerClient,
NodeManagerWorkerClient, and RayletClient. They all basically do the
same thing. RayletClient is the only one we need. This PR kills
NodeManagerClient, simplifies NodeManagerWorkerClient and basically
boxes NodeManagerWorkerClient inside RayletClient as an implementation
detail so callers don't need to be aware of NodeManagerWorkerClient.
Makes everything inside NodeManagerWorkerClient private and just makes
RayletClient a friend so it's the only thing that can actually use it.

Later hopefully we can kill NodeManagerWorkerClient entirely but that
requires renaming a lot of functions.

Doing this so that everything consistently uses RayletClient and we can
use raylet client pools everywhere and turn the RayletClient into a
retryable grpc client with a lifetime controlled by the pool like the
core worker clients.

There were also a lot of unnecessary copies around
HandleFormatGlobalMemoryInfo GetNodeStats so cleaned those up.

---------

Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants