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

Sort pods to be executed in multi dimensions #201

Closed
wants to merge 1 commit into from

Conversation

chenkaiyue
Copy link
Contributor

@chenkaiyue chenkaiyue commented Mar 12, 2022

What type of PR is this?

Feature

What this PR does / why we need it:

  1. Sort pods to be executed by multi dimensions
  2. Sort func orders can be customized

@chenkaiyue chenkaiyue changed the title Sort pods to be executed in multi dimensions Sort pods to be executed in customizable multi dimensions Mar 12, 2022
@chenkaiyue chenkaiyue force-pushed the sort-port branch 4 times, most recently from 6dfd3dd to d42e963 Compare March 13, 2022 03:14
pkg/ensurance/analyzer/sort/evict-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/throttle-sort.go Outdated Show resolved Hide resolved
cmd/crane-agent/app/options/option.go Outdated Show resolved Hide resolved
cmd/crane-agent/app/options/option.go Outdated Show resolved Hide resolved
cmd/crane-agent/app/options/option.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/evict-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/evict-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/evict-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/evict-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/evict-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/evict-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/evict-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/evict-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/throttle-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/throttle-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/evict-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/evict-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/sort/throttle-sort.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/pod_info.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/pod_info.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/pod_info.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/analyzer.go Outdated Show resolved Hide resolved
@chenkaiyue
Copy link
Contributor Author

As discussed with @mfanjie, we do not need to make custom rank options now, and just make users easy to use, so i delete custom options related codes.

@chenkaiyue chenkaiyue changed the title Sort pods to be executed in customizable multi dimensions Sort pods to be executed in multi dimensions Mar 21, 2022
@qmhu qmhu added this to the 0.4.0 milestone Mar 28, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2022

🎉 Successfully Build Images.

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

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

pkg/ensurance/analyzer/analyzer.go Outdated Show resolved Hide resolved
// combine the replicated pod
combineEvictDuplicate(&ae.EvictExecutor, evictPods)
}
}

// sort the throttle executor by pod qos priority
sort.Sort(ae.ThrottleExecutor.ThrottleDownPods)
sort.Sort(sort.Reverse(ae.ThrottleExecutor.ThrottleUpPods))
execsort.CpuMetricsSorter(ae.ThrottleExecutor.ThrottleDownPods)
Copy link
Contributor

Choose a reason for hiding this comment

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

why it's cpu sorter? if there is other metrics, do you need sort again? should you have a more generic function for sorting?

package sort

import (
"k8s.io/klog/v2"
Copy link
Contributor

Choose a reason for hiding this comment

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

org import

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.

4 participants