Github user steveloughran commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-193200945
Yarn and labels, joy.
# Currently, a node can have exactly one label. That may change at a time
in the future, a time called, provisionally "the patch that broke all the code
trying to be clever" :)
# you can ask for work =anywhere, in which case you also need to set
relaxLocality=true. Otherwise some validation rejects the request
# you can do explicit nodes/racks requests, with relax=true or relax=false.
Relax = true means relax placement after a couple of heartbeats, 10-15s. I've
seen bugreps implying the fair scheduler relaxes more aggressively; not looked
@ it.
# If you want labels, you don't get to ask for locations
# if you want to mix labels with locality, you need to be clever and grab
the nodemap, parse the labels, make your own decisions. That's not easy given
there's nothing in the AMRM API to query that nodemap; you need to do it on the
client or in the AM by passing in the relevant client/AM delegation token, do
it as a one-off then subscribe to events. Then you need to scan the labelled
nodes, find those that match and use it as your placement subset.
Yes, [I have done
this](https://github.com/apache/incubator-slider/blob/develop/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java#L209).
No, I would not recommend it. I only did it for anti-affinity placement, where
we needed a guarantee that there'd be only one instance per node, labelled or
not. (i.e we wanted containers to be away from each other, rather than near the
data).
The request [validation
logic](https://github.com/apache/incubator-slider/blob/develop/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java#L394).
I think; it failed for a while (SLIDER-1051) until I turned off some of the
checks.
There's one more corner case: app doesn't ask for labels, but the queue is
bonded to a label. I actually don't know what happens to located requests here.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]