-
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
Changes from 1 commit
cedfbe2
681afb0
3bed438
7b916c5
49ff948
41d4f17
0aa1e97
1acefd1
2ca5048
b05340c
c38a005
35ecfa3
fe25a33
193882f
72695fb
7313374
ca63c86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,3 +25,8 @@ set SPARK_HOME=%~dp0.. | |
| MKDIR %SPARK_HOME%\R\lib | ||
|
|
||
| R.exe CMD INSTALL --library="%SPARK_HOME%\R\lib" %SPARK_HOME%\R\pkg\ | ||
|
|
||
| REM Zip the SparkR package so that it can be distributed to worker nodes on YARN | ||
| pushd %SPARK_HOME%\R\lib | ||
| jar cfM "%SPARK_HOME%\R\lib\sparkr.zip" SparkR | ||
|
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. @sun-rui -- this should be
[1] http://cran.r-project.org/bin/windows/Rtools/ |
||
| popd | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,7 @@ object SparkSubmit { | |
| private val SPARK_SHELL = "spark-shell" | ||
| private val PYSPARK_SHELL = "pyspark-shell" | ||
| private val SPARKR_SHELL = "sparkr-shell" | ||
| private val SPARKR_PACKAGE_ARCHIVE = "sparkr.zip" | ||
|
|
||
| private val CLASS_NOT_FOUND_EXIT_STATUS = 101 | ||
|
|
||
|
|
@@ -347,6 +348,22 @@ object SparkSubmit { | |
| } | ||
| } | ||
|
|
||
| // In yarn mode for an R app, add the SparkR package archive to archives | ||
|
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. nit: elsewhere we use capital YARN. Here and L349 and L353.
Contributor
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. done |
||
| // that can be distributed with the job | ||
| if (args.isR && clusterManager == YARN) { | ||
| val sparkHome = sys.env.get("SPARK_HOME") | ||
| if (sparkHome.isEmpty) { | ||
| printErrorAndExit("SPARK_HOME does not exist for R application in yarn mode.") | ||
| } | ||
| val rPackagePath = Seq(sparkHome.get, "R", "lib").mkString(File.separator) | ||
|
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. Is there a way to make this also go through
Contributor
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. fixed. |
||
| val rPackageFile = new File(rPackagePath, SPARKR_PACKAGE_ARCHIVE) | ||
| if (!rPackageFile.exists()) { | ||
| printErrorAndExit(s"$SPARKR_PACKAGE_ARCHIVE does not exist for R application in yarn mode.") | ||
| } | ||
| val localURI = Utils.resolveURI(rPackageFile.getAbsolutePath) | ||
| args.archives = mergeFileLists(args.archives, localURI.toString + "#sparkr") | ||
|
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. Could you add a comment here as to why we have this '#sparkr" ? I believe this is to get the archive to unzip to a symlink named |
||
| } | ||
|
|
||
| // If we're running a R app, set the main class to our specific R runner | ||
| if (args.isR && deployMode == CLIENT) { | ||
| if (args.primaryResource == SPARKR_SHELL) { | ||
|
|
||
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.
Lets use
reminstead ofREMto be consistent with the rest of the file