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

[KYUUBI #6344] FlinkProcessBuilder prioritizes user configurations #6342

Closed
wants to merge 3 commits into from

Conversation

wForget
Copy link
Member

@wForget wForget commented Apr 28, 2024

🔍 Description

Issue References 🔗

This pull request fixes #6344

FlinkProcessBuilder specifies yarn.ship-files, yarn.application.name and yarn.tags configurations of kyuubi platform. Sometimes we also need to customize these configurations, so we should prioritize these user configurations.

Describe Your Solution 🔧

FlinkProcessBuilder prioritizes user configurations.

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

added new unit test


Checklist 📝

Be nice. Be informative.

@wForget wForget changed the title FlinkProcessBuilder prioritizes user configurations [KYUUBI #6342] FlinkProcessBuilder prioritizes user configurations Apr 28, 2024
@wForget wForget self-assigned this Apr 28, 2024
@wForget wForget requested review from link3280 and pan3793 and removed request for link3280 April 28, 2024 10:28
@pan3793
Copy link
Member

pan3793 commented Apr 28, 2024

the patch involves user-facing changes, to un-confuse users and future exploeres, can you elaborate more on the background and behavior change in PR description?

@link3280
Copy link
Contributor

@wForget I have the same question with @pan3793 . Why do users need to override the yarn tags for flink applications and only flink applications? IIUC, the tags are mainly for internal usage which users rarely care about.

@wForget
Copy link
Member Author

wForget commented Apr 29, 2024

@wForget I have the same question with @pan3793 . Why do users need to override the yarn tags for flink applications and only flink applications? IIUC, the tags are mainly for internal usage which users rarely care about.

kyuubi may not directly face users, but be connected to the upper application platform. Just like kyuubi adds session id in yarn tags, we also hope to be able to add the upper application platform id into yarn tags, as well as the application name.

@wForget
Copy link
Member Author

wForget commented Apr 29, 2024

the patch involves user-facing changes, to un-confuse users and future exploeres, can you elaborate more on the background and behavior change in PR description?

In my scenario this is a bug fix, just before this change if we specified flink.yarn.ship-files=customShipFile it would override the flinkExtraJars specified in kyuubi, I think we should merge them.

Copy link
Contributor

@link3280 link3280 left a comment

Choose a reason for hiding this comment

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

@wForget Now I understand the motivation. I agree we should merge the user-specified configurations with the Kyuubi generated ones. I left some comments inline, PTAL.

@@ -115,7 +115,9 @@ object KyuubiApplicationManager {
}

private def setupFlinkYarnTag(tag: String, conf: KyuubiConf): Unit = {
val originalTag = conf.getOption(FlinkProcessBuilder.YARN_TAG_KEY).map(_ + ",").getOrElse("")
val originalTag = conf.getOption(s"flink.${FlinkProcessBuilder.YARN_TAG_KEY}")
Copy link
Contributor

@link3280 link3280 Apr 29, 2024

Choose a reason for hiding this comment

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

Could we avoid the hardcoded flink. prefix?

Copy link
Contributor

@link3280 link3280 Apr 29, 2024

Choose a reason for hiding this comment

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

BTW is this change compatible with Kyuubi's kill-application-by-tag mechanism?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could we avoid the hardcoded flink. prefix?

Sure, I will add a constant for it.

BTW is this change compatible with Kyuubi's kill-application-by-tag mechanism?

It is compatible, the previous logic also merges user-specified tags, I just added the key prefixed by flink..

@wForget wForget changed the title [KYUUBI #6342] FlinkProcessBuilder prioritizes user configurations [KYUUBI #6344] FlinkProcessBuilder prioritizes user configurations Apr 29, 2024
@wForget
Copy link
Member Author

wForget commented Apr 29, 2024

the patch involves user-facing changes, to un-confuse users and future exploeres, can you elaborate more on the background and behavior change in PR description?

In my scenario this is a bug fix, just before this change if we specified flink.yarn.ship-files=customShipFile it would override the flinkExtraJars specified in kyuubi, I think we should merge them.

Submitted an issue #6344 and recorded error details.

@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 58.43%. Comparing base (5cbbdc3) to head (feca972).
Report is 1 commits behind head on master.

Files Patch % Lines
...ache/kyuubi/engine/flink/FlinkProcessBuilder.scala 77.77% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6342      +/-   ##
============================================
- Coverage     58.45%   58.43%   -0.02%     
  Complexity       24       24              
============================================
  Files           653      653              
  Lines         39865    39889      +24     
  Branches       5481     5482       +1     
============================================
+ Hits          23303    23310       +7     
- Misses        14073    14075       +2     
- Partials       2489     2504      +15     

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

@wForget wForget requested a review from link3280 April 29, 2024 07:12
@@ -115,7 +115,10 @@ object KyuubiApplicationManager {
}

private def setupFlinkYarnTag(tag: String, conf: KyuubiConf): Unit = {
val originalTag = conf.getOption(FlinkProcessBuilder.YARN_TAG_KEY).map(_ + ",").getOrElse("")
val originalTag = conf
.getOption(s"${FlinkProcessBuilder.FLINK}.${FlinkProcessBuilder.YARN_TAG_KEY}")
Copy link
Member

Choose a reason for hiding this comment

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

even they are same string, it's for different purpose ...

Suggested change
.getOption(s"${FlinkProcessBuilder.FLINK}.${FlinkProcessBuilder.YARN_TAG_KEY}")
.getOption(s"flink.${FlinkProcessBuilder.YARN_TAG_KEY}")

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense, let’s add a FLINK_CONF_PREFIXconstant.

@@ -212,9 +220,12 @@ class FlinkProcessBuilder(
}

object FlinkProcessBuilder {
final val FLINK_EXEC_FILE = "flink"
final val FLINK = "flink"
final val APP_KEY = "flink.app.name"
Copy link
Member

Choose a reason for hiding this comment

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

why this has a flink. suffix, but others does not?

Copy link
Member Author

Choose a reason for hiding this comment

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

why this has a flink. suffix, but others does not?

Because this is not a valid flink conf, it should be:

final val YARN_APPLICATION_NAME_KEY = "yarn.application.name"

@wForget wForget requested a review from pan3793 May 10, 2024 05:26
@wForget wForget modified the milestones: v1.10.0, v1.9.1 May 14, 2024
@wForget wForget closed this in c8e6457 May 14, 2024
wForget added a commit that referenced this pull request May 14, 2024
# 🔍 Description
## Issue References 🔗

This pull request fixes #6344

`FlinkProcessBuilder` specifies `yarn.ship-files`, `yarn.application.name` and `yarn.tags` configurations of kyuubi platform. Sometimes we also need to customize these configurations, so we should prioritize these user configurations.

## Describe Your Solution 🔧

FlinkProcessBuilder prioritizes user configurations.

## Types of changes 🔖

- [x] 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

added new unit test

---

# Checklist 📝

- [X] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes #6342 from wForget/hotfix2.

Closes #6344

feca972 [wforget] address comment
17df084 [wforget] fix test and add flink constant
ece91cc [wforget] FlinkProcessBuilder prioritizes user configurations

Authored-by: wforget <643348094@qq.com>
Signed-off-by: wforget <643348094@qq.com>
(cherry picked from commit c8e6457)
Signed-off-by: wforget <643348094@qq.com>
@wForget
Copy link
Member Author

wForget commented May 14, 2024

Thanks, merged to master and branch-1.9.

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.

[Bug] ClassNotFoundException occurred when specifying flink.yarn.ship-files for flink engine
4 participants