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/11/02 13:17:11 UTC

[GitHub] [spark] pan3793 opened a new pull request, #38483: [SPARK-40997][K8S] K8s resource name prefix should start w/ alphanumeric

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

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   Ensure string generated by `KubernetesConf#getResourceNamePrefix` always start w/ alphanumeric
   
   ### 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.
   -->
   According to https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names, the most resource names should start with an alphanumeric character.
   
   Currently, the `KubernetesConf#getResourceNamePrefix` does not ensure the return value always start w/ alphanumeric, for example, if use set `spark.app.name=测试`, will cause the following error.
   
   ```
   2022-11-02 19:46:05 [ERROR] [kubernetes-executor-snapshots-subscribers-1] org.apache.spark.scheduler.cluster.k8s.ExecutorPodsSnapshotsStoreImpl#98 - Going to stop due to IllegalArgumentException
   java.lang.IllegalArgumentException: '-9ea12a8438298333' in spark.kubernetes.executor.podNamePrefix is invalid. must conform https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names and the value length <= 237
   	at org.apache.spark.internal.config.TypedConfigBuilder.$anonfun$checkValue$1(ConfigBuilder.scala:108) ~[spark-core_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.internal.config.TypedConfigBuilder.$anonfun$transform$1(ConfigBuilder.scala:101) ~[spark-core_2.12-3.3.1.1.jar:3.3.1.1]
   	at scala.Option.map(Option.scala:230) ~[scala-library-2.12.15.jar:?]
   	at org.apache.spark.internal.config.OptionalConfigEntry.readFrom(ConfigEntry.scala:239) ~[spark-core_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.internal.config.OptionalConfigEntry.readFrom(ConfigEntry.scala:214) ~[spark-core_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.SparkConf.get(SparkConf.scala:261) ~[spark-core_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.deploy.k8s.KubernetesConf.get(KubernetesConf.scala:70) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.deploy.k8s.KubernetesExecutorConf.<init>(KubernetesConf.scala:156) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.deploy.k8s.KubernetesConf$.createExecutorConf(KubernetesConf.scala:246) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.scheduler.cluster.k8s.ExecutorPodsAllocator.$anonfun$requestNewExecutors$1(ExecutorPodsAllocator.scala:394) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:158) ~[scala-library-2.12.15.jar:?]
   	at org.apache.spark.scheduler.cluster.k8s.ExecutorPodsAllocator.requestNewExecutors(ExecutorPodsAllocator.scala:387) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.scheduler.cluster.k8s.ExecutorPodsAllocator.$anonfun$onNewSnapshots$35(ExecutorPodsAllocator.scala:351) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.scheduler.cluster.k8s.ExecutorPodsAllocator.$anonfun$onNewSnapshots$35$adapted(ExecutorPodsAllocator.scala:344) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62) ~[scala-library-2.12.15.jar:?]
   	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55) ~[scala-library-2.12.15.jar:?]
   	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49) ~[scala-library-2.12.15.jar:?]
   	at org.apache.spark.scheduler.cluster.k8s.ExecutorPodsAllocator.onNewSnapshots(ExecutorPodsAllocator.scala:344) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.scheduler.cluster.k8s.ExecutorPodsAllocator.$anonfun$start$3(ExecutorPodsAllocator.scala:122) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.scheduler.cluster.k8s.ExecutorPodsAllocator.$anonfun$start$3$adapted(ExecutorPodsAllocator.scala:122) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.scheduler.cluster.k8s.ExecutorPodsSnapshotsStoreImpl$SnapshotsSubscriber.org$apache$spark$scheduler$cluster$k8s$ExecutorPodsSnapshotsStoreImpl$SnapshotsSubscriber$$processSnapshotsInternal(ExecutorPodsSnapshotsStoreImpl.scala:138) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.scheduler.cluster.k8s.ExecutorPodsSnapshotsStoreImpl$SnapshotsSubscriber.processSnapshots(ExecutorPodsSnapshotsStoreImpl.scala:126) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at org.apache.spark.scheduler.cluster.k8s.ExecutorPodsSnapshotsStoreImpl$$anon$1.run(ExecutorPodsSnapshotsStoreImpl.scala:90) ~[spark-kubernetes_2.12-3.3.1.1.jar:3.3.1.1]
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_345]
   	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_345]
   	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_345]
   	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_345]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_345]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_345]
   	at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_345]
   ```
   
   ### 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'.
   -->
   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.
   -->
   New UT added.


-- 
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 #38483: [SPARK-40997][K8S] K8s resource name prefix should start w/ alphanumeric

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

   Ya, I merged https://github.com/apache/spark/pull/38331 because it came first.
   BTW, thank you, @pan3793 and @Yikun . Could you close this PR, @pan3793 ?


-- 
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] pan3793 closed pull request #38483: [SPARK-40997][K8S] K8s resource name prefix should start w/ alphanumeric

Posted by GitBox <gi...@apache.org>.
pan3793 closed pull request #38483: [SPARK-40997][K8S] K8s resource name prefix should start w/ alphanumeric
URL: https://github.com/apache/spark/pull/38483


-- 
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] pan3793 commented on pull request #38483: [SPARK-40997][K8S] K8s resource name prefix should start w/ alphanumeric

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #38483:
URL: https://github.com/apache/spark/pull/38483#issuecomment-1301579448

   cc @dongjoon-hyun @Yikun, would you please take a look?


-- 
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] AmplabJenkins commented on pull request #38483: [SPARK-40997][K8S] K8s resource name prefix should start w/ alphanumeric

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #38483:
URL: https://github.com/apache/spark/pull/38483#issuecomment-1300983649

   Can one of the admins verify this patch?


-- 
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] pan3793 commented on pull request #38483: [SPARK-40997][K8S] K8s resource name prefix should start w/ alphanumeric

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #38483:
URL: https://github.com/apache/spark/pull/38483#issuecomment-1301698248

   Emm... I didn't noticed there was a PR to fix this issue, either one get merged is fine to me.


-- 
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 pull request #38483: [SPARK-40997][K8S] K8s resource name prefix should start w/ alphanumeric

Posted by GitBox <gi...@apache.org>.
Yikun commented on PR #38483:
URL: https://github.com/apache/spark/pull/38483#issuecomment-1301683777

   FYI: https://github.com/apache/spark/pull/38331


-- 
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] pan3793 commented on pull request #38483: [SPARK-40997][K8S] K8s resource name prefix should start w/ alphanumeric

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #38483:
URL: https://github.com/apache/spark/pull/38483#issuecomment-1302865058

   Close as duplicated, thanks all.


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