Move task to common module and add checks in getter methods#5147
Move task to common module and add checks in getter methods#5147raulchen merged 29 commits intoray-project:masterfrom
Conversation
|
Test FAILed. |
|
Test FAILed. |
|
Test PASSed. |
|
Test PASSed. |
zhijunfu
left a comment
There was a problem hiding this comment.
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.
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.
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?
| copts = COPTS, | ||
| deps = [ | ||
| ":common_cc_proto", | ||
| ":node_manager_fbs", |
There was a problem hiding this comment.
will this be removed later?
There was a problem hiding this comment.
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.
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,TaskExecutionSpecificationand 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_workerandrayletwill independent.Add checks in the getter methods in
TaskSpecificationto avoid getting wrong attributes.Related issue number
#4850
Linter
scripts/format.shto lint the changes in this PR.