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

    https://github.com/apache/spark/pull/969#discussion_r13712776
  
    --- Diff: 
yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala ---
    @@ -220,10 +220,21 @@ trait ClientBase extends Logging {
           }
         }
     
    +    def getArg(arg: String, envVar: String, sysProp: String): String = {
    +      if (arg != null && !arg.isEmpty) {
    +        arg
    +      } else if (System.getenv(envVar) != null && 
!System.getenv(envVar).isEmpty) {
    +        System.getenv(envVar)
    +      } else {
    +        sparkConf.getOption(sysProp).orNull
    +      }
    +    }
         var cachedSecondaryJarLinks = ListBuffer.empty[String]
    -    val fileLists = List( (args.addJars, LocalResourceType.FILE, true),
    -      (args.files, LocalResourceType.FILE, false),
    -      (args.archives, LocalResourceType.ARCHIVE, false) )
    +    val fileLists = List((args.addJars, LocalResourceType.FILE, true),
    +      (getArg(args.files, "SPARK_YARN_DIST_FILES", 
"spark.yarn.dist.files"),
    +        LocalResourceType.FILE, false),
    +      (getArg(args.archives, "SPARK_YARN_DIST_ARCHIVES", 
"spark.yarn.dist.archives"),
    --- End diff --
    
    Did you see the other PR I mentioned (see 
https://github.com/apache/spark/pull/969#issuecomment-45805466)?
    
    There's a bug in the Yarn code where configuration is not propagated 
correctly in cluster mode, which I fixed there. So you don't need this here 
because with my fix, these options should be correctly propagated without any 
extra code.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to