-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-34828][YARN] Make shuffle service name configurable on client side and allow for classpath-based config override on server side #31936
Conversation
Kubernetes integration test starting |
Kubernetes integration test status failure |
Test build #136366 has finished for PR 31936 at commit
|
...-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnShuffleIntegrationSuite.scala
Outdated
Show resolved
Hide resolved
<td><code>sparkShuffleService</code></td> | ||
<td> | ||
The namespace to use when emitting shuffle service metrics into Hadoop metrics2 system of the | ||
NodeManager. |
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.
Could you add some description about the limitation with old Hadoop versions (like 2.7.x)? Here or at Section Running multiple versions of the Spark Shuffle Service
?
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.
For this section, everything will work as expected on Hadoop 2.7.x. The "Running multiple versions" section won't work on 2.7, but I already called out the supported YARN versions there. Can you let me know if there's anything else you think I should call out?
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.
I'm worrying about the situation some users try to use Apache Spark distribution (with Hadoop 2.7)
at YARN 2.9+ cluster. Does it work?
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.
it looks like the name referenced by the node manager works with the Hadoop 2.9+ custom class loader, but I assume with Hadoop 2.7 it requires the spark_shuffle name ? hence the spark.shuffle.service.name won't work unless you have recompiled the code and manually changed it.
Perhaps we just need to be more explicit in the config spark.shuffle.service.name that either references the section running multiple versions of the Spark Shuffle Service or explicitly states supported in YARN 2.9+. I assume this config with metrics doesn't matter as far as Hadoop version.
Also did we explicitly test with Hadoop 2.7 and the case @dongjoon-hyun brings up?
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.
it looks like the name referenced by the node manager works with the Hadoop 2.9+ custom class loader, but I assume with Hadoop 2.7 it requires the spark_shuffle name ? hence the spark.shuffle.service.name won't work unless you have recompiled the code and manually changed it.
No, this is not correct. YARN ignores the hard-coded name on all versions of YARN. Take a look at AuxServices
on the 2.7.0 branch:
https://github.com/apache/hadoop/blob/f95b390df2ca7d599f0ad82cf6e8d980469e7abb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/AuxServices.java#L129-L136
spark.shuffle.service.name
works fine on Hadoop 2.7, it is only the isolated classloader that won't work on older versions.
I'm worrying about the situation some users try to use
Apache Spark distribution (with Hadoop 2.7)
at YARN 2.9+ cluster. Does it work?
I don't quite understand the concern here. Does my explanation above address your question? We haven't changed any of the interfaces used to interact with YARN, there should be no binary compatibility issues or anything of that sort. I can test whichever combination of Spark Version + Hadoop Version Distribution
running on top of Hadoop Version YARN
you like, but I am failing to see where the concern is / what you'd like me to look for.
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.
great, I'm glad it works with 2.7 as well, thanks for clarifying. Yeah the concern was if it didn't work in 2.7 so I think you answered that.
Thank you for pining me, @xkrogen . |
this was tried once before under #26000 so just putting it here for reference. I think the main thing is if we are going to support that we make sure its truly configurable and not just half done. But it sounds like you are trying to address the concerns brought up there but I need to do a more detailed review. One thing doing a quick skim I don't see if in YarnShuffleService.java its still registering the AuxiliaryService with the name spark_shuffle, Is that not really used by the yarn auxiliary service and it uses what you configure in the node manager? In the very least that needs to be documented in the code. |
Working on addressing test failures, will update the PR soon ... @tgravescs thanks for the insightful comments!
Thanks a lot for sharing this, I did not find it in my previous search. I agree that the concerns raised there around supporting different configurations should be addressed by this PR. Just making the shuffle service name configurable was the easy part :)
Great callout. I mentioned this in the JIRA description but it looks like I forgot to include it in the PR description. The name in the NodeManager config ( I would use the value of |
Fixed the test in |
Test build #136417 has started for PR 31936 at commit |
<td><code>sparkShuffleService</code></td> | ||
<td> | ||
The namespace to use when emitting shuffle service metrics into Hadoop metrics2 system of the | ||
NodeManager. |
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.
it looks like the name referenced by the node manager works with the Hadoop 2.9+ custom class loader, but I assume with Hadoop 2.7 it requires the spark_shuffle name ? hence the spark.shuffle.service.name won't work unless you have recompiled the code and manually changed it.
Perhaps we just need to be more explicit in the config spark.shuffle.service.name that either references the section running multiple versions of the Spark Shuffle Service or explicitly states supported in YARN 2.9+. I assume this config with metrics doesn't matter as far as Hadoop version.
Also did we explicitly test with Hadoop 2.7 and the case @dongjoon-hyun brings up?
common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java
Show resolved
Hide resolved
common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java
Show resolved
Hide resolved
...s/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnShuffleAlternateNameConfigSuite.scala
Show resolved
Hide resolved
Updated documentation to make it a bit more clear which features need YARN >= 2.9.0 (only the isolated classloader / multiple shuffle service support, none of the other new additions). |
5e242f0
to
0427a2f
Compare
Test build #136477 has started for PR 31936 at commit |
Only test failure from the last run was |
Kubernetes integration test starting |
Kubernetes integration test status failure |
overall looks good. Just to clarify did you test this on both a Hadoop < 2.9 and > 2.9 version? It sounds like you probably did but double checking. |
I went through the logs for the most recent test failure and couldn't find any test failures:
(I had to download the logs since they were too big for the GitHub web viewer). Not sure what's wrong but this same suite passed on my previous build with only documentation changes since then (the previous failure was in a different module).
@tgravescs -- I think I did test on a Hadoop 2.7 cluster previously, but just to be sure, I tried just now. Works great using a custom shuffle service name and conf overlay via |
thanks, rekicking the build. |
Okay so the tests are still passing just fine from the module that is reporting as failed:
But I did notice that there are compilation errors:
(these are about 100 of these) But none of them are related to my changes. I'm pretty confused about why they're showing up here, do you have any insight? |
I'm not sure why they are failing but I think its these:
|
…side and allow for classpath-based config override on server side
…meConfigSuite into a separate class. Fix new test in YarnShuffleServiceSuite when run with other tests in the suite.
0427a2f
to
ef88052
Compare
Thanks for the pointer @tgravescs ! Looks like a new build was triggered (but not yet run) and I can't find a way to get the old logs so I can't check in more detail why those ones failed. I tried to reproduce those failures locally after a rebase and haven't been able to. I'm going to push again with the new rebase and see if picking up recent changes from |
Test build #136669 has finished for PR 31936 at commit
|
The GitHub Actions checks have been queued all day with no progress -- so can't confirm if those are working -- but from the SparkPullRequestBuilder output, the TPCDS tests are succeeding:
|
Kubernetes integration test starting |
Kubernetes integration test status failure |
test this please |
Kubernetes integration test starting |
Test build #136670 has finished for PR 31936 at commit
|
Looks like it is clean now 🎉 |
merged to master, thanks @xkrogen |
Fantastic, many thanks @tgravescs ! |
Thank you, @xkrogen and @tgravescs ! |
What changes were proposed in this pull request?
Add a new config,
spark.shuffle.service.name
, which allows for Spark applications to look for a YARN shuffle service which is defined at a name other than the defaultspark_shuffle
.Add a new config,
spark.yarn.shuffle.service.metrics.namespace
, which allows for configuring the namespace used when emitting metrics from the shuffle service into the NodeManager'smetrics2
system.Add a new mechanism by which to override shuffle service configurations independently of the configurations in the NodeManager. When a resource
spark-shuffle-site.xml
is present on the classpath of the shuffle service, the configs present within it will be used to override the configs coming fromyarn-site.xml
(via the NodeManager).Why are the changes needed?
There are two use cases which can benefit from these changes.
One use case is to run multiple instances of the shuffle service side-by-side in the same NodeManager. This can be helpful, for example, when running a YARN cluster with a mixed workload of applications running multiple Spark versions, since a given version of the shuffle service is not always compatible with other versions of Spark (e.g. see SPARK-27780). With this PR, it is possible to run two shuffle services like
spark_shuffle
andspark_shuffle_3.2.0
, one of which is "legacy" and one of which is for new applications. This is possible because YARN versions since 2.9.0 support the ability to run shuffle services within an isolated classloader (see YARN-4577), meaning multiple Spark versions can coexist.Besides this, the separation of shuffle service configs into
spark-shuffle-site.xml
can be useful for administrators who want to change and/or deploy Spark shuffle service configurations independently of the configurations for the NodeManager (e.g., perhaps they are owned by two different teams).Does this PR introduce any user-facing change?
Yes. There are two new configurations related to the external shuffle service, and a new mechanism which can optionally be used to configure the shuffle service.
docs/running-on-yarn.md
has been updated to provide user instructions; please see this guide for more details.How was this patch tested?
In addition to the new unit tests added, I have deployed this to a live YARN cluster and successfully deployed two Spark shuffle services simultaneously, one running a modified version of Spark 2.3.0 (which supports some of the newer shuffle protocols) and one running Spark 3.1.1. Spark applications of both versions are able to communicate with their respective shuffle services without issue.