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

Precise execution according to waterline #216

Merged
merged 1 commit into from
Jun 20, 2022

Conversation

chenkaiyue
Copy link
Contributor

@chenkaiyue chenkaiyue commented Mar 21, 2022

What type of PR is this?

Feature

What this PR does / why we need it:

Add waterline for precise execution, select how many pods will be executed.

The sort logic will be put into executor module use with waterline.

Proposal: #357

Some things to complete

@chenkaiyue chenkaiyue changed the title [WIP]Add waterline for precise execution [WIP]Precise execution according to waterline Mar 21, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2022

🎉 Successfully Build Images.

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

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

@chenkaiyue chenkaiyue changed the title [WIP]Precise execution according to waterline Precise execution according to waterline May 9, 2022
@yan234280533
Copy link
Contributor

Please have a square for the commits.

@yan234280533
Copy link
Contributor

What relationship between this PR and PR #201 ? Is this PR depends on PR #201 to be merged into the main branch?

pkg/ensurance/analyzer/analyzer.go Show resolved Hide resolved
pkg/utils/util.go Outdated Show resolved Hide resolved
pkg/utils/pod.go Show resolved Hide resolved
pkg/utils/pod.go Outdated Show resolved Hide resolved
pkg/resource/pod_resource_manger.go Show resolved Hide resolved
pkg/ensurance/executor/waterline_test.go Show resolved Hide resolved
pkg/ensurance/executor/waterline.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/waterline.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/waterline.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/evict.go Show resolved Hide resolved
pkg/ensurance/executor/waterline.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/waterline.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/waterline.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/waterline.go Outdated Show resolved Hide resolved
if !evictExist {
delete(eviceGapToWaterLines, string(m))
} else {
eviceGapToWaterLines[string(m)] = maxUsed - float64(evictWaterLine.PopSmallest().Value())
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we need to sort first of the throttleExecutor, we pop the first, but named smallest

@yan234280533
Copy link
Contributor

Can we write a proposal, and reviewed the proposal first before reviewing this PR? I had confused by the GapToWaterLine and the sort.

@chenkaiyue
Copy link
Contributor Author

chenkaiyue commented Jun 13, 2022

Test result for precisely evict.
企业微信截图_fce37134-caee-40fe-abfe-9d97df16ecb8

@chenkaiyue
Copy link
Contributor Author

chenkaiyue commented Jun 13, 2022

Test result for precisely throttle down.
企业微信截图_f2a88d85-824e-4989-aae3-3d6eec2d75f0

@chenkaiyue
Copy link
Contributor Author

chenkaiyue commented Jun 13, 2022

Test result for precisely throttle up.
企业微信截图_702767de-77e5-4d6c-ad8e-3e5ab7defb8a

@zsnmwy
Copy link
Member

zsnmwy commented Jun 13, 2022

How about writing some overview for these pics?
Makes the whole logic flow smoothly.

@chenkaiyue
Copy link
Contributor Author

How about writing some overview for these pics? Makes the whole logic flow smoothly.

Ok, these pics are test results, i have added some comments. This pr has a related proposal #357, thx~

Copy link

@jordy1024 jordy1024 left a comment

Choose a reason for hiding this comment

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

Hi,pull requests that are too big can be difficult to review effectively.
here are some suggestions to make code readable.

pkg/utils/util.go Outdated Show resolved Hide resolved
pkg/utils/pod.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/waterline_test.go Show resolved Hide resolved
pkg/ensurance/executor/waterline.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/waterline.go Show resolved Hide resolved
pkg/ensurance/analyzer/analyzer.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/analyzer.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/analyzer.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/cpu_usage.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/cpu_usage.go Show resolved Hide resolved
@chenkaiyue
Copy link
Contributor Author

Hi,pull requests that are too big can be difficult to review effectively. here are some suggestions to make code readable.

Thanks for your code review! There are so many helpful comments! I have fixed them. Thx!

@chenkaiyue chenkaiyue force-pushed the action-on-difference branch 2 times, most recently from c9fe84b to 60813ac Compare June 17, 2022 06:44
cmd/crane-agent/app/options/option.go Show resolved Hide resolved
cmd/crane-agent/app/options/option.go Show resolved Hide resolved
pkg/agent/agent.go Show resolved Hide resolved
pkg/ensurance/analyzer/analyzer.go Show resolved Hide resolved
pkg/ensurance/executor/waterline.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/evict.go Show resolved Hide resolved
pkg/ensurance/executor/evict.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/throttle.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/throttle.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/throttle.go Outdated Show resolved Hide resolved
@yan234280533
Copy link
Contributor

Because of the complexity of this requirement, let's merge into the PR first, and we can continue to discuss it on the PR and propose a new PR for modification. Thanks very much to everyone.

@yan234280533
Copy link
Contributor

/LGTM

@yan234280533 yan234280533 merged commit bc31728 into gocrane:main Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants