shardulm94 commented on a change in pull request #31591:
URL: https://github.com/apache/spark/pull/31591#discussion_r600249173



##########
File path: 
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
##########
@@ -793,6 +793,25 @@ private[spark] class Client(
       // distributed file.
       amKeytabFileName.foreach { kt => props.setProperty(KEYTAB.key, kt) }
 
+      // Upload user provided ivysettings.xml file to the distributed cache
+      val ivySettings = sparkConf.getOption("spark.jars.ivySettings")
+      if (isClusterMode && ivySettings.isDefined) {
+        val ivySettingsFile = new File(ivySettings.get)
+        require(ivySettingsFile.exists(), s"Ivy settings file $ivySettingsFile 
not found")
+        require(ivySettingsFile.isFile(),
+          s"Ivy settings file $ivySettingsFile is not a normal file")
+        // Generate a file name that can be used for the ivySettings file, 
that does not conflict
+        // with any other conf file.
+        val amIvySettingsFileName = ivySettingsFile.getName() + "-" + 
UUID.randomUUID().toString
+        confStream.putNextEntry(new ZipEntry(amIvySettingsFileName))

Review comment:
       I have updated the PR using `distribute()` to localize the ivySettings 
file instead of putting the file in Spark conf zip. I also had to slightly 
modify the ivySettings loading code in `SparkSubmit.scala` since it did not 
support local URIs in the first place. I also added tests for local and 
non-local URIs for ivySettings.




-- 
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:
[email protected]



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

Reply via email to