[Core][Node Labels 3/n]Add node labels to node resources and publish to all node#36009
[Core][Node Labels 3/n]Add node labels to node resources and publish to all node#36009jjyao merged 1 commit intoray-project:masterfrom
Conversation
There was a problem hiding this comment.
it's a bit weird that we can have node with only labels but empty resources. We should be able to set labels and resources together when we add a node?
There was a problem hiding this comment.
I have reconsidered and still think it's better to keep this interface.
There was a problem hiding this comment.
I'm actually wondering when we may not have total resources. Should it be a check instead of warning? Let me check with the team.
There was a problem hiding this comment.
Can we actually change if (it == nodes_.end()) { to CHECK which makes code easier to reason about.
There was a problem hiding this comment.
After we have labels, the current naming (NodeResources) is no longer that accurate. We should probably have something like
class Node {
NodeResources resources;
map<string, string> labels;
}
There was a problem hiding this comment.
- Labels can also be regarded as a resource of node. So it is very suitable to put it in NodeResources, and it reduces a lot of code changes.
- NodeResources do not need to be computable. The ResourceRequest in NodeResources is Computable. Adding labels to NodeResources does not affect the original available/tatal, etc.

There was a problem hiding this comment.
Can we actually change if (it == nodes_.end()) { to CHECK which makes code easier to reason about.
There was a problem hiding this comment.
I don't think we should early return here. If labels are empty then we should just set node labels to empty.
There was a problem hiding this comment.
Same as above.
I've thought about it, and for the scenario where nodes are added, the semantics should be 'reset' instead of 'update', since the labels are static. Therefore, I have changed the interface to 'ResetNodeLabels()'. If dynamic labels are added in the future, I will create a new interface called 'UpdateNodeLabels()'.
3781ee3 to
3942b14
Compare
src/ray/raylet/node_manager.h
Outdated
There was a problem hiding this comment.
Where is the change that creates the ClusterResourceScheduler and pass in the labels?
all node Signed-off-by: LarryLian <554538252@qq.com>
…to all node(ray-project#36009) Signed-off-by: LarryLian <554538252@qq.com> Signed-off-by: e428265 <arvind.chandramouli@lmco.com>



Why are these changes needed?
Add node labels to node resources and publish to all node
Related issue number
Enhancing node affinity scheduling feature through node labels #34894
(P1)Parse the configuration parameters for node labels and save them in the NodeInfo data structure.
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.