-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Move task to common module and add checks in getter methods #5147
Conversation
Test FAILed. |
Test FAILed. |
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.
Looks good. Left some minor comments.
src/ray/common/task/task_common.h
Outdated
using rpc::Language; | ||
|
||
// Alias `ray::rpc::TaskType` in `ray` namespace. | ||
using rpc::TaskType; |
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.
normally it's not recommended to do this in .h files. It might be fine if there's no other Language
and TaskType
definitions in the future.
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 purpose of doing this is to hide the implementation details that these two enums are defined in protobuf. I'd like other code to use them as if they are defined in task_common.h
.
So, in case we need to get rid of protobuf in the future, the refactor would be easier.
Any idea about how we can better handle this?
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.
updated comment
copts = COPTS, | ||
deps = [ | ||
":common_cc_proto", | ||
":node_manager_fbs", |
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.
will this be removed later?
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.
also add a comment on the core_worker section that the dependency to raylet lib will be removed later?
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.
yes, it'll be removed.
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test PASSed. |
Test PASSed. |
Test FAILed. |
Yes, let's just remove it for now. Thanks! |
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test PASSed. |
Test FAILed. |
Test PASSed. |
Test PASSed. |
What do these changes do?
Moves
Task
,TaskSpecification
,TaskExecutionSpecification
and other related code to "common/task" directory. Because these classes should be shared by both worker and raylet. Currently, core worker still depends onraylet_lib
, because of raylet client. After we migrate raylet client to grpc,core_worker
andraylet
will independent.Add checks in the getter methods in
TaskSpecification
to avoid getting wrong attributes.Related issue number
#4850
Linter
scripts/format.sh
to lint the changes in this PR.