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 2020/02/26 02:10:29 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #27215: [SPARK-30514][K8S] add python environment support for JavaMainAppResource

dongjoon-hyun commented on a change in pull request #27215: [SPARK-30514][K8S] add python environment support for JavaMainAppResource
URL: https://github.com/apache/spark/pull/27215#discussion_r384239219
 
 

 ##########
 File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala
 ##########
 @@ -62,7 +62,18 @@ private[spark] class DriverCommandFeatureStep(conf: KubernetesDriverConf)
   }
 
   private def configureForJava(pod: SparkPod, res: String): SparkPod = {
-    val driverContainer = baseDriverContainer(pod, res).build()
+    val javaEnvs = if (conf.get(IS_PYTHON_APP)) {
+      Seq(new EnvVarBuilder()
+        .withName(ENV_PYSPARK_MAJOR_PYTHON_VERSION)
+        .withValue(conf.get(PYSPARK_MAJOR_PYTHON_VERSION))
+        .build())
+    } else {
+      Seq[EnvVar]()
+    }
+
+    val driverContainer = baseDriverContainer(pod, res)
+      .addAllToEnv(javaEnvs.asJava)
+      .build()
 
 Review comment:
   Hi, @stczwd . This PR duplicates the code here and in `configureForPython`. Instead, can we refactor this duplicated logic into a common function?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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