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

Improve understandability of kubelet's cpu accumulator code #121499

Merged

Conversation

matte21
Copy link
Contributor

@matte21 matte21 commented Oct 25, 2023

What type of PR is this?

/kind documentation
/kind cleanup

What this PR does / why we need it:

The cpu accumulator logic (that select CPUs for containers) has some non-obvious code (as someone reading it for the first time it took me a long time to understand it).
This PR adds some comments to make that code easier to understand for new contributors.

There are also some minor renames of functions and variables to improve readability.

Special notes for your reviewer:

The comments are very verbose. Perhaps we can streamline them.

Does this PR introduce a user-facing change?

NONE

The cpu accumulator logic (that select CPUs for containers)
has some non-obvious code.
This commit adds some comments to make that code easier to
understand for new contributors. Some minor renames to
improve readability are also performed.
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/documentation Categorizes issue or PR as related to documentation. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 25, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @matte21. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 25, 2023
@matte21 matte21 changed the title Improve understandability of kubelet's cpu accumulator Improve understandability of kubelet's cpu accumulator code Oct 25, 2023
@ffromani
Copy link
Contributor

/ok-to-test
/triage accepted
/priority backlog

code documentation is fine and everything else looks like trivial renames.
I'll have a proper review later on

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 25, 2023
@bart0sh bart0sh added this to Done in SIG Node PR Triage Oct 25, 2023
@bart0sh bart0sh moved this from Done to Triage in SIG Node PR Triage Oct 25, 2023
@matte21
Copy link
Contributor Author

matte21 commented Oct 25, 2023

/retest

@bart0sh bart0sh moved this from Triage to Needs Reviewer in SIG Node PR Triage Oct 26, 2023
Copy link
Contributor

@swatisehgal swatisehgal left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 26, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 5d8dfa81b4ed549a405389a528e532b285fbfacf

@matte21
Copy link
Contributor Author

matte21 commented Oct 26, 2023

/assign @derekwaynecarr

@haircommander haircommander moved this from Needs Reviewer to Needs Approver in SIG Node PR Triage Oct 26, 2023
Copy link
Member

Choose a reason for hiding this comment

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

/lgtm

@matte21
Copy link
Contributor Author

matte21 commented Nov 9, 2023

@rajibmitra @swatisehgal @ffromani can someone add this to milestone 1.29 so that it can be merged?

1 similar comment
@matte21
Copy link
Contributor Author

matte21 commented Nov 27, 2023

@rajibmitra @swatisehgal @ffromani can someone add this to milestone 1.29 so that it can be merged?

@matte21
Copy link
Contributor Author

matte21 commented Dec 20, 2023

@ffromani
Copy link
Contributor

cc @rajibmitra @swatisehgal @ffromani

Hi! the change already got LGTM'd. Only leads can add or remove to the milestone. CC @mrunalp @SergeyKanzhelev .
It's probably easier to wayt for the 1.30 to open and this change should merge automatically.

@matte21
Copy link
Contributor Author

matte21 commented Dec 20, 2023

Thanks for the information!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Hemen0, matte21, mrunalp, rajibmitra

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 25, 2024
@k8s-ci-robot k8s-ci-robot merged commit 3da22db into kubernetes:master Jan 25, 2024
14 checks passed
SIG Node PR Triage automation moved this from Needs Approver to Done Jan 25, 2024
@k8s-ci-robot k8s-ci-robot added this to the v1.30 milestone Jan 25, 2024
@matte21 matte21 deleted the add-comments-to-cpu-accumulator branch January 26, 2024 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

8 participants