-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK] Kyuubi should set env SPARK_USER_NAME for K8s deployment #3527
Conversation
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #3527 +/- ##
=========================================
Coverage 51.67% 51.67%
Complexity 13 13
=========================================
Files 482 482
Lines 26933 26943 +10
Branches 3760 3760
=========================================
+ Hits 13917 13923 +6
- Misses 11661 11664 +3
- Partials 1355 1356 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
// For spark on kubernetes, spark pod using env SPARK_USER_NAME as current user | ||
def setSparkUserName(userName: String): Unit = { | ||
clusterManager().foreach(cm => { | ||
if (cm.startsWith("k8s://")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no harm to set for all cluster managers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spark.kubernetes.driverEnv.
only affect on kubernetes case. We are only setting up this On Kubernetes for now.
As for SPARK_USER_NAME
this env, it's affect in spark/kubernetes/entrypoint.sh
Thanks, merging to master/1.6 |
…deployment ### _Why are the changes needed?_ On case spark on kubernetes, spark using env `SPARK_USER_NAME` as user name. So kyuubi should build spark engine with this env when proxy user or using keytab. This conf only affect on kubernetes case. Ref: apache/spark#23017 ### _How was this patch tested?_ - [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #3527 from zwangsheng/feature/add_spark_user_name. Closes #3527 9596372 [zwangsheng] only k8s case ddd713f [zwangsheng] fix 48b9b22 [zwangsheng] add Authored-by: zwangsheng <2213335496@qq.com> Signed-off-by: Cheng Pan <chengpan@apache.org> (cherry picked from commit 3738512) Signed-off-by: Cheng Pan <chengpan@apache.org>
@zwangsheng |
😭sry, i will make follow PR. |
…e spark.executorEnv ### _Why are the changes needed?_ Fix bug in #3527 Modify `spark.kubernetes.executorEnv` to `spark.executorEnv` ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request - [x] Unit Test Closes #3591 from zwangsheng/follow/SPARK_USER_NAME. Closes #3527 7254fe9 [zwangsheng] fix executorEnv Authored-by: zwangsheng <2213335496@qq.com> Signed-off-by: Cheng Pan <chengpan@apache.org>
…e spark.executorEnv ### _Why are the changes needed?_ Fix bug in #3527 Modify `spark.kubernetes.executorEnv` to `spark.executorEnv` ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request - [x] Unit Test Closes #3591 from zwangsheng/follow/SPARK_USER_NAME. Closes #3527 7254fe9 [zwangsheng] fix executorEnv Authored-by: zwangsheng <2213335496@qq.com> Signed-off-by: Cheng Pan <chengpan@apache.org> (cherry picked from commit fb6516a) Signed-off-by: Cheng Pan <chengpan@apache.org>
…AME on submitting Spark batch job to K8s ### _Why are the changes needed?_ Batch job should also submit with `SPARK_USER_NAME`. See more in pre pr #3527 . ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #3664 from zwangsheng/feature/batch_with_user_name. Closes #3664 76dee3e [zwangsheng] style 0d40508 [zwangsheng] fix a1fcf7f [zwangsheng] fix Authored-by: zwangsheng <2213335496@qq.com> Signed-off-by: Cheng Pan <chengpan@apache.org>
…AME on submitting Spark batch job to K8s ### _Why are the changes needed?_ Batch job should also submit with `SPARK_USER_NAME`. See more in pre pr #3527 . ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #3664 from zwangsheng/feature/batch_with_user_name. Closes #3664 76dee3e [zwangsheng] style 0d40508 [zwangsheng] fix a1fcf7f [zwangsheng] fix Authored-by: zwangsheng <2213335496@qq.com> Signed-off-by: Cheng Pan <chengpan@apache.org> (cherry picked from commit 5f8b57b) Signed-off-by: Cheng Pan <chengpan@apache.org>
Why are the changes needed?
On case spark on kubernetes, spark using env
SPARK_USER_NAME
as user name.So kyuubi should build spark engine with this env when proxy user or using keytab.
This conf only affect on kubernetes case.
Ref: apache/spark#23017
How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before make a pull request