-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-6797][SPARKR] Add support for YARN cluster mode. #6743
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
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
cedfbe2
[SPARK-6797][SPARKR] Add support for YARN cluster mode.
681afb0
Fix a bug that RRunner does not handle client deployment modes.
3bed438
Add a comment.
7b916c5
Use 'rem' consistently.
49ff948
Invoke jar.exe with full path in install-dev.bat.
41d4f17
Add support for locating SparkR package for R workers required by RDD…
0aa1e97
Fix scala style.
1acefd1
Fix scala style.
2ca5048
Fix comments.
b05340c
Fix scala style.
c38a005
Unzipped SparkR binary package is still required for standalone and M…
35ecfa3
Fix comments.
fe25a33
Fix Mima test error.
193882f
Fix Mima test error.
72695fb
Fix unit test failures.
7313374
Fix unit test errors.
ca63c86
Adjust MimaExcludes after rebase.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,4 +32,3 @@ Collate: | |
| 'serialize.R' | ||
| 'sparkR.R' | ||
| 'utils.R' | ||
| 'zzz.R' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.spark.api.r | ||
|
|
||
| import java.io.File | ||
|
|
||
| import org.apache.spark.{SparkEnv, SparkException} | ||
|
|
||
| private[spark] object RUtils { | ||
| /** | ||
| * Get the SparkR package path in the local spark distribution. | ||
| */ | ||
| def localSparkRPackagePath: Option[String] = { | ||
| val sparkHome = sys.env.get("SPARK_HOME") | ||
| sparkHome.map( | ||
| Seq(_, "R", "lib").mkString(File.separator) | ||
| ) | ||
| } | ||
|
|
||
| /** | ||
| * Get the SparkR package path in various deployment modes. | ||
| * This assumes that Spark properties `spark.master` and `spark.submit.deployMode` | ||
| * and environment variable `SPARK_HOME` are set. | ||
| */ | ||
| def sparkRPackagePath(isDriver: Boolean): String = { | ||
| val (master, deployMode) = | ||
| if (isDriver) { | ||
| (sys.props("spark.master"), sys.props("spark.submit.deployMode")) | ||
| } else { | ||
| val sparkConf = SparkEnv.get.conf | ||
| (sparkConf.get("spark.master"), sparkConf.get("spark.submit.deployMode")) | ||
| } | ||
|
|
||
| val isYarnCluster = master.contains("yarn") && deployMode == "cluster" | ||
| val isYarnClient = master.contains("yarn") && deployMode == "client" | ||
|
|
||
| // In YARN mode, the SparkR package is distributed as an archive symbolically | ||
| // linked to the "sparkr" file in the current directory. Note that this does not apply | ||
| // to the driver in client mode because it is run outside of the cluster. | ||
| if (isYarnCluster || (isYarnClient && !isDriver)) { | ||
| new File("sparkr").getAbsolutePath | ||
| } else { | ||
| // Otherwise, assume the package is local | ||
| // TODO: support this for Mesos | ||
| localSparkRPackagePath.getOrElse { | ||
| throw new SparkException("SPARK_HOME not set. Can't locate SparkR package.") | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
github won't let me comment down there, but in L388 of this file we should add the deploy mode to a system property:
This is needed for
RUtils.sparkRPackagePath, so we don't try to parse the deploy mode fromspark.master.