ruanwenjun commented on code in PR #53307:
URL: https://github.com/apache/spark/pull/53307#discussion_r2610313398


##########
resource-managers/kubernetes/core/volcano/src/main/scala/org/apache/spark/deploy/k8s/features/VolcanoFeatureStep.scala:
##########
@@ -59,9 +65,36 @@ private[spark] class VolcanoFeatureStep extends 
KubernetesDriverCustomFeatureCon
     if (spec == null) spec = new PodGroupSpec
     pg.setSpec(spec)
 
+    logDebug(s"Volcano PodGroup configuration: $pg")
     Seq(pg)
   }
 
+  private def getPodGroupConfigByTemplateFile(
+      volcanoClient: DefaultVolcanoClient): Option[PodGroup] = {
+    kubernetesConf.getOption(POD_GROUP_TEMPLATE_FILE_KEY).map { templateFile =>
+      logDebug("Loading Volcano PodGroup configuration from template file")
+      volcanoClient.podGroups.load(templateFile).item
+    }
+  }
+
+  private def getPodGroupByTemplateJson(volcanoClient: DefaultVolcanoClient): 
Option[PodGroup] = {
+    kubernetesConf.getOption(POD_GROUP_TEMPLATE_JSON_KEY).map { templateJson =>
+      logDebug("Loading Volcano PodGroup configuration from template json")
+      try {
+        val templateYaml = new ObjectMapper()
+          .writerWithDefaultPrettyPrinter()
+          .writeValueAsString(new ObjectMapper(new 
YAMLFactory()).readTree(templateJson))
+        volcanoClient
+          .podGroups()
+          .load(new ByteArrayInputStream(templateYaml.getBytes()))
+          .item()
+      } catch {
+        case e: Exception =>

Review Comment:
   I remove the catch here, do not check the json schema here, keep the logic 
same with load `podGroupTemplateFile`.



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

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to