Skip to content

[Feature][Improvement] Support multi cluster environments - k8s type#10096

Merged
Amy0104 merged 19 commits intoapache:devfrom
qianli2022:Feature-9544-v1
Jun 15, 2022
Merged

[Feature][Improvement] Support multi cluster environments - k8s type#10096
Amy0104 merged 19 commits intoapache:devfrom
qianli2022:Feature-9544-v1

Conversation

@qianli2022
Copy link
Copy Markdown
Contributor

@qianli2022 qianli2022 commented May 18, 2022

Purpose of the pull request

Adding a cluster configuration, a cluster configuration with k8s etc. Currently only k8s multi-clusters are supported.

Brief change log

  • Add ClusterServiceImpl.java
  • Add ClusterController.java
  • Add ClusterMapper.java
  • Add cluster-modal.tsx

Verify this pull request

This change added tests and can be verified as follows:

  • Added ClusterControllerTest.
  • Added ClusterServiceTest.
  • Added ClusterMapperTest

close #9462

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 18, 2022

Codecov Report

Merging #10096 (b8201ce) into dev (3258438) will increase coverage by 0.32%.
The diff coverage is 83.82%.

@@             Coverage Diff              @@
##                dev   #10096      +/-   ##
============================================
+ Coverage     40.56%   40.89%   +0.32%     
- Complexity     4766     4848      +82     
============================================
  Files           877      883       +6     
  Lines         35621    35970     +349     
  Branches       3945     3991      +46     
============================================
+ Hits          14449    14709     +260     
- Misses        19737    19807      +70     
- Partials       1435     1454      +19     
Impacted Files Coverage Δ
...che/dolphinscheduler/api/k8s/K8sClientService.java 6.38% <0.00%> (ø)
...olphinscheduler/common/utils/ClusterConfUtils.java 0.00% <0.00%> (ø)
...scheduler/api/service/impl/ClusterServiceImpl.java 88.28% <88.28%> (ø)
...hinscheduler/api/controller/ClusterController.java 89.47% <89.47%> (ø)
...rg/apache/dolphinscheduler/api/dto/ClusterDto.java 92.85% <92.85%> (ø)
.../org/apache/dolphinscheduler/api/enums/Status.java 100.00% <100.00%> (ø)
...rg/apache/dolphinscheduler/dao/entity/Cluster.java 100.00% <100.00%> (ø)
...pache/dolphinscheduler/service/corn/CronUtils.java 64.77% <0.00%> (-5.60%) ⬇️
...cheduler/api/service/impl/ExecutorServiceImpl.java 40.10% <0.00%> (-2.59%) ⬇️
...org/apache/dolphinscheduler/remote/utils/Host.java 37.77% <0.00%> (-2.23%) ⬇️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3258438...b8201ce. Read the comment docs.

@qianli2022 qianli2022 requested a review from kezhenxu94 as a code owner May 25, 2022 02:06
Comment on lines +53 to +56
/**
* cluster controller
* todo 这是新增的 集群环境
*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove this kind of comments, they are meaningless

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just remove the chinese comments , or all of them? I find that all other classes are commented with xx controller?

@kezhenxu94
Copy link
Copy Markdown
Member

Hi @qianli2022 , thank you, do you have an issue to link to the feature discussion?

@qianli2022
Copy link
Copy Markdown
Contributor Author

Hi @qianli2022 , thank you, do you have an issue to link to the feature discussion?
Yes, [Feature][Improvement] Support multi cluster environments](#9462)

@qianli2022 qianli2022 requested a review from kezhenxu94 May 25, 2022 06:58
@SbloodyS SbloodyS requested review from Amy0104 and songjianet June 3, 2022 14:44
@caishunfeng caishunfeng requested a review from lenboo June 6, 2022 03:03
@caishunfeng caishunfeng added the miss:docs missing documents in PR label Jun 6, 2022
@SbloodyS SbloodyS added backend e2e e2e test UI ui and front end related labels Jun 8, 2022
@caishunfeng
Copy link
Copy Markdown
Contributor

PTAL @lenboo @zhongjiajie @songjianet

@caishunfeng caishunfeng removed the miss:docs missing documents in PR label Jun 8, 2022
@qianli2022
Copy link
Copy Markdown
Contributor Author

I find some test classes are not counted in the unit coverage, so git show the insufficient coverage error

@caishunfeng
Copy link
Copy Markdown
Contributor

I find some test classes are not counted in the unit coverage, so git show the insufficient coverage error

I had rerun the UT to check the test converage.

@qianli2022 qianli2022 requested a review from caishunfeng June 10, 2022 06:49
WangJPLeo
WangJPLeo previously approved these changes Jun 11, 2022
Copy link
Copy Markdown
Contributor

@WangJPLeo WangJPLeo left a comment

Choose a reason for hiding this comment

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

Hello, after the cluster should belong to the scope of data permissions, we will refactor function permissions and resource permissions in the next version, the purpose is to facilitate the expansion and customization of functional permissions and data permissions. You can Under the dev' branch, you can see the method of unified management of permissions in ResourcePermissionCheckService. I hope you can optimize the permission management of the cluster in the future, thank you.

caishunfeng
caishunfeng previously approved these changes Jun 13, 2022
Copy link
Copy Markdown
Contributor

@caishunfeng caishunfeng left a comment

Choose a reason for hiding this comment

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

LGTM of the backend part.
BTW, this is a very complete pr 👍

@qianli2022
Copy link
Copy Markdown
Contributor Author

qianli2022 commented Jun 13, 2022

Hello, after the cluster should belong to the scope of data permissions, we will refactor function permissions and resource permissions in the next version, the purpose is to facilitate the expansion and customization of functional permissions and data permissions. You can Under the dev' branch, you can see the method of unified management of permissions in ResourcePermissionCheckService. I hope you can optimize the permission management of the cluster in the future, thank you.

OK,next pr will be namespace using multiple clusters, which will include permissions, and I will follow your latest permissions design.

@tongwl tongwl dismissed stale reviews from caishunfeng and WangJPLeo via 7a6be45 June 15, 2022 02:44
Amy0104 added 3 commits June 15, 2022 11:24
use Nspace instead of css.
Remove the style.
Remove the useless file.
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

88.8% 88.8% Coverage
6.4% 6.4% Duplication

@tongwl
Copy link
Copy Markdown
Contributor

tongwl commented Jun 15, 2022

@Amy0104, thank you for your review, very nice catching :)

I also have some suggestions:
as we are only contributors, not owners, so our new code style is best to refer to the existing code, this will make the project code management clearer. So it would be even better if all the similar pages using the similar template, this pr front-end code is copied from the environment page. Obviously, the environment code can't be recognized by project owners, it does have some small areas that can be optimized. For our contributors, we'd better not be unconventional, but keep the same way of code writing style.

@Amy0104
Copy link
Copy Markdown
Member

Amy0104 commented Jun 15, 2022

Thanks for your suggestion. We will try to make the pages to a small template later.

Copy link
Copy Markdown
Member

@Amy0104 Amy0104 left a comment

Choose a reason for hiding this comment

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

LGTM.

@Amy0104 Amy0104 added this to the 3.1.0-alpha milestone Jun 15, 2022
@Amy0104 Amy0104 merged commit ff065d8 into apache:dev Jun 15, 2022
hstdream pushed a commit to hstdream/dolphinscheduler that referenced this pull request Jun 23, 2022
…pache#10096)

* service code

* [Feature][UI] Add front-end for cluster manage

* fix e2e

* remove comment on cluster controller

* doc

* img

* setting e2e.yaml

* test

* rerun e2e

* fix bug from comment

* Update index.tsx

use Nspace instead of css.

* Update index.tsx

Remove the style.

* Delete index.module.scss

Remove the useless file.

Co-authored-by: qianl4 <qianl4@cicso.com>
Co-authored-by: William Tong <weitong@cisco.com>
Co-authored-by: Amy0104 <97265214+Amy0104@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend e2e e2e test UI ui and front end related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature][Improvement] Support multi cluster environments

8 participants