You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "EnricoMi (via GitHub)" <gi...@apache.org> on 2024/12/02 14:19:02 UTC

Re: [PR] [SPARK-47573][K8S] Support custom driver log url [spark]

EnricoMi commented on code in PR #45728:
URL: https://github.com/apache/spark/pull/45728#discussion_r1865932182


##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicDriverFeatureStep.scala:
##########
@@ -82,8 +82,15 @@ private[spark] class BasicDriverFeatureStep(conf: KubernetesDriverConf)
   private val driverMemoryWithOverheadMiB = driverMemoryMiB + memoryOverheadMiB
 
   override def configurePod(pod: SparkPod): SparkPod = {
+    val driverAttributes = conf.get(UI.CUSTOM_DRIVER_LOG_URL).map { _ =>
+      Map(
+        ENV_DRIVER_ATTRIBUTE_APP_ID -> conf.appId,
+        ENV_DRIVER_ATTRIBUTE_KUBERNETES_NAMESPACE -> conf.get(KUBERNETES_NAMESPACE),
+        ENV_DRIVER_ATTRIBUTE_KUBERNETES_POD_NAME -> driverPodName
+      )
+    }.getOrElse(Map.empty[String, String])
     val driverCustomEnvs = KubernetesUtils.buildEnvVars(
-      Seq(ENV_APPLICATION_ID -> conf.appId) ++ conf.environment)
+      Seq(ENV_APPLICATION_ID -> conf.appId) ++ conf.environment ++ driverAttributes)

Review Comment:
   This is the same pattern as in https://github.com/apache/spark/blob/584b6dbfc99f466f32d5e3341ee19f129fae1090/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala#L146-L173



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