You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by AtkinsChang <gi...@git.apache.org> on 2016/02/09 07:54:00 UTC
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
GitHub user AtkinsChang opened a pull request:
https://github.com/apache/spark/pull/11129
[SPARK-13232][YARN] Fix executor node label
Specify node label for executor will cause Spark not working on Yarn due to Yarn does not support node container request with both label and locality(racks/nodes).
Add test to `YarnAllocatorSuite` to reproduce this situation and change `YarnAllocator#createContainerRequest` to apply node label only to locality free request.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/AtkinsChang/spark SPARK-13232
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/11129.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #11129
----
commit 190230b8da5436885e56a6bc00173494e89151fc
Author: AtkinsChang <at...@gmail.com>
Date: 2016-02-09T02:37:20Z
[SPARK-13232][YARN] Fix executor node label
----
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by tgravescs <gi...@git.apache.org>.
Github user tgravescs commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-184792133
Jenkins, test this please
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #11129: [SPARK-13232][YARN] Fix executor node label
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:
https://github.com/apache/spark/pull/11129
Hi @AtkinsChang is it still active?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-184806516
Merged build finished. Test PASSed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by jerryshao <gi...@git.apache.org>.
Github user jerryshao commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-190599752
Any further updates on it? CC @sryza about this.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-184806518
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/51369/
Test PASSed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-193187287
CC @sryza or maybe @steveloughran or @vanzin . I don't speak YARN
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by jerryshao <gi...@git.apache.org>.
Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/11129#discussion_r53272901
--- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala ---
@@ -307,8 +307,14 @@ private[yarn] class YarnAllocator(
nodes: Array[String],
racks: Array[String]): ContainerRequest = {
nodeLabelConstructor.map { constructor =>
+ val labelExp = if ((racks != null && (!racks.isEmpty))
+ || (nodes != null && (!nodes.isEmpty))) {
+ null
+ } else {
+ labelExpression.orNull
+ }
constructor.newInstance(resource, nodes, racks, RM_REQUEST_PRIORITY, true: java.lang.Boolean,
- labelExpression.orNull)
+ labelExp)
--- End diff --
Normally if user set this label expression configuration, they want the label-based scheduling obviously. But in your implementation you silently disable this, this will make user confuse. Also since label-based scheduling cannot be worked with locality preferences in YARN side (I think it is intentionally), it would be better to ignore the locality information 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #11129: [SPARK-13232][YARN] Fix executor node label
Posted by movwei <gi...@git.apache.org>.
Github user movwei commented on the issue:
https://github.com/apache/spark/pull/11129
But In Hadoop 2.8.2 there still have this problem when request a container with both node label and locality(rack/node). ResourceManager will also checked it, and the related code is as follows:
RMAppManager#validateAndCreateResourceRequest -> SchedulerUtils#validateResourceRequest
```java
org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils.java
private static void validateResourceRequest(ResourceRequest resReq,
Resource maximumResource, QueueInfo queueInfo, RMContext rmContext)
throws InvalidResourceRequestException {
.......
String labelExp = resReq.getNodeLabelExpression();
// we don't allow specify label expression other than resourceName=ANY now
if (!ResourceRequest.ANY.equals(resReq.getResourceName())
&& labelExp != null && !labelExp.trim().isEmpty()) {
throw new InvalidLabelResourceRequestException(
"Invalid resource request, queue=" + queueInfo.getQueueName()
+ " specified node label expression in a "
+ "resource request has resource name = "
+ resReq.getResourceName());
}
// we don't allow specify label expression with more than one node labels now
if (labelExp != null && labelExp.contains("&&")) {
throw new InvalidLabelResourceRequestException(
"Invailid resource request, queue=" + queueInfo.getQueueName()
+ " specified more than one node label "
+ "in a node label expression, node label expression = "
+ labelExp);
}
......
}
}
```
It will cause spark ApplicationMaster failed with InvalidLabelResourceRequestException, so we still need this patch.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by AtkinsChang <gi...@git.apache.org>.
Github user AtkinsChang commented on a diff in the pull request:
https://github.com/apache/spark/pull/11129#discussion_r53269455
--- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala ---
@@ -307,8 +307,14 @@ private[yarn] class YarnAllocator(
nodes: Array[String],
racks: Array[String]): ContainerRequest = {
nodeLabelConstructor.map { constructor =>
+ val labelExp = if ((racks != null && (!racks.isEmpty))
+ || (nodes != null && (!nodes.isEmpty))) {
+ null
+ } else {
+ labelExpression.orNull
+ }
constructor.newInstance(resource, nodes, racks, RM_REQUEST_PRIORITY, true: java.lang.Boolean,
- labelExpression.orNull)
+ labelExp)
--- End diff --
Yeah, I had this idea before, but imo if totally disregard the data locality may cause a lot of network overhead.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by steveloughran <gi...@git.apache.org>.
Github user steveloughran commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-217520612
It's actually being fixed right now in Hadoop 2.8, which will take a while to surface.
[YARN-4925](https://issues.apache.org/jira/browse/YARN-4925).
Looking at the patch, all Bibin is doing is cutting that validation check out from the container request submission...it's up to the scheduler how it handles things at that point. Presumably (hopefully) it does the right thing.
If the patch goes in to spark, then eventually, there may be benefits in pulling it. If it goes in now, it stops things breaking today.
This is a tough call...nobody wants to add another switch for this do they?
(now, maximally devious would be to catch the exception and downgrade, but that's both hard to test and inevitably brittle in some way)
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by jerryshao <gi...@git.apache.org>.
Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/11129#discussion_r53124448
--- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala ---
@@ -307,8 +307,14 @@ private[yarn] class YarnAllocator(
nodes: Array[String],
racks: Array[String]): ContainerRequest = {
nodeLabelConstructor.map { constructor =>
+ val labelExp = if ((racks != null && (!racks.isEmpty))
+ || (nodes != null && (!nodes.isEmpty))) {
+ null
+ } else {
+ labelExpression.orNull
+ }
constructor.newInstance(resource, nodes, racks, RM_REQUEST_PRIORITY, true: java.lang.Boolean,
- labelExpression.orNull)
+ labelExp)
--- End diff --
From my understanding, currently in your implementation if `nodes` or `racks` is not empty, label expression will not be worked even it is explicitly set through configuration.
IMO I would choose to set `nodes` and `racks` to null if label expression is configured, otherwise user will be confused why explicitly setting lab expression is not worked.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by jerryshao <gi...@git.apache.org>.
Github user jerryshao commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-217768853
>now, maximally devious would be to catch the exception and downgrade
Maybe we could do this in Spark side, though a little complicated but doable.
Yes it is hard to test label related things in Spark side, at least we could manually verify it locally.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-184800264
**[Test build #51369 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/51369/consoleFull)** for PR 11129 at commit [`28f1491`](https://github.com/apache/spark/commit/28f14915a5db8e022146ae17540a4a66c24a2d5b).
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by steveloughran <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #11129: [SPARK-13232][YARN] Fix executor node label
Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:
https://github.com/apache/spark/pull/11129
It's been a while since discussion died down here; I don't like the current version because it will break things with a fixed YARN. So the options are either implement Steve's suggestion, or not do anything and tell users to not use labels in broken version of YARN. I'm kinda leaning towards the latter but don't really feel strongly.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-217510873
@steveloughran do you think this is a good or not-good change overall?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-184806182
**[Test build #51369 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/51369/consoleFull)** for PR 11129 at commit [`28f1491`](https://github.com/apache/spark/commit/28f14915a5db8e022146ae17540a4a66c24a2d5b).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-13232][YARN] Fix executor node label
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/11129#issuecomment-181737645
Can one of the admins verify this patch?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #11129: [SPARK-13232][YARN] Fix executor node label
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/11129
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org