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

[K8S] Support to build application state and error from pod container #5711

Closed
wants to merge 6 commits into from

Conversation

turboFei
Copy link
Member

@turboFei turboFei commented Nov 16, 2023

🔍 Description

This pr is to support to build the application state from pod container instead of pod.

The use case is that:
For spark on k8s, the pod contains two containers.

  • one is the spark driver main container
  • the another one is a sidecar container

If the spark driver main container completed but the sidecar container not, the batch application state is always RUNNING as the pod state is NotReady.

It is not expected.

So in this pr, I want to introduce a new option config to support to build application state from the pod container.

Issue References 🔗

This pull request fixes #

Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Types of changes 🔖

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Test Plan 🧪

Behavior Without This Pull Request ⚰️

Behavior With This Pull Request 🎉

Related Unit Tests


Checklists

📝 Author Self Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • This patch was not authored or co-authored using Generative Tooling

📝 Committer Pre-Merge Checklist

  • Pull request title is okay.
  • No license issues.
  • Milestone correctly set?
  • Test coverage is ok
  • Assignees are selected.
  • Minimum number of approvals
  • No changes are requested

Be nice. Be informative.

@turboFei turboFei self-assigned this Nov 16, 2023
@turboFei turboFei added this to the v1.8.1 milestone Nov 16, 2023
@github-actions github-actions bot added the kind:documentation Documentation is a feature! label Nov 16, 2023
@pan3793 pan3793 requested a review from zwangsheng November 16, 2023 07:01
@turboFei turboFei changed the title [KUBERNETES] Support to build application state and error from pod container [K8S] Support to build application state and error from pod container Nov 16, 2023
Copy link
Contributor

@zwangsheng zwangsheng left a comment

Choose a reason for hiding this comment

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

LGTM at all and this is a good idea to check application status by container status!

But have one more question about: we set this kyuubi.kubernetes.application.state.fromContainer as server level conf, what will happen when user submit spark app with custom container name(by setting pod template and spark.kubernetes.driver.podTemplateContainerName)?

@turboFei
Copy link
Member Author

turboFei commented Nov 16, 2023

But have one more question about: we set this kyuubi.kubernetes.application.state.fromContainer as server level conf, what will happen when user submit spark app with custom container name(by setting pod template and spark.kubernetes.driver.podTemplateContainerName)?

If no container matched with the server level kyuubi.kubernetes.application.state.container, it will fallback to use the pod state to build application state.

So, I think it does not matter.

@turboFei
Copy link
Member Author

turboFei commented Nov 16, 2023

I can even ignore the user specified spark.kubernetes.driver.podTemplateContainerName in kyuubi server side.

With kyuubi conf:
kyuubi.session.conf.ignore.list and kyuubi.batch.conf.ignore.list.

@codecov-commenter
Copy link

codecov-commenter commented Nov 16, 2023

Codecov Report

Attention: 53 lines in your changes are missing coverage. Please review.

Comparison is base (88fae49) 61.40% compared to head (9e0575b) 61.32%.
Report is 1 commits behind head on master.

Files Patch % Lines
...kyuubi/engine/KubernetesApplicationOperation.scala 0.00% 49 Missing ⚠️
...uubi/engine/KubernetesApplicationAuditLogger.scala 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5711      +/-   ##
============================================
- Coverage     61.40%   61.32%   -0.09%     
  Complexity       23       23              
============================================
  Files           607      607              
  Lines         35755    35814      +59     
  Branches       4900     4909       +9     
============================================
+ Hits          21957    21963       +6     
- Misses        11413    11467      +54     
+ Partials       2385     2384       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pan3793
Copy link
Member

pan3793 commented Nov 16, 2023

If no container matched with the server level kyuubi.kubernetes.application.state.container, it will fallback to use the pod state to build application state.

such behavior should be documented clearly.

@turboFei
Copy link
Member Author

cc @pan3793 @zwangsheng

@turboFei turboFei closed this in 765cdaa Nov 17, 2023
turboFei added a commit that referenced this pull request Nov 17, 2023
…m pod container

# 🔍 Description

This pr is to support to build the application state from pod container instead of pod.

The use case is that:
For spark on k8s, the pod contains two containers.
- one is the spark driver main container
- the another one is a sidecar container

If the spark driver main container completed but the sidecar container not, the batch application state is always RUNNING as the pod state is `NotReady`.

It is not expected.

So in this pr, I want to introduce a new option config to support to build application state from the pod container.

## Issue References 🔗

This pull request fixes #

## Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

---

# Checklists
## 📝 Author Self Checklist

- [x] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project
- [x] I have performed a self-review
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

## 📝 Committer Pre-Merge Checklist

- [x] Pull request title is okay.
- [x] No license issues.
- [x] Milestone correctly set?
- [ ] Test coverage is ok
- [ ] Assignees are selected.
- [ ] Minimum number of approvals
- [ ] No changes are requested

**Be nice. Be informative.**

Closes #5711 from turboFei/k8s_pod_state.

Closes #5711

9e0575b [fwang12] save
eaec5d2 [fwang12] comment
61ae5f7 [fwang12] comment
1eac84f [fwang12] save
bca19be [fwang12] nit
38115b7 [fwang12] [K8S] Support to build application state and error from pod container

Authored-by: fwang12 <[email protected]>
Signed-off-by: fwang12 <[email protected]>
(cherry picked from commit 765cdaa)
Signed-off-by: fwang12 <[email protected]>
@turboFei turboFei deleted the k8s_pod_state branch November 17, 2023 06:48
turboFei added a commit that referenced this pull request Nov 24, 2023
# 🔍 Description

Fix typo when checking container name, and audit the pod state and container states as we support to retrieve application state from pod and container states.
## Issue References 🔗

This pull request fixes #

## Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

---

# Checklists
## 📝 Author Self Checklist

- [ ] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project
- [ ] I have performed a self-review
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

## 📝 Committer Pre-Merge Checklist

- [x] Pull request title is okay.
- [x] No license issues.
- [x] Milestone correctly set?
- [ ] Test coverage is ok
- [x] Assignees are selected.
- [x] Minimum number of approvals
- [x] No changes are requested

**Be nice. Be informative.**

Closes #5763 from turboFei/fix_typo_k8s.

Closes #5711

59b6025 [fwang12] container and pod
4ef7fc9 [fwang12] more states
301d44e [fwang12] typo

Authored-by: fwang12 <[email protected]>
Signed-off-by: fwang12 <[email protected]>
turboFei added a commit that referenced this pull request Nov 24, 2023
# 🔍 Description

Fix typo when checking container name, and audit the pod state and container states as we support to retrieve application state from pod and container states.
## Issue References 🔗

This pull request fixes #

## Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

---

# Checklists
## 📝 Author Self Checklist

- [ ] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project
- [ ] I have performed a self-review
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

## 📝 Committer Pre-Merge Checklist

- [x] Pull request title is okay.
- [x] No license issues.
- [x] Milestone correctly set?
- [ ] Test coverage is ok
- [x] Assignees are selected.
- [x] Minimum number of approvals
- [x] No changes are requested

**Be nice. Be informative.**

Closes #5763 from turboFei/fix_typo_k8s.

Closes #5711

59b6025 [fwang12] container and pod
4ef7fc9 [fwang12] more states
301d44e [fwang12] typo

Authored-by: fwang12 <[email protected]>
Signed-off-by: fwang12 <[email protected]>
(cherry picked from commit ba5cb24)
Signed-off-by: fwang12 <[email protected]>
turboFei added a commit that referenced this pull request Nov 24, 2023
# 🔍 Description
Fix typo for container states audit.
## Issue References 🔗

This pull request fixes #

## Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

---

# Checklists
## 📝 Author Self Checklist

- [ ] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project
- [ ] I have performed a self-review
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

## 📝 Committer Pre-Merge Checklist

- [ ] Pull request title is okay.
- [ ] No license issues.
- [ ] Milestone correctly set?
- [ ] Test coverage is ok
- [ ] Assignees are selected.
- [ ] Minimum number of approvals
- [ ] No changes are requested

**Be nice. Be informative.**

Closes #5770 from turboFei/fix_typo_copilot.

Closes #5711

be5181a [fwang12] fix typo

Authored-by: fwang12 <[email protected]>
Signed-off-by: fwang12 <[email protected]>
turboFei added a commit that referenced this pull request Nov 24, 2023
# 🔍 Description
Fix typo for container states audit.
## Issue References 🔗

This pull request fixes #

## Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

---

# Checklists
## 📝 Author Self Checklist

- [ ] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project
- [ ] I have performed a self-review
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

## 📝 Committer Pre-Merge Checklist

- [ ] Pull request title is okay.
- [ ] No license issues.
- [ ] Milestone correctly set?
- [ ] Test coverage is ok
- [ ] Assignees are selected.
- [ ] Minimum number of approvals
- [ ] No changes are requested

**Be nice. Be informative.**

Closes #5770 from turboFei/fix_typo_copilot.

Closes #5711

be5181a [fwang12] fix typo

Authored-by: fwang12 <[email protected]>
Signed-off-by: fwang12 <[email protected]>
(cherry picked from commit 3ca4b8a)
Signed-off-by: fwang12 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants