Skip to content
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-1755] Respect SparkSubmit --name on YARN #699

Closed
wants to merge 3 commits into from

Conversation

andrewor14
Copy link
Contributor

Right now, SparkSubmit ignores the --name flag for both yarn-client and yarn-cluster. This is a bug.

In client mode, SparkSubmit treats --name as a cluster config and does not propagate this to SparkContext.

In cluster mode, SparkSubmit passes this flag to org.apache.spark.deploy.yarn.Client, which only uses it for the YARN ResourceManager, but does not propagate this to SparkContext.

This PR ensures that spark.app.name is always set if SparkSubmit receives the --name flag, which is what the usage promises. This makes it possible for applications to start a SparkContext with an empty conf val sc = new SparkContext(new SparkConf), and inherit the app name from SparkSubmit.

Tested both modes on a YARN cluster.

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

@vanzin
Copy link
Contributor

vanzin commented May 8, 2014

LGTM. My only concern (which I mentioned in pr #539) is that an app calling SparkConf.setAppName() will end up overriding this command line option, right?

That seems a little counter-intuitive to me (I'd expect the command line to take precedence), but not a big deal.

@AmplabJenkins
Copy link

Merged build finished.

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14817/

@andrewor14
Copy link
Contributor Author

I actually think an app name explicitly set by the application itself should take precedence. It's a little strange to write an application, specify a name, and possibly have it overridden somewhere else. Otherwise we could potentially give SparkPi an app name of WordCount, which is pretty confusing.

@AmplabJenkins
Copy link

Merged build finished.

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14818/

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

@AmplabJenkins
Copy link

Merged build finished. All automated tests passed.

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14821/

@pwendell
Copy link
Contributor

pwendell commented May 9, 2014

I've merged this thanks.

asfgit pushed a commit that referenced this pull request May 9, 2014
Right now, SparkSubmit ignores the `--name` flag for both yarn-client and yarn-cluster. This is a bug.

In client mode, SparkSubmit treats `--name` as a [cluster config](https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#L170) and does not propagate this to SparkContext.

In cluster mode, SparkSubmit passes this flag to `org.apache.spark.deploy.yarn.Client`, which only uses it for the [YARN ResourceManager](https://github.com/apache/spark/blob/master/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/Client.scala#L80), but does not propagate this to SparkContext.

This PR ensures that `spark.app.name` is always set if SparkSubmit receives the `--name` flag, which is what the usage promises. This makes it possible for applications to start a SparkContext with an empty conf `val sc = new SparkContext(new SparkConf)`, and inherit the app name from SparkSubmit.

Tested both modes on a YARN cluster.

Author: Andrew Or <[email protected]>

Closes #699 from andrewor14/yarn-app-name and squashes the following commits:

98f6a79 [Andrew Or] Fix tests
dea932f [Andrew Or] Merge branch 'master' of github.com:apache/spark into yarn-app-name
c86d9ca [Andrew Or] Respect SparkSubmit --name on YARN
(cherry picked from commit 8b78412)

Signed-off-by: Patrick Wendell <[email protected]>
@asfgit asfgit closed this in 8b78412 May 9, 2014
@andrewor14 andrewor14 deleted the yarn-app-name branch May 9, 2014 18:58
pdeyhim pushed a commit to pdeyhim/spark-1 that referenced this pull request Jun 25, 2014
Right now, SparkSubmit ignores the `--name` flag for both yarn-client and yarn-cluster. This is a bug.

In client mode, SparkSubmit treats `--name` as a [cluster config](https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#L170) and does not propagate this to SparkContext.

In cluster mode, SparkSubmit passes this flag to `org.apache.spark.deploy.yarn.Client`, which only uses it for the [YARN ResourceManager](https://github.com/apache/spark/blob/master/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/Client.scala#L80), but does not propagate this to SparkContext.

This PR ensures that `spark.app.name` is always set if SparkSubmit receives the `--name` flag, which is what the usage promises. This makes it possible for applications to start a SparkContext with an empty conf `val sc = new SparkContext(new SparkConf)`, and inherit the app name from SparkSubmit.

Tested both modes on a YARN cluster.

Author: Andrew Or <[email protected]>

Closes apache#699 from andrewor14/yarn-app-name and squashes the following commits:

98f6a79 [Andrew Or] Fix tests
dea932f [Andrew Or] Merge branch 'master' of github.com:apache/spark into yarn-app-name
c86d9ca [Andrew Or] Respect SparkSubmit --name on YARN
RolatZhang pushed a commit to RolatZhang/spark that referenced this pull request Dec 8, 2023
…pache#701)

* minor fix ut

* AL-8998 Fix resizing for ArrayBuffer in scala-2.12 (apache#691)

* AL-8998 Fix resizing for ArrayBuffer in scala-2.12

* KE-42864 Fix vulnerability, upgrade tomcat-embed-core.version version to 9.0.81 (apache#699)

---------

Co-authored-by: jiawei.li <[email protected]>
Co-authored-by: Zhimin Wu <[email protected]>
RolatZhang pushed a commit to RolatZhang/spark that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants