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_r279199130
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
 ##########
 @@ -318,9 +319,25 @@ private[spark] class SparkSubmit extends Logging {
         args.ivySettingsPath)
 
       if (!StringUtils.isBlank(resolvedMavenCoordinates)) {
-        args.jars = mergeFileLists(args.jars, resolvedMavenCoordinates)
-        if (args.isPython || isInternal(args.primaryResource)) {
-          args.pyFiles = mergeFileLists(args.pyFiles, resolvedMavenCoordinates)
+        // In K8s client mode, when in the driver, add resolved jars early as 
we might need
+        // them at the submit time. For example we might use the dependencies 
for downloading
+        // files from a Hadoop Compatible fs eg. S3. In this case the user 
might pass:
+        // --packages 
com.amazonaws:aws-java-sdk:1.7.4:org.apache.hadoop:hadoop-aws:2.7.6
+        if (isKubernetesClient &&
+          args.sparkProperties.getOrElse("spark.kubernetes.submitInDriver", 
"false").toBoolean) {
+          for (jar <- resolvedMavenCoordinates.split(",")) {
+            addJarToClasspath(jar, getSubmitClassLoader(sparkConf))
+          }
+        }
+        else if (isKubernetesCluster) {
 
 Review comment:
   @vanzin could you please clarify why it is wrong? Are you referring to this:
   
   ```
   else {
             args.jars = mergeFileLists(args.jars, resolvedMavenCoordinates)
             if (args.isPython || isInternal(args.primaryResource)) {
               args.pyFiles = mergeFileLists(args.pyFiles, 
resolvedMavenCoordinates)
             }
   }
   ```
   `Else` there covers all other cases like client mode at the launcher side 
for other resource managers as well.
   The logic in there is special for two cases for the K8s resource manager and 
I need to use `resolvedMavenCoordinates`.
   Do you mean move `else if` one line up?

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


With regards,
Apache Git Services

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

Reply via email to