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_r288709084
 
 

 ##########
 File path: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesConf.scala
 ##########
 @@ -199,4 +199,13 @@ private[spark] object KubernetesConf {
       .replaceAll("[^a-z0-9\\-]", "")
       .replaceAll("-+", "-")
   }
+
+  /**
+   * Build a resources name based on the vendor device plugin naming
+   * convention of: vendor-domain/resource. For example, an Nvidia GPU is
+   * advertised as nvidia.com/gpu.
+   */
+  def buildKubernetesResourceName(vendor: String, resourceName: String): 
String = {
+    s"${vendor}/${resourceName}"
 
 Review comment:
   sorry maybe I'm missing it but that doc says:
   
    limits:
             nvidia.com/gpu: 1 # requesting 1 GPU
   
   nvidia is vendor, .com is domain, resource is gpus.
   
   This PR is trying to handle any generic resource type not just GPUs so the 
vendor has to have both vendor and domain.  Otherwise we would have to put 
something in that say for gpu's use .com for domain.
   
   Again I'm just going by 
https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/,
 maybe domain is always .com?  
   

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