Skip to content
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][K8S] Support auto build Kubernetes client from env when Kyuubi running in Pod #3663

Closed
wants to merge 15 commits into from
Closed

[SPARK][K8S] Support auto build Kubernetes client from env when Kyuubi running in Pod #3663

wants to merge 15 commits into from

Conversation

zwangsheng
Copy link
Contributor

@zwangsheng zwangsheng commented Oct 19, 2022

Why are the changes needed?

Current kyuubi build kubernetes client for KyuubiApplicationOperator to find or kill spark engine on kubernetes.

This pr aims to extract the code for building kubernetes client into KubernetesUtils and to do auto build following the logic in Spark.

We prefer to building with user-configured parameters; When missing, the kubernetes client logic will build one from environment variables and kubeconfig.

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

@zwangsheng zwangsheng requested a review from pan3793 October 20, 2022 09:44
@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2022

Codecov Report

Merging #3663 (0a4c8c7) into master (9d0b690) will increase coverage by 0.40%.
The diff coverage is 85.29%.

@@             Coverage Diff              @@
##             master    #3663      +/-   ##
============================================
+ Coverage     52.02%   52.42%   +0.40%     
  Complexity       13       13              
============================================
  Files           485      490       +5     
  Lines         27202    27515     +313     
  Branches       3793     3816      +23     
============================================
+ Hits          14151    14424     +273     
- Misses        11685    11711      +26     
- Partials       1366     1380      +14     
Impacted Files Coverage Δ
...kyuubi/engine/KubernetesApplicationOperation.scala 21.87% <37.50%> (+9.37%) ⬆️
...scala/org/apache/kyuubi/util/KubernetesUtils.scala 81.48% <81.48%> (ø)
...in/scala/org/apache/kyuubi/config/KyuubiConf.scala 97.44% <100.00%> (+0.10%) ⬆️
...ain/scala/org/apache/kyuubi/util/ThreadUtils.scala 91.66% <100.00%> (+0.49%) ⬆️
...he/kyuubi/plugin/spark/authz/util/AuthZUtils.scala 54.71% <0.00%> (-4.38%) ⬇️
...rg/apache/kyuubi/ctl/cmd/log/LogBatchCommand.scala 78.00% <0.00%> (-4.00%) ⬇️
...rg/apache/kyuubi/engine/spark/SparkSQLEngine.scala 75.00% <0.00%> (-0.91%) ⬇️
...yuubi/server/metadata/jdbc/JDBCMetadataStore.scala 89.27% <0.00%> (-0.70%) ⬇️
...n/scala/org/apache/kyuubi/engine/ProcBuilder.scala 80.74% <0.00%> (-0.63%) ⬇️
.../org/apache/kyuubi/session/KyuubiSessionImpl.scala 75.22% <0.00%> (-0.57%) ⬇️
... and 49 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, just minor comments

@github-actions github-actions bot added the kind:infra license, community building, project builds, asf infra related, etc. label Oct 24, 2022
@zwangsheng zwangsheng changed the title [SPARK][K8S] Kyuubi Kubernetes Application Operator add build kuebrnetes client from pod env when kyuubi in pod [SPARK][K8S] Add KubernetesUtils help build kubernetes client Oct 24, 2022
@yaooqinn
Copy link
Member

I try my best to understand what you are trying to say about this PR in the PR desc, but failed

@zwangsheng
Copy link
Contributor Author

I try my best to understand what you are trying to say about this PR in the PR desc, but failed

This pr aims to add util object KubernetesUtils help kyuubi build kubernetes client in spark way.

@pan3793 pan3793 changed the title [SPARK][K8S] Add KubernetesUtils help build kubernetes client [SPARK][K8S] Support auto build Kubernetes client when Kyuubi running in Pod Oct 25, 2022
@yaooqinn
Copy link
Member

refactor only change?

@pan3793 pan3793 changed the title [SPARK][K8S] Support auto build Kubernetes client when Kyuubi running in Pod [SPARK][K8S] Support auto build Kubernetes client from env when Kyuubi running in Pod Oct 25, 2022
@pan3793 pan3793 added this to the v1.7.0 milestone Oct 25, 2022
@pan3793
Copy link
Member

pan3793 commented Oct 25, 2022

The PR description is updated and should cover the changes in the PR.

Thanks, merging to master

@pan3793
Copy link
Member

pan3793 commented Oct 25, 2022

The CI failure caused by known flaky tests

@pan3793 pan3793 closed this in 9827c60 Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:build kind:documentation Documentation is a feature! kind:infra license, community building, project builds, asf infra related, etc. module:common module:integration-tests module:kubernetes module:server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants