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 2019/02/04 12:57:52 UTC

[GitHub] skonto commented on a change in pull request #23546: [SPARK-23153][K8s] Support client dependencies with a Hadoop Compatible File System

skonto commented on a change in pull request #23546: [SPARK-23153][K8s] Support client dependencies with a Hadoop Compatible File System
URL: https://github.com/apache/spark/pull/23546#discussion_r247881175
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
 ##########
 @@ -373,6 +407,49 @@ private[spark] class SparkSubmit extends Logging {
       localPyFiles = Option(args.pyFiles).map {
         downloadFileList(_, targetDir, sparkConf, hadoopConf, secMgr)
       }.orNull
+
+      if (isKubernetesClient &&
+        sparkConf.getBoolean("spark.kubernetes.submitInDriver", false)) {
+        // Replace with the downloaded local jar path to avoid propagating hadoop compatible uris.
+        // Executors will get the jars from the Spark file server.
+        if (args.jars != null && localJars != null) {
+          args.jars = Utils.stringToSeq(args.jars).map {
+            jar => val jarUri = new URI(jar)
+              val path1 = {
+                val p1 = jarUri.getPath
+                p1.substring(p1.lastIndexOf('/') + 1)
+              }
+              Utils.stringToSeq(localJars).find{localUri =>
+                val path2 = {
+                  val p2 = new URI(localUri).getPath
+                  p2.substring(p2.lastIndexOf('/') + 1)
+                }
+                path1 == path2
+              }.getOrElse(jar)
+          }.mkString(",")
+        }
+
+        val localFiles = Option(args.files).map {
+          downloadFileList(_, targetDir, sparkConf, hadoopConf, secMgr)
+        }.orNull
+
+        if (args.files != null && localFiles != null) {
+          args.files = Utils.stringToSeq(args.files).map {
+            file => val fileUri = new URI(file)
+              val path1 = {
+                val p1 = fileUri.getPath
+                p1.substring(p1.lastIndexOf('/') + 1)
+              }
+              Utils.stringToSeq(localFiles).find{localUri =>
+                val path2 = {
+                  val p2 = new URI(localUri).getPath
+                  p2.substring(p2.lastIndexOf('/') + 1)
+                }
+                path1 == path2
+              }.getOrElse(file)
+          }.mkString(",")
 
 Review comment:
   TODO: make this more compact.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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