Skip to content

Commit ad8c1f0

Browse files
tnachenAndrew Or
authored andcommitted
[SPARK-12345][MESOS] Filter SPARK_HOME when submitting Spark jobs with Mesos cluster mode.
SPARK_HOME is now causing problem with Mesos cluster mode since spark-submit script has been changed recently to take precendence when running spark-class scripts to look in SPARK_HOME if it's defined. We should skip passing SPARK_HOME from the Spark client in cluster mode with Mesos, since Mesos shouldn't use this configuration but should use spark.executor.home instead. Author: Timothy Chen <[email protected]> Closes apache#10332 from tnachen/scheduler_ui.
1 parent 26d70bd commit ad8c1f0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

core/src/main/scala/org/apache/spark/deploy/rest/mesos/MesosRestServer.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ private[mesos] class MesosSubmitRequestServlet(
9494
val driverMemory = sparkProperties.get("spark.driver.memory")
9595
val driverCores = sparkProperties.get("spark.driver.cores")
9696
val appArgs = request.appArgs
97-
val environmentVariables = request.environmentVariables
97+
// We don't want to pass down SPARK_HOME when launching Spark apps
98+
// with Mesos cluster mode since it's populated by default on the client and it will
99+
// cause spark-submit script to look for files in SPARK_HOME instead.
100+
// We only need the ability to specify where to find spark-submit script
101+
// which user can user spark.executor.home or spark.home configurations.
102+
val environmentVariables = request.environmentVariables.filter(!_.equals("SPARK_HOME"))
98103
val name = request.sparkProperties.get("spark.app.name").getOrElse(mainClass)
99104

100105
// Construct driver description

core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import org.apache.spark.util.Utils
3434

3535
/**
3636
* Shared trait for implementing a Mesos Scheduler. This holds common state and helper
37-
* methods and Mesos scheduler will use.
37+
* methods the Mesos scheduler will use.
3838
*/
3939
private[mesos] trait MesosSchedulerUtils extends Logging {
4040
// Lock used to wait for scheduler to be registered

0 commit comments

Comments
 (0)