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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]