[core] Unnecessary node manager client#54803
Conversation
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
There was a problem hiding this comment.
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, andClientCallManager. This change makes theRayletClientresponsible 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::NodeManagerClientclass has been removed, and itsGetNodeStatsfunctionality has been integrated intorpc::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, andRaylet, have been updated to adopt the new, simplifiedRayletClientconstruction 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
-
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. ↩
There was a problem hiding this comment.
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>
Signed-off-by: dayshah <dhyey2019@gmail.com>
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>
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>
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>
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>
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.