Skip to content

Commit baea28f

Browse files
committed
Filter SPARK_HOME when submitting Spark jobs with Mesos cluster mode.
1 parent 606f99b commit baea28f

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)