tgravescs commented on a change in pull request #24703: [SPARK-27362][K8S]  
Resource Scheduling support for k8s
URL: https://github.com/apache/spark/pull/24703#discussion_r288767931
 
 

 ##########
 File path: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesUtils.scala
 ##########
 @@ -216,6 +217,32 @@ private[spark] object KubernetesUtils extends Logging {
     Hex.encodeHexString(random) + time
   }
 
+  /**
+   * This function builds the Quantity objects for each resource in the Spark 
resource
+   * configs based on the component name(spark.driver.resource or 
spark.executor.resource).
+   * It assumes we can use the Kubernetes device plugin format: 
vendor-domain/resource.
+   * It returns a set with a tuple of vendor-domain/resource and Quantity for 
each resource.
+   */
+  def buildResourcesQuantities(
+      componentName: String,
+      sparkConf: SparkConf): Set[(String, Quantity)] = {
+    val allResources = sparkConf.getAllWithPrefix(componentName)
 
 Review comment:
   As the javadoc on the function says "component name(spark.driver.resource or 
spark.executor.resource)."
   this fucntion is called from both the driver and the executor feature steps. 
one passes SPARK_DRIVER_RESOURCE_PREFIX and one passes 
SPARK_EXECUTOR_RESOURCE_PREFIX
   
   Also note we have another jira to abstract some of the resource configs to 
make it more readable - SPARK-27823
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to