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 2021/12/22 09:16:54 UTC

[GitHub] [spark] dcoliversun opened a new pull request #34983: [SPARK-37713][K8S] assign namespace to executor configmap

dcoliversun opened a new pull request #34983:
URL: https://github.com/apache/spark/pull/34983


   <!--
   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.
   -->
   Since Spark 3.X, Executor pod needs separate executor configmap. But, no namespace is assigned in configmap while building it. K8s views configmap without namespace as global resource. Once pod access is restricted (global resources cannot be read), and executor cannot obtain configmap itself.
   
   
   ### 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.
   -->
   Fix executor pod authorization error in K8S. When executor pod cannot read global resources, executor configmap is not available for executor.
   
   ### 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.
   -->
   Pass Integration Test and CIs.


-- 
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] dcoliversun commented on a change in pull request #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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



##########
File path: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientUtilsSuite.scala
##########
@@ -82,8 +81,9 @@ class KubernetesClientUtilsSuite extends SparkFunSuite with BeforeAndAfter {
   }
 
   test("verify that configmap built as expected") {
-    val configMapName = "testConfigMapName"
-    val properties = Map(Config.KUBERNETES_NAMESPACE.key -> "default")
+    val configMapName = java.util.UUID.randomUUID.toString

Review comment:
       It works without "import java.util.UUID". Is this a code import style limitation? If true, I can import :)




-- 
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] dcoliversun commented on a change in pull request #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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



##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientUtils.scala
##########
@@ -87,11 +87,15 @@ private[spark] object KubernetesClientUtils extends Logging {
    * Build a Config Map that will hold the content for environment variable SPARK_CONF_DIR
    * on remote pods.
    */
-  def buildConfigMap(configMapName: String, confFileMap: Map[String, String],
-      withLabels: Map[String, String] = Map()): ConfigMap = {
+  def buildConfigMap(
+     configMapName: String,
+     confFileMap: Map[String, String],
+     configMapNameSpace: String,

Review comment:
       Done, buildConfigMap method could get namespace via `confFileMap`




-- 
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] dcoliversun commented on pull request #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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


   > 
   
   Sorry so late to reply. I've been working on it for days. I couldn't add test case because k8s allows configmap without .metadata.namespce. Request to APIServer will put namespace to body. But, .metadata.namespace is still null when request to APIServer. I think it's a good action. User will see this configmap through dashboard. The action that namespace of executor configmap yaml is null will confuse user.


-- 
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 #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

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


   Happy New Year, @dcoliversun ! :)


-- 
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 edited a comment on pull request #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

Posted by GitBox <gi...@apache.org>.
Yikun edited a comment on pull request #34983:
URL: https://github.com/apache/spark/pull/34983#issuecomment-1014248788


   FYI, this PR breaks the case of using ConfigMap with namespace specified (driver side), see https://github.com/apache/spark/pull/35215 .
   
   You could using below cmd to revert this commits manually before above PR merged:
   ```bash
   git revert c4a9772f741836cdb399e35a45b3b5df48d9eea6
   ```


-- 
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 #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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



##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientUtils.scala
##########
@@ -87,11 +87,15 @@ private[spark] object KubernetesClientUtils extends Logging {
    * Build a Config Map that will hold the content for environment variable SPARK_CONF_DIR
    * on remote pods.
    */
-  def buildConfigMap(configMapName: String, confFileMap: Map[String, String],
-      withLabels: Map[String, String] = Map()): ConfigMap = {
+  def buildConfigMap(
+     configMapName: String,
+     confFileMap: Map[String, String],
+     configMapNameSpace: String,

Review comment:
       Please try to get namespace via `confFileMap` instead changing this method signature.




-- 
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] dcoliversun commented on pull request #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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


   > 
   OK,I understand. I am working on it


-- 
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 edited a comment on pull request #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

Posted by GitBox <gi...@apache.org>.
Yikun edited a comment on pull request #34983:
URL: https://github.com/apache/spark/pull/34983#issuecomment-1014248788


   FYI, this PR breaks the case of using ConfigMap with namespace specified (driver side), see https://github.com/apache/spark/pull/35215 .


-- 
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 #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

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


   cc @williamhyun 


-- 
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 #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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



##########
File path: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientUtilsSuite.scala
##########
@@ -82,8 +81,9 @@ class KubernetesClientUtilsSuite extends SparkFunSuite with BeforeAndAfter {
   }
 
   test("verify that configmap built as expected") {
-    val configMapName = "testConfigMapName"
-    val properties = Map(Config.KUBERNETES_NAMESPACE.key -> "default")
+    val configMapName = java.util.UUID.randomUUID.toString

Review comment:
       @dcoliversun . Apache Spark recommends not to hide your import in the code. Especially, you are using twice at line 84 and 85. Your code is verbose due to the repeatability and not good at the readability too.




-- 
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 edited a comment on pull request #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

Posted by GitBox <gi...@apache.org>.
Yikun edited a comment on pull request #34983:
URL: https://github.com/apache/spark/pull/34983#issuecomment-1019494990


   ```scala
   val builder2 = new ConfigMapBuilder()
         .withNewMetadata()
           // We don't specify ns2 in here
           .withName("configmap2")
         .endMetadata()
         .addToData("testkey", "testvalue")
         .build()
       val configMap2 =
   // the conf.metadata.namespace is also set to ns2 client.inNamespace("ns2").resource(builder2).createOrReplace()
       assert(configMap2.getMetadata.getNamespace === "ns2")
   ```
   
   I just wanna sure, do we really need this PR?
   
   The case shows even if we don't set namespace in configmap metadata, it will also set to client default namespace which set in [createKubernetesClient](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/SparkKubernetesClientFactory.scala#L105) with [conf namespace](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterManager.scala#L80).
   
   That is even without this PR, we can also set configmap namespace as expected, or did I miss something?


-- 
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] dcoliversun commented on a change in pull request #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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



##########
File path: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientUtilsSuite.scala
##########
@@ -82,8 +81,9 @@ class KubernetesClientUtilsSuite extends SparkFunSuite with BeforeAndAfter {
   }
 
   test("verify that configmap built as expected") {
-    val configMapName = "testConfigMapName"
-    val properties = Map(Config.KUBERNETES_NAMESPACE.key -> "default")
+    val configMapName = java.util.UUID.randomUUID.toString

Review comment:
       @dongjoon-hyun Thanks for your suggestion. I import java.util.UUID and add name/namespace prefix to improve readability. Please reivew it 😊




-- 
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] dcoliversun commented on a change in pull request #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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



##########
File path: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientUtilsSuite.scala
##########
@@ -76,4 +80,26 @@ class KubernetesClientUtilsSuite extends SparkFunSuite with BeforeAndAfter {
       "testConf.3" -> "test123456")
     assert(output === expectedOutput)
   }
+
+  test("verify that configmap built as expected") {
+    val configMapName = "testConfigMapName"
+    val properties = Map(Config.KUBERNETES_NAMESPACE.key -> "default")

Review comment:
       OK, I change it.




-- 
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 removed a comment on pull request #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

Posted by GitBox <gi...@apache.org>.
Yikun removed a comment on pull request #34983:
URL: https://github.com/apache/spark/pull/34983#issuecomment-1019494990


   ```scala
   val builder2 = new ConfigMapBuilder()
         .withNewMetadata()
           // We don't specify ns2 in here
           .withName("configmap2")
         .endMetadata()
         .addToData("testkey", "testvalue")
         .build()
       val configMap2 =
   // the conf.metadata.namespace is also set to ns2 client.inNamespace("ns2").resource(builder2).createOrReplace()
       assert(configMap2.getMetadata.getNamespace === "ns2")
   ```
   
   I just wanna sure, do we really need this PR?
   
   The case shows even if we don't set namespace in configmap metadata, it will also set to client namespace which is configured in [createKubernetesClient](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/SparkKubernetesClientFactory.scala#L105) with [conf namespace](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterManager.scala#L80).
   
   That is even without this PR, we can also set configmap namespace as expected(both driver and executor), or did I miss something?


-- 
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 #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

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


   ```scala
   val builder2 = new ConfigMapBuilder()
         .withNewMetadata()
           // We don't specify ns2 in here
           .withName("configmap2")
         .endMetadata()
         .addToData("testkey", "testvalue")
         .build()
       val configMap2 = client.inNamespace("ns2").resource(builder2).createOrReplace()
       assert(configMap2.getMetadata.getNamespace === "ns2")
   ```
   
   I just wanna sure, do we really need this PR?
   
   The case shows even if we don't set namespace in configmap, will just set to client default namespace which set in [createKubernetesClient](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/SparkKubernetesClientFactory.scala#L105) with [conf namespace](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterManager.scala#L80).
   
   That is even without this PR, we can also set configmap namespace as expected, or did I miss something?


-- 
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] dcoliversun commented on pull request #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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


   Sorry, CI has some error. I'm fixing it.


-- 
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] dcoliversun commented on pull request #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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


   @dongjoon-hyun  Would you have review for these code? Thanks :)


-- 
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 #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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



##########
File path: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientUtilsSuite.scala
##########
@@ -76,4 +80,26 @@ class KubernetesClientUtilsSuite extends SparkFunSuite with BeforeAndAfter {
       "testConf.3" -> "test123456")
     assert(output === expectedOutput)
   }
+
+  test("verify that configmap built as expected") {
+    val configMapName = "testConfigMapName"
+    val properties = Map(Config.KUBERNETES_NAMESPACE.key -> "default")

Review comment:
       If you don't mind, could you use a random name here? Although the previous code doesn't attache the namespace, this `default` is too generic to be in the test 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] dcoliversun commented on pull request #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

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


   > +1, LGTM. Thank you, @dcoliversun .
   
   @dongjoon-hyun Thanks for your review, which helps me a lot. HAPPY NEW YEAR


-- 
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 #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

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


   K8s tests passed. 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] dongjoon-hyun closed pull request #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

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


   


-- 
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 #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

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


   FYI, this PR breaks the basic case to use ConfigMap with namespace specified (driver side), see https://github.com/apache/spark/pull/35215 .


-- 
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 edited a comment on pull request #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun edited a comment on pull request #34983:
URL: https://github.com/apache/spark/pull/34983#issuecomment-1003244117


   K8s tests passed. Merged to master for Apache Spark 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 a change in pull request #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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



##########
File path: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientUtilsSuite.scala
##########
@@ -82,8 +81,9 @@ class KubernetesClientUtilsSuite extends SparkFunSuite with BeforeAndAfter {
   }
 
   test("verify that configmap built as expected") {
-    val configMapName = "testConfigMapName"
-    val properties = Map(Config.KUBERNETES_NAMESPACE.key -> "default")
+    val configMapName = java.util.UUID.randomUUID.toString

Review comment:
       `import java.util.UUID`?




-- 
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 #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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



##########
File path: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientUtilsSuite.scala
##########
@@ -82,8 +81,9 @@ class KubernetesClientUtilsSuite extends SparkFunSuite with BeforeAndAfter {
   }
 
   test("verify that configmap built as expected") {
-    val configMapName = "testConfigMapName"
-    val properties = Map(Config.KUBERNETES_NAMESPACE.key -> "default")
+    val configMapName = java.util.UUID.randomUUID.toString

Review comment:
       @dcoliversun . Apache Spark recommends not to hide your import in the code. Especially, you are using it twice at line 84 and 85. Your code is verbose due to the repeatability and not good at the readability too.




-- 
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 edited a comment on pull request #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

Posted by GitBox <gi...@apache.org>.
Yikun edited a comment on pull request #34983:
URL: https://github.com/apache/spark/pull/34983#issuecomment-1019494990


   ```scala
   val builder2 = new ConfigMapBuilder()
         .withNewMetadata()
           // We don't specify ns2 in here
           .withName("configmap2")
         .endMetadata()
         .addToData("testkey", "testvalue")
         .build()
       val configMap2 =
   // the conf.metadata.namespace is also set to ns2 client.inNamespace("ns2").resource(builder2).createOrReplace()
       assert(configMap2.getMetadata.getNamespace === "ns2")
   ```
   
   I just wanna sure, do we really need this PR?
   
   The case shows even if we don't set namespace in configmap metadata, it will also set to client namespace which is configured in [createKubernetesClient](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/SparkKubernetesClientFactory.scala#L105) with [conf namespace](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterManager.scala#L80).
   
   That is even without this PR, we can also set configmap namespace as expected(both driver and executor), or did I miss something?


-- 
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 edited a comment on pull request #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

Posted by GitBox <gi...@apache.org>.
Yikun edited a comment on pull request #34983:
URL: https://github.com/apache/spark/pull/34983#issuecomment-1019494990


   ```scala
   val builder2 = new ConfigMapBuilder()
         .withNewMetadata()
           // We don't specify ns2 in here
           .withName("configmap2")
         .endMetadata()
         .addToData("testkey", "testvalue")
         .build()
       val configMap2 =
   // the conf.metadata.namespace is also set to ns2 client.inNamespace("ns2").resource(builder2).createOrReplace()
       assert(configMap2.getMetadata.getNamespace === "ns2")
   ```
   
   I just wanna sure, do we really need this PR?
   
   The case shows even if we don't set namespace in configmap metadata, it will also set to client namespace which is configured in [createKubernetesClient](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/SparkKubernetesClientFactory.scala#L105) with [conf namespace](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterManager.scala#L80).
   
   That is even without this PR, we can also set configmap namespace as expected, or did I miss something?


-- 
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 #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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


   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] dongjoon-hyun commented on pull request #34983: [SPARK-37713][K8S] assign namespace to executor configmap

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


   Gentle ping, @dcoliversun .


-- 
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 #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

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


   If you need this in next Apache Spark 3.2.1, please make a backporting PR against `branch-3.2`.


-- 
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] GabeChurch commented on pull request #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

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


   Noticing the same behavior as Yikun with this pull breaking ConfigMap usage in non "default" namespace(s). 


-- 
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 edited a comment on pull request #34983: [SPARK-37713][K8S] Assign namespace to executor configmap

Posted by GitBox <gi...@apache.org>.
Yikun edited a comment on pull request #34983:
URL: https://github.com/apache/spark/pull/34983#issuecomment-1019494990


   ```scala
   val builder2 = new ConfigMapBuilder()
         .withNewMetadata()
           // We don't specify ns2 in here
           .withName("configmap2")
         .endMetadata()
         .addToData("testkey", "testvalue")
         .build()
       val configMap2 =
   // the conf.metadata.namespace is also set to ns2 client.inNamespace("ns2").resource(builder2).createOrReplace()
       assert(configMap2.getMetadata.getNamespace === "ns2")
   ```
   
   I just wanna sure, do we really need this PR?
   
   The case shows even if we don't set namespace in configmap metadata, will just set to client default namespace which set in [createKubernetesClient](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/SparkKubernetesClientFactory.scala#L105) with [conf namespace](https://github.com/apache/spark/blob/ddc77fb906cb3ce1567d277c2d0850104c89ac25/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterManager.scala#L80).
   
   That is even without this PR, we can also set configmap namespace as expected, or did I miss something?


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