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

throttle not happen when cpu-usage exceed nodeqos threshhold #659

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JasonChenY
Copy link

What type of PR is this?

throttle not happend when reaching nodeqos throttle threshhold

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@github-actions
Copy link
Contributor

github-actions bot commented Dec 19, 2022

🎉 Successfully Build Images.
Now Support ARM Platforms.
Comment Post Time: 2023-03-27 15:41
Git Version: 4902c97

Docker Registry

Overview: https://hub.docker.com/u/gocrane

Image Pull Command
crane-agent:pr-659-4902c97 docker pull gocrane/crane-agent:pr-659-4902c97
dashboard:pr-659-4902c97 docker pull gocrane/dashboard:pr-659-4902c97
metric-adapter:pr-659-4902c97 docker pull gocrane/metric-adapter:pr-659-4902c97
craned:pr-659-4902c97 docker pull gocrane/craned:pr-659-4902c97

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=gocrane/craned \
                   --set craned.image.tag=pr-659-4902c97 \
                   --set metricAdapter.image.repository=gocrane/metric-adapter \
                   --set metricAdapter.image.tag=pr-659-4902c97 \
                   --set craneAgent.image.repository=gocrane/crane-agent \
                   --set craneAgent.image.tag=pr-659-4902c97 \
                   --set cranedDashboard.image.repository=gocrane/dashboard \
                   --set cranedDashboard.image.tag=pr-659-4902c97 crane/crane

Coding Registry

Overview: https://finops.coding.net/public-artifacts/gocrane/crane/packages

Image Pull Command
crane-agent:pr-659-4902c97 docker pull finops-docker.pkg.coding.net/gocrane/crane/crane-agent:pr-659-4902c97
dashboard:pr-659-4902c97 docker pull finops-docker.pkg.coding.net/gocrane/crane/dashboard:pr-659-4902c97
metric-adapter:pr-659-4902c97 docker pull finops-docker.pkg.coding.net/gocrane/crane/metric-adapter:pr-659-4902c97
craned:pr-659-4902c97 docker pull finops-docker.pkg.coding.net/gocrane/crane/craned:pr-659-4902c97

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=finops-docker.pkg.coding.net/gocrane/crane/craned \
                   --set craned.image.tag=pr-659-4902c97 \
                   --set metricAdapter.image.repository=finops-docker.pkg.coding.net/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-659-4902c97 \
                   --set craneAgent.image.repository=finops-docker.pkg.coding.net/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-659-4902c97 \
                   --set cranedDashboard.image.repository=finops-docker.pkg.coding.net/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-659-4902c97 crane/crane

Ghcr Registry

Overview: https://github.com/orgs/gocrane/packages?repo_name=crane

Image Pull Command
crane-agent:pr-659-4902c97 docker pull ghcr.io/gocrane/crane/crane-agent:pr-659-4902c97
dashboard:pr-659-4902c97 docker pull ghcr.io/gocrane/crane/dashboard:pr-659-4902c97
metric-adapter:pr-659-4902c97 docker pull ghcr.io/gocrane/crane/metric-adapter:pr-659-4902c97
craned:pr-659-4902c97 docker pull ghcr.io/gocrane/crane/craned:pr-659-4902c97

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=ghcr.io/gocrane/crane/craned \
                   --set craned.image.tag=pr-659-4902c97 \
                   --set metricAdapter.image.repository=ghcr.io/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-659-4902c97 \
                   --set craneAgent.image.repository=ghcr.io/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-659-4902c97 \
                   --set cranedDashboard.image.repository=ghcr.io/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-659-4902c97 crane/crane

@chenkaiyue
Copy link
Contributor

Thanks YongGe! Can you fix according to my comments and we can merge it.

delete(result, m.Name)
} else {
klog.V(6).Infof("BuildThrottleDownWatermarkGap: For metrics %s, maxUsed is %f, watermark is %f", m.Name, maxUsed, float64(throttleDownWatermark.PopSmallest().Value()))
if throttleDownExist && throttleUpExist {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be deleted, throttleDownExist and throttleUpExist can't co-exist.

Comment on lines 220 to 223
result[m.Name] = (1 + executeExcessPercent) * (maxUsed - float64(throttleDownWatermark.PopSmallest().Value()))
}

// If metric not exist in ThrottleUpWatermark, throttleUpGapToWatermarks of metric will can't be calculated
if !throttleUpExist {
delete(result, m.Name)
} else {
// Attention: different with throttleDown and evict, use watermark - used
result[m.Name] = (1 + executeExcessPercent) * (float64(throttleUpWatermark.PopSmallest().Value()) - maxUsed)
Copy link
Contributor

Choose a reason for hiding this comment

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

And you can find result[m.Name] been assigned twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants