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

    https://github.com/apache/spark/pull/18630#discussion_r130908694
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala ---
    @@ -1315,6 +1294,80 @@ private[spark] object SparkSubmitUtils {
     
     }
     
    +private [deploy] object DependencyUtils {
    +  def resolveMavenDepndencies(args: Option[SparkSubmitArguments] = None): 
String = {
    +
    +   val (packagesExclusions, packages, repositories, ivyRepoPath) =
    +     args.map { x => (x.packagesExclusions, x.packages, x.repositories, 
x.ivyRepoPath) }
    +       .orElse {
    +         val props = sys.props
    +         Some((props.get("spark.jars.excludes").orNull, 
props.get("spark.jars.packages").orNull,
    +           props.get("spark.jars.repositories").orNull, 
props.get("spark.jars.ivy").orNull))
    +       }.get
    +
    +    val exclusions: Seq[String] =
    +      if (!StringUtils.isBlank(packagesExclusions)) {
    +        packagesExclusions.split(",")
    +      } else {
    +        Nil
    +      }
    +    // Create the IvySettings, either load from file or build defaults
    +    val ivySettings = sys.props.get("spark.jars.ivySettings").map { 
ivySettingsFile =>
    +      SparkSubmitUtils.loadIvySettings(ivySettingsFile, 
Option(repositories),
    +        Option(ivyRepoPath))
    +    }.getOrElse {
    +      SparkSubmitUtils.buildIvySettings(Option(repositories), 
Option(ivyRepoPath))
    +    }
    +
    +    val resolvedMavenCoordinates = 
SparkSubmitUtils.resolveMavenCoordinates(
    +      packages, ivySettings, exclusions = exclusions)
    +
    +    resolvedMavenCoordinates
    +  }
    +
    +  def createTempDir(): File = {
    +    val targetDir = Files.createTempDirectory("tmp").toFile
    +    // scalastyle:off runtimeaddshutdownhook
    +    Runtime.getRuntime.addShutdownHook(new Thread() {
    +      override def run(): Unit = {
    +        FileUtils.deleteQuietly(targetDir)
    +      }
    +    })
    +    targetDir
    +  }
    +
    +  def resolveAndDownloadJars(jarList: String, userJar: String): String = {
    +    val targetDir = DependencyUtils.createTempDir()
    +    val hadoopConf = new HadoopConfiguration()
    +    val sparkProperties = new HashMap[String, String]()
    +    val securityProperties = List("spark.ssl.fs.trustStore", 
"spark.ssl.trustStore",
    +      "spark.ssl.fs.trustStorePassword", "spark.ssl.trustStorePassword",
    +      "spark.ssl.fs.protocol", "spark.ssl.protocol")
    +    var jars = jarList
    +
    +    securityProperties
    --- End diff --
    
    Yes correct.


---
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.
---

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

Reply via email to