Github user jerryshao commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18962#discussion_r133905899
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala ---
    @@ -330,18 +330,45 @@ object SparkSubmit extends CommandLineUtils {
         args.archives = Option(args.archives).map(resolveGlobPaths(_, 
hadoopConf)).orNull
     
         // In client mode, download remote files.
    +    var localPrimaryResource: String = null
    +    var localJars: String = null
    +    var localPyFiles: String = null
         if (deployMode == CLIENT) {
    -      args.primaryResource = Option(args.primaryResource).map {
    +      localPrimaryResource = Option(args.primaryResource).map {
             downloadFile(_, targetDir, args.sparkProperties, hadoopConf)
           }.orNull
    -      args.jars = Option(args.jars).map {
    +      localJars = Option(args.jars).map {
             downloadFileList(_, targetDir, args.sparkProperties, hadoopConf)
           }.orNull
    -      args.pyFiles = Option(args.pyFiles).map {
    +      localPyFiles = Option(args.pyFiles).map {
             downloadFileList(_, targetDir, args.sparkProperties, hadoopConf)
           }.orNull
         }
     
    +    if (clusterManager == YARN) {
    +      def isNoneFsFileExist(paths: String): Boolean = {
    +        Option(paths).exists { p =>
    +          p.split(",").map(_.trim).filter(_.nonEmpty).exists { path =>
    +            val url = Utils.resolveURI(path)
    +            url.getScheme match {
    +              case "http" | "https" | "ftp" => true
    +              case _ => false
    +            }
    +          }
    +        }
    +      }
    +
    +      // Spark on YARN doesn't support upload remote resources from http, 
https or ftp server
    +      // directly to distributed cache, so print a warning and exit the 
process.
    +      if (isNoneFsFileExist(args.jars) ||
    --- End diff --
    
    @tgravescs I checked the code in NM 
[ContainerLocallizer](https://github.com/apache/hadoop/blob/99e558b13ba4d5832aea97374e1d07b4e78e5e39/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ContainerLocalizer.java#L245)
 and 
[FSDownload](https://github.com/apache/hadoop/blob/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/FSDownload.java#L250),
 If I understand correctly of YARN code, seems here it still tries to use 
Hadoop FileSystem to download resources, since scheme "http" is not support in 
current version of Hadoop, then I assume it will be failed here. Also how to 
create a `LocalResource` from remote resource in http(s) in also a question.
    
    ```java
        FileSystem sourceFs = sCopy.getFileSystem(conf);
        Path dCopy = new Path(dstdir, "tmp_"+sCopy.getName());
        FileStatus sStat = sourceFs.getFileStatus(sCopy);
        if (sStat.getModificationTime() != resource.getTimestamp()) {
          throw new IOException("Resource " + sCopy +
              " changed on src filesystem (expected " + resource.getTimestamp() 
+
              ", was " + sStat.getModificationTime());
        }
        if (resource.getVisibility() == LocalResourceVisibility.PUBLIC) {
          if (!isPublic(sourceFs, sCopy, sStat, statCache)) {
            throw new IOException("Resource " + sCopy +
                " is not publicly accessable and as such cannot be part of the" 
+
                " public cache.");
          }
        }
    
        FileUtil.copy(sourceFs, sStat, FileSystem.getLocal(conf), dCopy, false,
            true, conf);
        return dCopy;
    ```
    
    The link above mentioned about `DistributedCache` seems a MR only thing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to