You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "panbingkun (via GitHub)" <gi...@apache.org> on 2023/07/28 09:04:32 UTC

[GitHub] [spark] panbingkun opened a new pull request, #42201: [MINOR][TESTS] Clearing residual files after SparkSubmitSuite

panbingkun opened a new pull request, #42201:
URL: https://github.com/apache/spark/pull/42201

   ### What changes were proposed in this pull request?
   The pr aims to clear residual files after SparkSubmitSuite ("SPARK-35084: include jars of the --packages in k8s client mode & driver runs inside a POD")
   
   ### Why are the changes needed?
   Clear residual files after UT.
   
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   
   ### How was this patch tested?
   Manually Test.
   


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] panbingkun commented on a diff in pull request #42201: [MINOR][TESTS] Clearing residual files after SparkSubmitSuite

Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #42201:
URL: https://github.com/apache/spark/pull/42201#discussion_r1278672126


##########
core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala:
##########
@@ -510,8 +510,19 @@ class SparkSubmitSuite
         "my.great.lib.MyLib", "my.great.dep.MyLib")
 
       val appArgs = new SparkSubmitArguments(clArgs)
-      val (_, _, sparkConf, _) = submit.prepareSubmitEnvironment(appArgs)
-      sparkConf.get("spark.jars").contains("mylib") shouldBe true
+      try {
+        val (_, _, sparkConf, _) = submit.prepareSubmitEnvironment(appArgs)
+        sparkConf.get("spark.jars").contains("mylib") shouldBe true
+      } finally {
+        val mainJarPath = Paths.get("my.great.dep_mylib-0.1.jar")
+        val depJarPath = Paths.get("my.great.lib_mylib-0.1.jar")
+        if (Files.exists(mainJarPath)) {
+          Files.delete(mainJarPath)
+        }
+        if (Files.exists(depJarPath)) {
+          Files.delete(depJarPath)

Review Comment:
   1.yeah, it was not cleared when the jvm was shut down.
   
   2.The logic it generates is here:
   https://github.com/apache/spark/blob/be95298f24669cddaa65e412d7681476149e2977/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#L452-L454
   
   3.We can simply reproduce it by any of the following commands:
   ```
   - ./build/sbt "core/testOnly *SparkSubmitSuite*"
   - ./build/sbt "core/testOnly *SparkSubmitSuite -- -z \"SPARK-35084: include jars of the --packages in k8s client mode & driver runs inside a POD\""
   ```
   



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #42201: [MINOR][TESTS] Clearing residual files after SparkSubmitSuite

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #42201:
URL: https://github.com/apache/spark/pull/42201#discussion_r1278672944


##########
core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala:
##########
@@ -510,8 +510,19 @@ class SparkSubmitSuite
         "my.great.lib.MyLib", "my.great.dep.MyLib")
 
       val appArgs = new SparkSubmitArguments(clArgs)
-      val (_, _, sparkConf, _) = submit.prepareSubmitEnvironment(appArgs)
-      sparkConf.get("spark.jars").contains("mylib") shouldBe true
+      try {
+        val (_, _, sparkConf, _) = submit.prepareSubmitEnvironment(appArgs)
+        sparkConf.get("spark.jars").contains("mylib") shouldBe true
+      } finally {
+        val mainJarPath = Paths.get("my.great.dep_mylib-0.1.jar")
+        val depJarPath = Paths.get("my.great.lib_mylib-0.1.jar")
+        if (Files.exists(mainJarPath)) {
+          Files.delete(mainJarPath)
+        }
+        if (Files.exists(depJarPath)) {
+          Files.delete(depJarPath)

Review Comment:
   ah okie. LGTM



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #42201: [MINOR][TESTS] Clearing residual files after SparkSubmitSuite

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #42201:
URL: https://github.com/apache/spark/pull/42201#discussion_r1278478709


##########
core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala:
##########
@@ -510,8 +510,19 @@ class SparkSubmitSuite
         "my.great.lib.MyLib", "my.great.dep.MyLib")
 
       val appArgs = new SparkSubmitArguments(clArgs)
-      val (_, _, sparkConf, _) = submit.prepareSubmitEnvironment(appArgs)
-      sparkConf.get("spark.jars").contains("mylib") shouldBe true
+      try {
+        val (_, _, sparkConf, _) = submit.prepareSubmitEnvironment(appArgs)
+        sparkConf.get("spark.jars").contains("mylib") shouldBe true
+      } finally {
+        val mainJarPath = Paths.get("my.great.dep_mylib-0.1.jar")
+        val depJarPath = Paths.get("my.great.lib_mylib-0.1.jar")
+        if (Files.exists(mainJarPath)) {
+          Files.delete(mainJarPath)
+        }
+        if (Files.exists(depJarPath)) {
+          Files.delete(depJarPath)

Review Comment:
   isn't this removed at the JVM shutdown hook?



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] panbingkun commented on pull request #42201: [MINOR][TESTS] Clearing residual files after SparkSubmitSuite

Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on PR #42201:
URL: https://github.com/apache/spark/pull/42201#issuecomment-1655339383

   1.Before:
   <img width="577" alt="image" src="https://github.com/apache/spark/assets/15246973/b4fc0d8c-6bf5-45d9-823b-5f6b28a8d02c">
   
   2.After:
   The following 2 files will be cleared after UT is completed:
   core/my.great.dep_mylib-0.1.jar
   core/my.great.lib_mylib-0.1.jar


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] HyukjinKwon commented on pull request #42201: [MINOR][TESTS] Clearing residual files after SparkSubmitSuite

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #42201:
URL: https://github.com/apache/spark/pull/42201#issuecomment-1657370404

   Merged to master.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] HyukjinKwon closed pull request #42201: [MINOR][TESTS] Clearing residual files after SparkSubmitSuite

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #42201: [MINOR][TESTS] Clearing residual files after SparkSubmitSuite
URL: https://github.com/apache/spark/pull/42201


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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