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
[grpc] Add grpc server to worker #5054
[grpc] Add grpc server to worker #5054
Conversation
Co-Authored-By: Hao Chen <chenh1024@gmail.com>
Could you merge master and resolve conflicts? |
…ch-alliance/ray into add_grpc_server_to_worker
Done, thanks. |
Test PASSed. |
Test PASSed. |
Test PASSed. |
Test FAILed. |
Co-Authored-By: Stephanie Wang <swang@cs.berkeley.edu>
Test PASSed. |
Test FAILed. |
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.
The changes to the core worker look okay, but I think we should remove any unused code from this PR before merging. Generally, we should avoid merging unused code completely.
…ch-alliance/ray into add_grpc_server_to_worker
Comments are addressed. This also merges the content of #5062 to avoid future code conflicts. |
Test PASSed. |
Test PASSed. |
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.
I reviewed the unused code for the AssignTask
request in this round, but let's please try to avoid merging any unused code in the future.
Also, thanks for merging with #5062. However, because that PR is still under review, I cannot approve this PR until #5062 is merged. There are 2 options: you can either wait for #5062 (and you may have to merge again if it changes) or you can roll back the merge.
} | ||
|
||
Status CoreWorkerRayletTaskReceiver::SetTaskHandler(const TaskHandler &callback) { | ||
task_handler_ = callback; |
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.
Unless there is some reason we'd overwrite this, I think this should be set as part of the constructor to avoid calling an uninitialized task_handler_
.
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.
I removed this function from this PR. Next pr would initialize the task_handler_
in constructor.
/// | ||
/// \param[in] request The request message. | ||
/// \param[out] reply The reply message. | ||
/// \param[in] done_callback The callback to be called when the request is done. |
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.
It seems brittle to require that done_callback
be called inside HandleAssignTask
. Can we instead pass in a lambda that calls HandleAssignTask
, then the done_callback
?
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.
I'm thinking about refactor ServerCall
to call done_callback
there instead, but as it would require changing node manager as well as object manager, I'd prefer to do it via a later PR.
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.
That doesn't seem necessary. I think we can just wrap HandleAssignTask
in a lambda.
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.
sorry I'm not quite sure what the suggested change would be. May you add an example code? Thanks.
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.
Sure, I was suggesting that instead of passing in &WorkerTaskHandler::HandleAssignTask
into ServerCallFactoryImpl
, we could pass in something like:
[HandleAssignTask]( ... , done_callback) { HandleAssignTask(...); done_callback(); }
But actually, I think if I'm understanding the code correctly, what you're suggesting about doing it in ServerCall
is the same thing. So agreed, let's just do it in a future PR.
Co-Authored-By: Stephanie Wang <swang@cs.berkeley.edu>
Co-Authored-By: Stephanie Wang <swang@cs.berkeley.edu>
Test PASSed. |
Test PASSed. |
…ch-alliance/ray into add_grpc_server_to_worker
Test FAILed. |
Test FAILed. |
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.
Thanks!
Btw, looks like there is a build error on Linux and a lint error. |
Test FAILed. |
Test FAILed. |
Thanks. Fixed. The remaining errors look unrelated. |
What do these changes do?
Add a gRPC server to the worker that registers with the raylet (but no communication through here yet). Also convert RayletClient references to unique_ptr.
For more details, refer to #5039
Related issue number
#5029
Linter
scripts/format.sh
to lint the changes in this PR.