-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29330][CORE][YARN] Allow users to chose the name of Spark Shuffle service #26000
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
Changes from all commits
786f24a
30f8c1d
27e5c87
60795d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,8 +136,18 @@ public class YarnShuffleService extends AuxiliaryService { | |
| private DB db; | ||
|
|
||
| public YarnShuffleService() { | ||
| super("spark_shuffle"); | ||
| logger.info("Initializing YARN shuffle service for Spark"); | ||
| this("spark_shuffle"); | ||
| } | ||
|
|
||
| /** | ||
| * Instantiate YarnShuffleService with arbitrary service name. | ||
| * Used for tests. | ||
| * YARN doesn't pass service name or any parameters to AuxiliaryServices. | ||
| * When instantiated by YARN, constructor without arguments would be called. | ||
| */ | ||
| protected YarnShuffleService(String serviceName) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the name by itself isn't going to be enough. If you really want it configurable we are going to have to have the port configurable. For instance the config name for the port spark.shuffle.service.port needs to be able to be something like spark.shuffle.service.{serviceName}.port. Otherwise all the spark shuffle servers will try to get the same port and fail. The only other option will be to use 0 for ephemeral but
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The name specified here is actually useful only in tests. YARN's service instantiation logic wouldn't even pass the name of the service used in the config to instantiated service. I guess that's the main reason the names and ports are hardcoded or bound to non-namespaced configuration keys. I will add a comment here stating that the name is actually only used for the tests, but otherwise would always be hardcoded to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there are a few things getting muddled together here -- one is how you'd support running two shuffle services, and the other is how a client could choose which shuffle service it talks to. The client can already set the port for the shuffle server with The other thing to add about how the names of the shuffle servers matter in yarn is that the name goes into |
||
| super(serviceName); | ||
| logger.info("Initializing YARN shuffle service \"{}\" for Spark", serviceName); | ||
| instance = this; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -492,6 +492,14 @@ To use a custom metrics.properties for the application master and executors, upd | |
| If it is not set then the YARN application ID is used. | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>spark.yarn.shuffle.service.name</code></td> | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this option under Spark Properties section and not under Configuring the External Shuffle Service section because it's a "client" setting, not the setting of the external shuffle service. |
||
| <td><code>spark_shuffle</code></td> | ||
| <td> | ||
| The name of the external shuffle service. | ||
| The external shuffle service itself is configured and started by YARN (see [Configuring the External Shuffle Service](#configuring-the-external-shuffle-service) for details). The name specified here must match the name used in YARN service implementation. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would help to mention that must match the name given to the shuffle service in |
||
| </td> | ||
| </tr> | ||
| </table> | ||
|
|
||
| #### Available patterns for SHS custom executor log URL | ||
|
|
||
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.
Is this still hardcoded? Should we use configured SHUFFLE_SERVICE_NAME?
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 is still hardcoded. I haven't found a way to access Spark configuration from that constructor and
org.apache.hadoop.yarn.server.api.AuxiliaryServicerequires the name. Do you have a suggestion of how that could be done?Uh oh!
There was an error while loading. Please reload this page.
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.
As I commented below #26000 (comment), if this is just for yarn, put it in YarnShuffleService, like "spark.yarn.shuffle.stopOnFailure"?
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 is hardcoded here. Once the shuffle service name is configured, won't they mismatch? Will it cause problem?
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 is hardcoded here. HDP hardcodes another value though (
spark2_shuffle). While vanilla Spark would keep working as is and would use the namespark_shuffle, the new configuration option would allow users to point Spark to non-vanilla shuffle service.The changes to that class are done only to test that changing the name of the service and in the configuration play nicely together.
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 seems impossible to register the service with the name passed in the configuration because the configuration is passed after the class is instantiated.
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 see. So this config can only be used to let Spark choose which service to connect. It cannot change the name of 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.
Yes. I guess I could implement a workaround, which would get the config setting from the default
Configuration, but that, at least theoretically, wouldn't guarantee that the exact configuration would be passed during service initialization.