You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/03/23 01:46:23 UTC

[GitHub] [spark] dongjoon-hyun opened a new pull request #35943: [SPARK-38630][K8S] K8s app name label should start and end with alphanumeric char

dongjoon-hyun opened a new pull request #35943:
URL: https://github.com/apache/spark/pull/35943


   ### What changes were proposed in this pull request?
   
   K8s app name 
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   


-- 
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] dongjoon-hyun commented on pull request #35943: [SPARK-38630][K8S] K8s app name label should start and end with alphanumeric char

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #35943:
URL: https://github.com/apache/spark/pull/35943#issuecomment-1075845725


   The PR is ready back. Thank you again, @viirya .


-- 
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] viirya commented on pull request #35943: [SPARK-38630][K8S] K8s app name label should start and end with alphanumeric char

Posted by GitBox <gi...@apache.org>.
viirya commented on pull request #35943:
URL: https://github.com/apache/spark/pull/35943#issuecomment-1075828464


   Good catch. Will check again after you make it ready to review.


-- 
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] dongjoon-hyun commented on pull request #35943: [SPARK-38630][K8S] K8s app name label should start and end with alphanumeric char

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #35943:
URL: https://github.com/apache/spark/pull/35943#issuecomment-1075895517


   Thank you, @viirya and @Yikun .
   
   All tests passed and I verified K8s IT manually.
   ```
   [info] KubernetesSuite:
   [info] - Run SparkPi with no resources (8 seconds, 815 milliseconds)
   [info] - Run SparkPi with no resources & statefulset allocation (8 seconds, 330 milliseconds)
   [info] - Run SparkPi with a very long application name. (8 seconds, 354 milliseconds)
   [info] - Use SparkLauncher.NO_RESOURCE (8 seconds, 454 milliseconds)
   [info] - Run SparkPi with a master URL without a scheme. (8 seconds, 355 milliseconds)
   [info] - Run SparkPi with an argument. (8 seconds, 342 milliseconds)
   [info] - Run SparkPi with custom labels, annotations, and environment variables. (7 seconds, 344 milliseconds)
   [info] - All pods have the same service account by default (8 seconds, 527 milliseconds)
   [info] - Run extraJVMOptions check on driver (4 seconds, 282 milliseconds)
   [info] - Run SparkRemoteFileTest using a remote data file (8 seconds, 367 milliseconds)
   [info] - Verify logging configuration is picked from the provided SPARK_CONF_DIR/log4j2.properties (8 seconds, 739 milliseconds)
   [info] - Run SparkPi with env and mount secrets. (16 seconds, 115 milliseconds)
   [info] - Run PySpark on simple pi.py example (8 seconds, 351 milliseconds)
   [info] - Run PySpark to test a pyfiles example (10 seconds, 449 milliseconds)
   [info] - Run PySpark with memory customization (8 seconds, 520 milliseconds)
   [info] - Run in client mode. (6 seconds, 251 milliseconds)
   [info] - Start pod creation from template (8 seconds, 369 milliseconds)
   [info] - SPARK-38398: Schedule pod creation from template (8 seconds, 373 milliseconds)
   [info] - Test basic decommissioning (39 seconds, 892 milliseconds)
   [info] - Test basic decommissioning with shuffle cleanup (40 seconds, 266 milliseconds)
   [info] *** Test still running after 2 minutes, 24 seconds: suite name: KubernetesSuite, test name: Test decommissioning with dynamic allocation & shuffle cleanups.
   [info] - Test decommissioning with dynamic allocation & shuffle cleanups (2 minutes, 40 seconds)
   [info] - Test decommissioning timeouts (40 seconds, 381 milliseconds)
   [info] - SPARK-37576: Rolling decommissioning (1 minute, 6 seconds)
   [info] - Run SparkR on simple dataframe.R example (10 seconds, 350 milliseconds)
   ```
   
   Merged to master/3.3.


-- 
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] dongjoon-hyun commented on pull request #35943: [SPARK-38630][K8S] K8s app name label should start and end with alphanumeric char

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #35943:
URL: https://github.com/apache/spark/pull/35943#issuecomment-1075827011


   Could you review this please, @viirya and @HyukjinKwon ?


-- 
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] Yikun commented on a change in pull request #35943: [SPARK-38630][K8S] K8s app name label should start and end with alphanumeric char

Posted by GitBox <gi...@apache.org>.
Yikun commented on a change in pull request #35943:
URL: https://github.com/apache/spark/pull/35943#discussion_r832802242



##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesConf.scala
##########
@@ -270,7 +271,7 @@ private[spark] object KubernetesConf {
         .replaceAll("-+", "-"),
       "",
       KUBERNETES_DNSNAME_MAX_LENGTH
-    )
+    ).stripPrefix("-").stripSuffix("-")

Review comment:
       Note for my self or others: k8s label allow `dashes (-), underscores (_), dots (.)`, we alread replaced `underscores (_)`, `dots (.)` by `dashes (-)` before, so strip "-" prefix/suffix is enough in here.
   
   Below tests are also passed:
   ```
   assert(KubernetesConf.getAppNameLabel(".hello.") === "hello")
   assert(KubernetesConf.getAppNameLabel("_hello_") === "hello")
   ```




-- 
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] dongjoon-hyun closed pull request #35943: [SPARK-38630][K8S] K8s app name label should start and end with alphanumeric char

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #35943:
URL: https://github.com/apache/spark/pull/35943


   


-- 
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] Yikun commented on a change in pull request #35943: [SPARK-38630][K8S] K8s app name label should start and end with alphanumeric char

Posted by GitBox <gi...@apache.org>.
Yikun commented on a change in pull request #35943:
URL: https://github.com/apache/spark/pull/35943#discussion_r832802242



##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesConf.scala
##########
@@ -270,7 +271,7 @@ private[spark] object KubernetesConf {
         .replaceAll("-+", "-"),
       "",
       KUBERNETES_DNSNAME_MAX_LENGTH
-    )
+    ).stripPrefix("-").stripSuffix("-")

Review comment:
       Note for my self or others: k8s label allow `dashes (-), underscores (_), dots (.)`, we alread replaced `underscores (_)`, `dots (.)` by `dashes (-)` before for spark app label, so strip "-" prefix/suffix is enough in here.
   
   Below tests are also passed:
   ```
   assert(KubernetesConf.getAppNameLabel(".hello.") === "hello")
   assert(KubernetesConf.getAppNameLabel("_hello_") === "hello")
   ```




-- 
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] dongjoon-hyun commented on pull request #35943: [SPARK-38630][K8S] K8s app name label should start and end with alphanumeric char

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #35943:
URL: https://github.com/apache/spark/pull/35943#issuecomment-1075827948


   Oops. Sorry, I'm going to add more test cases for a corner case~


-- 
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] dongjoon-hyun commented on a change in pull request #35943: [SPARK-38630][K8S] K8s app name label should start and end with alphanumeric char

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #35943:
URL: https://github.com/apache/spark/pull/35943#discussion_r832783294



##########
File path: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/KubernetesConfSuite.scala
##########
@@ -244,4 +244,10 @@ class KubernetesConfSuite extends SparkFunSuite {
     assert(KubernetesConf.getAppNameLabel("a" * 64) === "a" * 63)
     assert(KubernetesConf.getAppNameLabel("a" * 253) === "a" * 63)
   }
+
+  test("SPARK-38630: K8s label value should start and end with alphanumeric") {
+    assert(KubernetesConf.getAppNameLabel("-hello-") === "hello")
+    assert(KubernetesConf.getAppNameLabel("a" * 62 + "-aaa") === "a" * 62)
+    assert(KubernetesConf.getAppNameLabel("-" + "a" * 63) === "a" * 62)

Review comment:
       The above two cases happen after `StringUtils.abbreviate`.




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