Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Commit

Permalink
Merge branch 'branch-2.1-kubernetes' of https://github.com/apache-spa…
Browse files Browse the repository at this point in the history
…rk-on-k8s/spark into pyspark-integration
  • Loading branch information
ifilonenko committed Jun 29, 2017
2 parents 0388aa4 + 6f6cfd6 commit 6acab03
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private[spark] class KubernetesClusterSchedulerBackend(
MEMORY_OVERHEAD_MIN))
private val executorMemoryWithOverhead = executorMemoryMb + memoryOverheadMb

private val executorCores = conf.getOption("spark.executor.cores").getOrElse("1")
private val executorCores = conf.getDouble("spark.executor.cores", 1d)
private val executorLimitCores = conf.getOption(KUBERNETES_EXECUTOR_LIMIT_CORES.key)

private implicit val requestExecutorContext = ExecutionContext.fromExecutorService(
Expand Down Expand Up @@ -377,7 +377,7 @@ private[spark] class KubernetesClusterSchedulerBackend(
.withAmount(s"${executorMemoryWithOverhead}M")
.build()
val executorCpuQuantity = new QuantityBuilder(false)
.withAmount(executorCores)
.withAmount(executorCores.toString)
.build()
val executorExtraClasspathEnv = executorExtraClasspath.map { cp =>
new EnvVarBuilder()
Expand All @@ -388,7 +388,8 @@ private[spark] class KubernetesClusterSchedulerBackend(
val requiredEnv = Seq(
(ENV_EXECUTOR_PORT, executorPort.toString),
(ENV_DRIVER_URL, driverUrl),
(ENV_EXECUTOR_CORES, executorCores),
// Executor backend expects integral value for executor cores, so round it up to an int.
(ENV_EXECUTOR_CORES, math.ceil(executorCores).toInt.toString),
(ENV_EXECUTOR_MEMORY, executorMemoryString),
(ENV_APPLICATION_ID, applicationId()),
(ENV_EXECUTOR_ID, executorId),
Expand Down

0 comments on commit 6acab03

Please sign in to comment.