Skip to content

Conversation

@xdu-chenrj
Copy link
Contributor

@xdu-chenrj xdu-chenrj commented Nov 3, 2023

close #15114
Fix k8sTask ExecutionContext setting configYaml

@xdu-chenrj
Copy link
Contributor Author

I fixed this issue using other methods, but there may be other issues. Please review :D

@Radeity
Copy link
Member

Radeity commented Nov 4, 2023

Hi @xdu-chenrj , I don't understand how you fix it. Actually, there's nothing wrong with K8S task, but for Spark on K8S, k8sTaskExecutionContext.getConnectionParams() is null.

In addition, for other types of task which use K8sTaskExecutionContext, like Kubeflow, you should better replace the current way to declare the Kubernetes cluster with your connection center.

@xdu-chenrj
Copy link
Contributor Author

xdu-chenrj commented Nov 5, 2023

Hi @xdu-chenrj , I don't understand how you fix it. Actually, there's nothing wrong with K8S task, but for Spark on K8S, k8sTaskExecutionContext.getConnectionParams() is null.

In addition, for other types of task which use K8sTaskExecutionContext, like Kubeflow, you should better replace the current way to declare the Kubernetes cluster with your connection center.

I will use the Spark task to further correct my fix

@Radeity
Copy link
Member

Radeity commented Nov 5, 2023

I will use the Spark task to further correct my fix

I thought you mainly fix it in this PR, and why setting configYaml is relevant to the bug description in issue?

@xdu-chenrj
Copy link
Contributor Author

I will use the Spark task to further correct my fix

I thought you mainly fix it in this PR, and why setting configYaml is relevant to the bug description in issue?

we need to fix all tasks that use the k8s namespace, such as the Spark task. i didn't get what you meant before. i just looked at some parameters required to create the Spark task. the namespace selected for the previous spark task was created in the cluster management of the security center. now, the Spark task needs to select the k8s connection created in the connection center. we need to refactor other tasks that use the k8s namespace, just like we refactor the k8s task, what do you think?

@Radeity
Copy link
Member

Radeity commented Nov 5, 2023

we need to fix all tasks that use the k8s namespace, such as the Spark task. i didn't get what you meant before. i just looked at some parameters required to create the Spark task. the namespace selected for the previous spark task was created in the cluster management of the security center. now, the Spark task needs to select the k8s connection created in the connection center. we need to refactor other tasks that use the k8s namespace, just like we refactor the k8s task, what do you think?

For Spark on K8S, connectionParams in k8sTaskExecutionContext is null, cuz k8sTaskExecutionContext is constructed in Master, and don't set any value during construction which will cause NPE.

k8sTaskExecutionContext
                .setConfigYaml(JSONUtils.getNodeString(k8sTaskExecutionContext.getConnectionParams(), "kubeConfig"));

@xdu-chenrj
Copy link
Contributor Author

we need to fix all tasks that use the k8s namespace, such as the Spark task. i didn't get what you meant before. i just looked at some parameters required to create the Spark task. the namespace selected for the previous spark task was created in the cluster management of the security center. now, the Spark task needs to select the k8s connection created in the connection center. we need to refactor other tasks that use the k8s namespace, just like we refactor the k8s task, what do you think?

For Spark on K8S, connectionParams in k8sTaskExecutionContext is null, cuz k8sTaskExecutionContext is constructed in Master, and don't set any value during construction which will cause NPE.

k8sTaskExecutionContext
                .setConfigYaml(JSONUtils.getNodeString(k8sTaskExecutionContext.getConnectionParams(), "kubeConfig"));

I have made this modification to the current code

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2023

Codecov Report

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

Comparison is base (159179a) 37.80% compared to head (28af50c) 37.81%.

❗ Current head 28af50c differs from pull request most recent head c9a6a01. Consider uploading reports for the commit c9a6a01 to get more accurate results

Files Patch % Lines
...plugin/task/api/parameters/AbstractParameters.java 0.00% 6 Missing ⚠️
...uler/plugin/task/api/k8s/impl/K8sTaskExecutor.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##                dev   #15116   +/-   ##
=========================================
  Coverage     37.80%   37.81%           
  Complexity     4701     4701           
=========================================
  Files          1304     1304           
  Lines         45219    45217    -2     
  Branches       4859     4859           
=========================================
+ Hits          17097    17099    +2     
+ Misses        26259    26255    -4     
  Partials       1863     1863           

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

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

30.8% 30.8% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@Radeity
Copy link
Member

Radeity commented Nov 11, 2023

I have made this modification to the current code

I'm still confused, you should modify this part to avoid NPE

k8sTaskExecutionContext
                .setConfigYaml(JSONUtils.getNodeString(k8sTaskExecutionContext.getConnectionParams(), "kubeConfig"));

OR

replace original way to use K8S cluster in other tasks(Spark, KUBEFLOW) with your connection way.

In current PR, I don't get how you solve the problem.

@xdu-chenrj
Copy link
Contributor Author

I have made this modification to the current code

I'm still confused, you should modify this part to avoid NPE

k8sTaskExecutionContext
                .setConfigYaml(JSONUtils.getNodeString(k8sTaskExecutionContext.getConnectionParams(), "kubeConfig"));

OR

replace original way to use K8S cluster in other tasks(Spark, KUBEFLOW) with your connection way.

In current PR, I don't get how you solve the problem.

I think the current solution to this problem can only be achieved by adding special judgments until the Spark and Kubelow tasks are refactored

Radeity
Radeity previously approved these changes Nov 16, 2023
Copy link
Member

@Radeity Radeity left a comment

Choose a reason for hiding this comment

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

LGTM

@Radeity
Copy link
Member

Radeity commented Nov 17, 2023

Please run mvn spotless:apply.

@xdu-chenrj
Copy link
Contributor Author

Please run mvn spotless:apply.

sorry

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

22.2% Coverage on New Code (required ≥ 60%)

See analysis details on SonarCloud

@Radeity Radeity added the bug Something isn't working label Dec 14, 2023
@Radeity Radeity merged commit ce11674 into apache:dev Dec 14, 2023
Wei-Alwayers pushed a commit to Wei-Alwayers/dolphinscheduler that referenced this pull request Dec 15, 2023
fix typo bug in JSONUtils.java

add DBType dolphindb

spotless apply & modify ui

fix mvn package OK

TO DO: Modify DolphinDBDataSourceProcessor

fix datasource bug -> connect OK

[Improvement-15260][dolphinscheduler-datasource-hana] add hana  related dependencies (apache#15260)

* add hana related dependencies

* optimizing HANA data source bugs

* run mvn spotless:apply

* Fix hana datasource getValidationQuery()

* Fix hana datasource testGetJdbcUrl()

---------

Co-authored-by: xujiaqiang <“[email protected]”>
Co-authored-by: David Zollo <[email protected]>

[Feature-15248][dolphinscheduler-alert-plugins] add alert plugin aliyun-voice (apache#15248)

* add alert aliyun-voice

* VoiceParam replace these with lombok @DaTa

* security.ts add alarm_instance params

* optimize alert aliyun vocie code

* Merge Code

* rollback pnpm-lock.yaml to branch :origin/dev version

* add the doc about the new plugin

* add com.aliyun.dyvmsapi20170525 version 2.14

* completed

* run mvn spotless:apply

* Code optimization

* Change to @DaTa

* Code specification optimization

* add com.aliyund.yvmsapi20170525.jar license

* modify com.aliyund.yvmsapi20170525.jar license

* modify com.aliyund.yvmsapi20170525.jar license

* add aliyun-vocie licenses

* add aliyun-voice link to docsdev.js

* modify vocie module to aliyunVoice

* add lisense

---------

Co-authored-by: xujiaqiang <“[email protected]”>
Co-authored-by: 旺阳 <[email protected]>
Co-authored-by: David Zollo <[email protected]>

[Feature-15146][dolphinscheduler-task-sqoop] add sqoop source/target type (apache#15146)

* task list: sgoop node params  optimize

* security.ts  add  alarm_instance params

* 1 add SqoopTask params
2 add alert plugin aliyun-voice

* add license header

* commit sqhoop optimize

* pnpm-locl.yaml supplement annotation

* remove irrelevent commit.

* Code specification optimization

* optimize sqoop task ui

* Merge Code

* add the license header to  pnpm-locl.yaml

* format the code

* format the code

* Fix sqoop task echo error

---------

Co-authored-by: xujiaqiang <[email protected]>
Co-authored-by: xujiaqiang <“[email protected]”>
Co-authored-by: David Zollo <[email protected]>

finishgit add dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/DataSourceConstants.java

Fix k8sTaskExecutionContext setting configYaml (apache#15116)

* fixed the issue of obtaining kubeConfig of k8s tasks

* removed excess files

* removed excess files

* formatted the code

---------

Co-authored-by: xiangzihao <[email protected]>
Co-authored-by: Aaron Wang <[email protected]>
Wei-Alwayers pushed a commit to Wei-Alwayers/dolphinscheduler that referenced this pull request Dec 15, 2023
fix typo bug in JSONUtils.java

add DBType dolphindb

spotless apply & modify ui

fix mvn package OK

TO DO: Modify DolphinDBDataSourceProcessor

fix datasource bug -> connect OK

[Improvement-15260][dolphinscheduler-datasource-hana] add hana  related dependencies (apache#15260)

* add hana related dependencies

* optimizing HANA data source bugs

* run mvn spotless:apply

* Fix hana datasource getValidationQuery()

* Fix hana datasource testGetJdbcUrl()

---------

Co-authored-by: xujiaqiang <“[email protected]”>
Co-authored-by: David Zollo <[email protected]>

[Feature-15248][dolphinscheduler-alert-plugins] add alert plugin aliyun-voice (apache#15248)

* add alert aliyun-voice

* VoiceParam replace these with lombok @DaTa

* security.ts add alarm_instance params

* optimize alert aliyun vocie code

* Merge Code

* rollback pnpm-lock.yaml to branch :origin/dev version

* add the doc about the new plugin

* add com.aliyun.dyvmsapi20170525 version 2.14

* completed

* run mvn spotless:apply

* Code optimization

* Change to @DaTa

* Code specification optimization

* add com.aliyund.yvmsapi20170525.jar license

* modify com.aliyund.yvmsapi20170525.jar license

* modify com.aliyund.yvmsapi20170525.jar license

* add aliyun-vocie licenses

* add aliyun-voice link to docsdev.js

* modify vocie module to aliyunVoice

* add lisense

---------

Co-authored-by: xujiaqiang <“[email protected]”>
Co-authored-by: 旺阳 <[email protected]>
Co-authored-by: David Zollo <[email protected]>

[Feature-15146][dolphinscheduler-task-sqoop] add sqoop source/target type (apache#15146)

* task list: sgoop node params  optimize

* security.ts  add  alarm_instance params

* 1 add SqoopTask params
2 add alert plugin aliyun-voice

* add license header

* commit sqhoop optimize

* pnpm-locl.yaml supplement annotation

* remove irrelevent commit.

* Code specification optimization

* optimize sqoop task ui

* Merge Code

* add the license header to  pnpm-locl.yaml

* format the code

* format the code

* Fix sqoop task echo error

---------

Co-authored-by: xujiaqiang <[email protected]>
Co-authored-by: xujiaqiang <“[email protected]”>
Co-authored-by: David Zollo <[email protected]>

finishgit add dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/DataSourceConstants.java

Fix k8sTaskExecutionContext setting configYaml (apache#15116)

* fixed the issue of obtaining kubeConfig of k8s tasks

* removed excess files

* removed excess files

* formatted the code

---------

Co-authored-by: xiangzihao <[email protected]>
Co-authored-by: Aaron Wang <[email protected]>
zhongjiajie added a commit that referenced this pull request Feb 6, 2024
zhongjiajie added a commit to zhongjiajie/dolphinscheduler that referenced this pull request Feb 7, 2024
zhongjiajie added a commit that referenced this pull request Feb 7, 2024
* Revert "Fix k8sTaskExecutionContext setting configYaml (#15116)"

This reverts commit ce11674.

* Revert "[Improvement] Refactoring K8S task plugin with connections managed in connection center (#14977)"

This reverts commit c532fea.
@SbloodyS SbloodyS changed the title Fix k8sTaskExecutionContext setting configYaml [Fix] Fix k8sTaskExecutionContext setting configYaml Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] K8sTaskExecutionContext incorrectly set configYaml

4 participants