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 2022/03/02 13:27:23 UTC

[GitHub] [spark] martin-g commented on a change in pull request #35640: [WIP][SPARK-38187][K8S] Support resource reservation with volcano implementations

martin-g commented on a change in pull request #35640:
URL: https://github.com/apache/spark/pull/35640#discussion_r817686949



##########
File path: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/VolcanoFeatureStepSuite.scala
##########
@@ -48,6 +48,18 @@ class VolcanoFeatureStepSuite extends SparkFunSuite {
     assert(podGroup.getSpec.getQueue === "queue1")
   }
 
+  test("SPARK-38187: Support `spark.kubernetes.job.minCPU/minMemory`") {

Review comment:
       `volcanoTag` would be useful!

##########
File path: resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/VolcanoTestsSuite.scala
##########
@@ -151,6 +157,54 @@ private[spark] trait VolcanoTestsSuite { k8sSuite: KubernetesSuite =>
     )
   }
 
+  test("SPARK-38187: Run SparkPi Jobs with minCPU", k8sTestTag, volcanoTag) {
+    // Create a queue with 2 CPU, 3G memory capacity
+    createOrReplaceYAMLResource(VOLCANO_RES_LIMIT_QUEUE_YAML)
+    val jobNum = 4
+    (1 to jobNum).map { i =>
+      Future {
+        runJobAndVerify(
+          i.toString,
+          groupLoc = Option(GROUP_PREFIX),
+          queue = Option("queue-limit-resource"),
+          minCPU = Option("2"))
+      }
+    }
+    Eventually.eventually(TIMEOUT, INTERVAL) {
+      // Only 1 job running or all Succeeded
+      val pendingPods = getPods(role = "driver", GROUP_PREFIX, statusPhase = "Running")
+      assert(pendingPods.size <= 1)
+      // All jobs succeeded finally
+      val succeededPods = getPods(role = "driver", GROUP_PREFIX, statusPhase = "Succeeded")
+      assert(succeededPods.size === jobNum)
+    }
+    deleteYAMLResource(VOLCANO_RES_LIMIT_QUEUE_YAML)

Review comment:
       The deletion of the resources should be in `finally` or `after()` method.
   Currently if a test fails the resources are not removed.




-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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