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

workspace quota for project #2283

Merged
merged 55 commits into from
Oct 18, 2021
Merged

Conversation

dspo
Copy link
Contributor

@dspo dspo commented Oct 9, 2021

What type of this PR

Add one of the following kinds:
/kind feature
/kind bug
/kind polish
/kind document

What this PR does / why we need it:

Which issue(s) this PR fixes:

  • Fixes #your-issue_number
  • [Erda Cloud Issue Link](paste your link here)

Specified Reviewers:

/assign @your-reviewer

ChangeLog

Language Changelog
🇺🇸 English The project resource quota is migrated to workspace resource quota.
🇨🇳 中文 项目资源配额改为项目环境资源配额.

Need cherry-pick to release versions?

Add comment like /cherry-pick release/1.0 when this PR is merged.

For details on the cherry pick process, see the cherry pick requests section under CONTRIBUTING.md.

@dspo dspo marked this pull request as draft October 9, 2021 09:08
@dspo dspo requested a review from johnlanni October 9, 2021 09:12
@dspo dspo added dop devops plaoform feature labels Oct 9, 2021
@codecov
Copy link

codecov bot commented Oct 9, 2021

Codecov Report

Merging #2283 (023452a) into master (245cdd9) will decrease coverage by 0.18%.
The diff coverage is 18.60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2283      +/-   ##
==========================================
- Coverage   15.95%   15.77%   -0.19%     
==========================================
  Files        1200     1218      +18     
  Lines      119058   123234    +4176     
==========================================
+ Hits        18999    19437     +438     
- Misses      98115   101796    +3681     
- Partials     1944     2001      +57     
Impacted Files Coverage Δ
apistructs/org.go 0.00% <ø> (ø)
apistructs/pods_info.go 0.00% <0.00%> (ø)
apistructs/project.go 0.00% <0.00%> (ø)
apistructs/project_quota.go 0.00% <0.00%> (ø)
apistructs/steve.go 0.00% <ø> (ø)
.../components/cmp-dashboard-nodes/cpuTable/render.go 12.16% <0.00%> (ø)
.../components/cmp-dashboard-nodes/memTable/render.go 11.82% <0.00%> (ø)
.../components/cmp-dashboard-nodes/podTable/render.go 13.81% <0.00%> (ø)
...p-dashboard-workloads-list/workloadTable/render.go 58.59% <0.00%> (ø)
modules/cmp/component-protocol/cputil/util.go 47.52% <ø> (+23.15%) ⬆️
... and 58 more

@dspo dspo marked this pull request as ready for review October 18, 2021 06:33
johnlanni
johnlanni previously approved these changes Oct 18, 2021
pkg/resourcecalculator/calculator.go Outdated Show resolved Hide resolved
pkg/resourcecalculator/calculator.go Outdated Show resolved Hide resolved
@johnlanni
Copy link
Contributor

/approve

@erda-bot erda-bot merged commit b64824f into erda-project:master Oct 18, 2021
@johnlanni
Copy link
Contributor

/cherry-pick release/1.3

@erda-bot
Copy link
Member

Automated cherry pick failed, please resolve the confilcts and create PR manually.
Details:

Auto-merging modules/core/monitor/alert/alert-apis/adapt/alert_test.go
Auto-merging modules/cmp/steve_request.go
Auto-merging modules/cmp/provider.go
Auto-merging modules/cmp/component-protocol/components/cmp-dashboard-nodes/podTable/render.go
Auto-merging modules/cmp/component-protocol/components/cmp-dashboard-nodes/memTable/render.go
Auto-merging modules/cmp/component-protocol/components/cmp-dashboard-nodes/cpuTable/render.go
Auto-merging conf/cmp/cmp.yaml
CONFLICT (content): Merge conflict in conf/cmp/cmp.yaml
diff --cc conf/cmp/cmp.yaml
index c07494bb,71f7db75..00000000
--- a/conf/cmp/cmp.yaml
+++ b/conf/cmp/cmp.yaml
@@@ -79,6 -79,12 +79,15 @@@ grpc-client@erda.core.monitor.metric
    addr: "${MONITOR_GRPC_ADDR:monitor:7080}"
  erda.core.monitor.metric-client:
  
++<<<<<<< HEAD
++=======
+ # core service credential
+ grpc-client@erda.core.services.authentication.credentials.accesskey:
+   addr: "${CORE_SERVICES_GRPC_ADDR:core-services:9537}"
+   block: false
+ erda.core.services.authentication.credentials.accesskey-client:
+ 
++>>>>>>> b64824f4 (workspace quota for project (#2283))
  http-server:
    addr: ":9028"
    allow_cors: true

johnlanni pushed a commit to johnlanni/erda that referenced this pull request Oct 21, 2021
* feature: add workspace quota for project model

* feature: add model ps_group_projects_quota

* feature: add orm s_pod_info

* feature: add fetch resource proto

* feature: fetch resource

* feature: Preliminary completion of the interface for querying cluster resources

* feature: create project api on core-service side

* feature: update the api for updating project

* feature: update the api for updating project

* feature: project details

* feature: delete project

* feature: project detail tips

* feature: add PrepareCheckProjectResource todo comment

* feature: config cmp grpc client

* feature: add quota migration

* feature:fix client addredd

* feature: fix client address config yaml

* fix:core-service config

* feature: fix core-service config yaml

* feature: fix grpc-client config

* feature: block false

* feature: rename resourceConfig

* feature: block false

* feature: update proto

* feature: update proto

* feature: udpate with proto

* fix: modify cluster resource and namespace resource response

* fix: typo

* fix: typo

* feature: add log

* fix: typo

* feature: unit transfered

* fix: json tag

* feature: add logs

* fix: license

* fix: NaN in json

* fature: fmt

* fix: query condition

* feature: add log

* rm .erda/migrations/core-services/20211014-project-quota.py

* feature: add ut

* feat: check quota

* add get all namespaces

* add get workspace quota

* modify quota unit

* remove resource precheck in orchestrator

* feature: dedup cluster names

* fix: license

* feature: change quota algorithm

* feature: add ut

* add log

* fix: GetWorkspaceQuota url path

* modify apistruct

* get runtimeID by instanceID for addon

* fix: chinese in error info

Co-authored-by: Craig <476479827@qq.com>
johnlanni added a commit that referenced this pull request Oct 21, 2021
* workspace quota for project (#2283)

* feature: add workspace quota for project model

* feature: add model ps_group_projects_quota

* feature: add orm s_pod_info

* feature: add fetch resource proto

* feature: fetch resource

* feature: Preliminary completion of the interface for querying cluster resources

* feature: create project api on core-service side

* feature: update the api for updating project

* feature: update the api for updating project

* feature: project details

* feature: delete project

* feature: project detail tips

* feature: add PrepareCheckProjectResource todo comment

* feature: config cmp grpc client

* feature: add quota migration

* feature:fix client addredd

* feature: fix client address config yaml

* fix:core-service config

* feature: fix core-service config yaml

* feature: fix grpc-client config

* feature: block false

* feature: rename resourceConfig

* feature: block false

* feature: update proto

* feature: update proto

* feature: udpate with proto

* fix: modify cluster resource and namespace resource response

* fix: typo

* fix: typo

* feature: add log

* fix: typo

* feature: unit transfered

* fix: json tag

* feature: add logs

* fix: license

* fix: NaN in json

* fature: fmt

* fix: query condition

* feature: add log

* rm .erda/migrations/core-services/20211014-project-quota.py

* feature: add ut

* feat: check quota

* add get all namespaces

* add get workspace quota

* modify quota unit

* remove resource precheck in orchestrator

* feature: dedup cluster names

* fix: license

* feature: change quota algorithm

* feature: add ut

* add log

* fix: GetWorkspaceQuota url path

* modify apistruct

* get runtimeID by instanceID for addon

* fix: chinese in error info

Co-authored-by: Craig <476479827@qq.com>

* add grpc port for cmp (#2431)

* Feature/read permission (#2437)

* feat: change read permission to get, list and watch all resources

* fix: read api-server host and port from env

* fix: get k8sNamespace rather than namespace in s-pod-info (#2444)

* fix update project quota error; i18n; tips (#2449)

* feature: add workspace quota for project model

* feature: add model ps_group_projects_quota

* feature: fetch resource

* feature: Preliminary completion of the interface for querying cluster resources

* feature: project details

* feature: add quota migration

* feature: update proto

* rm .erda/migrations/core-services/20211014-project-quota.py

* feat: check quota

* add get all namespaces

* add get workspace quota

* feature: add tips and i18n

* feature: add tips

* fix: project model

* fix: tips

* feature: fix update project quota error

* feature: i18n

* feature: add ut

* fix: unit

Co-authored-by: Craig <476479827@qq.com>

* Bugfix/scheduler (#2459)

* fix: create db client failed in scheduler

* fix panic

* fix i18n language codes error (#2457)

* feature: add workspace quota for project model

* fix: langCodes error

fix: available resource calcus

* feature: fix ut

* Feature/quota audit (#2465)

* feat: add quota audit

* add result in audit

* fix pods table and workload table panic

* add project quota migration file

* fix: query org name (#2468)

* feature: add workspace quota for project model

* fix: langCodes error

fix: available resource calcus

* fix: query org name

* feature: add ut

* fix: audit time

* feature: add ut

Co-authored-by: 悟空 <rainchan365@163.com>
Co-authored-by: Craig <476479827@qq.com>
Co-authored-by: CMC <49681321+CraigMChen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants