You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/05/17 19:09:00 UTC

[GitHub] [spark] arunmahadevan commented on a change in pull request #24630: [SPARK-27754][K8S] Introduce additional config (spark.kubernetes.driver.request.cores) for driver request cores for spark on k8s

arunmahadevan commented on a change in pull request #24630: [SPARK-27754][K8S] Introduce additional config (spark.kubernetes.driver.request.cores) for driver request cores for spark on k8s
URL: https://github.com/apache/spark/pull/24630#discussion_r285254234
 
 

 ##########
 File path: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/BasicDriverFeatureStepSuite.scala
 ##########
 @@ -117,6 +117,33 @@ class BasicDriverFeatureStepSuite extends SparkFunSuite {
     assert(featureStep.getAdditionalPodSystemProperties() === expectedSparkConf)
   }
 
+  test("Check driver pod respects kubernetes driver request cores") {
+    val sparkConf = new SparkConf()
+      .set(KUBERNETES_DRIVER_POD_NAME, "spark-driver-pod")
+      .set(CONTAINER_IMAGE, "spark-driver:latest")
+
+    val basePod = SparkPod.initialPod()
+    val requests1 = new BasicDriverFeatureStep(KubernetesTestConf.createDriverConf(sparkConf))
+      .configurePod(basePod)
+      .container.getResources
+      .getRequests.asScala
+    assert(requests1("cpu").getAmount === "1")
 
 Review comment:
   @dongjoon-hyun , the logic in BasicDriverFeatureStep
   `private val driverCpuCores = conf.get(DRIVER_CORES.key, "1")`
   , sets the value of `driverCpuCores` to "1" if `spark.driver.cores` is not set in the spark conf. i.e. we don't use the `DRIVER_CORES.defaultValue` there. Let me know if my understanding is correct. 
   If so I cannot do something like `assert(requests1("cpu").getAmount === DRIVER_CORES.defaultValue)` here (assume this is what you are suggesting).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org