Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix a bug that RRunner does not handle client deployment modes.
  • Loading branch information
Sun Rui committed Jul 13, 2015
commit 681afb044573d3204f3122cb6eeeda7f3d938215
12 changes: 9 additions & 3 deletions core/src/main/scala/org/apache/spark/deploy/RRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,15 @@ object RRunner {
val builder = new ProcessBuilder(Seq(rCommand, rFileNormalized) ++ otherArgs)
val env = builder.environment()
env.put("EXISTING_SPARKR_BACKEND_PORT", sparkRBackendPort.toString)
// The SparkR package distributed as an archive resource should be pointed to
// by a symbol link "sparkr" in the current directory.
val rPackageDir = new File("sparkr").getAbsolutePath
val rPackageDir =
if (System.getProperty("spark.master") == "yarn-cluster") {
// The SparkR package distributed as an archive resource should be pointed to
// by a symbol link "sparkr" in the current directory.
new File("sparkr").getAbsolutePath
} else {
val sparkHome = System.getenv("SPARK_HOME")
Seq(sparkHome, "R", "lib").mkString(File.separator)
}
env.put("SPARKR_PACKAGE_DIR", rPackageDir)
env.put("R_PROFILE_USER",
Seq(rPackageDir, "SparkR", "profile", "general.R").mkString(File.separator))
Expand Down