xumanbu commented on code in PR #53845:
URL: https://github.com/apache/spark/pull/53845#discussion_r4022124857
##########
core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala:
##########
@@ -605,6 +605,109 @@ class SparkSubmitSuite
}
}
+ test("SPARK-55077: Avoid archives download if scheme matches " +
+ "spark.kubernetes.archives.avoidDownloadSchemes " +
+ "in k8s client mode & driver runs inside a POD") {
+ val hadoopConf = new Configuration()
+ updateConfWithFakeS3Fs(hadoopConf)
+ withTempDir { tmpDir =>
+ val notToDownloadArchive = File.createTempFile("NotToDownloadArchive",
".zip", tmpDir)
+ val remoteArchiveFile = s"s3a://${notToDownloadArchive.getAbsolutePath}"
+ val tmpJar = File.createTempFile("TestUDTF", ".jar", tmpDir)
+
+ val clArgs = Seq(
+ "--deploy-mode", "client",
+ "--proxy-user", "test.user",
+ "--master", "k8s://host:port",
+ "--class", "org.SomeClass",
+ "--conf", "spark.kubernetes.submitInDriver=true",
+ "--conf", "spark.kubernetes.archives.avoidDownloadSchemes=s3a",
+ "--conf",
"spark.hadoop.fs.s3a.impl=org.apache.spark.deploy.TestFileSystem",
+ "--conf", "spark.hadoop.fs.s3a.impl.disable.cache=true",
+ "--files", "src/test/resources/test_metrics_config.properties",
+ "--py-files", "src/test/resources/test_metrics_system.properties",
+ "--archives",
s"src/test/resources/log4j2.properties,$remoteArchiveFile",
+ "--jars", tmpJar.getAbsolutePath,
+ "/home/jarToIgnore.jar",
+ "arg1")
+ val appArgs = new SparkSubmitArguments(clArgs)
+ val (_, _, conf, _) = submit.prepareSubmitEnvironment(appArgs,
Some(hadoopConf))
+ conf.get("spark.master") should be("k8s://https://host:port")
+ conf.get("spark.archives").contains(remoteArchiveFile) shouldBe true
+ conf.get("spark.archives").contains("log4j2.properties") shouldBe true
+
+ Files.exists(Paths.get("test_metrics_config.properties")) should be(true)
+ Files.exists(Paths.get("test_metrics_system.properties")) should be(true)
+ Files.exists(Paths.get("log4j2.properties")) should be(true)
+ Files.exists(Paths.get(tmpJar.getName)) should be(true)
+ Files.exists(Paths.get(notToDownloadArchive.getName)) should be(false)
+ Files.delete(Paths.get("test_metrics_config.properties"))
Review Comment:
Done.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]