Skip to content

kubelet/cm: bump runc/libcontainer to 1.1.0#107149

Closed
kolyshkin wants to merge 1 commit intokubernetes:masterfrom
kolyshkin:cm-refactor
Closed

kubelet/cm: bump runc/libcontainer to 1.1.0#107149
kolyshkin wants to merge 1 commit intokubernetes:masterfrom
kolyshkin:cm-refactor

Conversation

@kolyshkin
Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin commented Dec 20, 2021

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

TL;DR: simplify/improve cgroup management code in kubelet/cm. Bump to runc 1.1.0.

This updates vendored runc/libcontainer to 1.1.0
(release notes at https://github.com/opencontainers/runc/releases)
and google/cadvisor to a version with PR google/cadvisor#3031 merged.

Changes in vendor are generated by (roughly):

  ./hack/pin-dependency.sh github.com/google/cadvisor v0.44.0
  ./hack/pin-dependency.sh github.com/opencontainers/runc v1.1.0
  ./hack/update-vendor.sh
  ./hack/lint-dependencies.sh # And follow all its recommendations.
  ./hack/update-vendor.sh
  ./hack/update-internal-modules.sh
  ./hack/lint-dependencies.sh # Re-check everything again.

Changes in pkg/kubelet/cm are to adopt new runc 1.1 libcontainer/cgroups
APIs and build on its improvements. In particular:

  • simplify cgroup manager instantiation, using a new, easier way of
    libcontainers/cgroups/manager.New;

  • replace libcontainerAdapter with a boolean variable (all it did
    was passing on whether systemd manager should be used);

  • trivial change due to removed cgroupfs.HugePageSizes and added
    cgroups.HugePageSizes();

  • do not calculate cgroup paths in update / destroy, since libcontainer
    cgroup managers now calculate the paths upon creation (previously,
    they were doing that only in Apply, so using e.g. Set or Destroy right
    after creation was impossible without specifying paths).
    🔔 We currently still calculate cgroup paths in Exists -- this is to be
    addressed separately.

Which issue(s) this PR fixes:

none

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Switch to opencontainers/runc/libcontainer v1.1.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

none

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. 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-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 20, 2021
@k8s-ci-robot k8s-ci-robot added 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 Dec 20, 2021
@kolyshkin
Copy link
Copy Markdown
Contributor Author

/retest

@kolyshkin
Copy link
Copy Markdown
Contributor Author

OK, it works with these 4 commits. Let's add more.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 21, 2021
@kolyshkin
Copy link
Copy Markdown
Contributor Author

/test pull-kubernetes-integration

@kolyshkin
Copy link
Copy Markdown
Contributor Author

The TestCronJobLaunchesPodAndCleansUp failure in pull-kubernetes-integration seems to be an unrelated (but recent) flake, first observed in #106909 (comment)

/test pull-kubernetes-integration

@k8s-ci-robot k8s-ci-robot added area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubectl area/test sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. labels Dec 23, 2021
@kolyshkin
Copy link
Copy Markdown
Contributor Author

/retest

@kolyshkin
Copy link
Copy Markdown
Contributor Author

/test pull-kubernetes-node-crio-cgrpv2-e2e
/test pull-kubernetes-node-crio-e2e
/test pull-kubernetes-node-crio-cgrpv2-e2e-kubetest2
/test pull-kubernetes-node-crio-e2e-kubetest2
/test pull-kubernetes-node-kubelet-serial-topology-manager
/test pull-kubernetes-node-kubelet-serial-cpu-manager
/test pull-kubernetes-node-memoryqos-cgrpv2
/test pull-kubernetes-node-kubelet-serial-hugepages
/test pull-kubernetes-node-swap-fedora-serial
/test pull-kubernetes-node-kubelet-serial-crio-cgroupv2
/test pull-kubernetes-node-kubelet-serial-crio-cgroupv1
/test pull-kubernetes-node-kubelet-serial-memory-manager
/test pull-kubernetes-node-swap-fedora
/test pull-kubernetes-node-swap-ubuntu-serial

@kolyshkin
Copy link
Copy Markdown
Contributor Author

I'm not sure what to make of test failures -- are all of them currently broken?

@pacoxu
Copy link
Copy Markdown
Member

pacoxu commented Mar 8, 2022

I'm not sure what to make of test failures -- are all of them currently broken?

I think it is related to kubernetes/test-infra#24798

Copy link
Copy Markdown
Member

@odinuge odinuge left a comment

Choose a reason for hiding this comment

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

Took an initial look, and it looks ok at first glance. The runc changes are so big this time, so haven't had a deep dive into them, but I think @kolyshkin have more control on that front than me. I am leaning towards splitting the other non-bump-related changes to separate PR(s), but I think a lot of them are valuable. Feedback from other reviewers would be appreciated. I do have a few questions tho.

The CI situation is kinda sad, and I would prefer if it was sorted before merging this. The failing suites are the one testing cgroup v2 and systemd support, and having them working is kinda important. Do you know if someone are working actively on fixing it @pacoxu?

Comment thread pkg/kubelet/cm/cgroup_manager_linux.go Outdated
Comment thread pkg/kubelet/cm/cgroup_manager_linux.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 on this change. Can we keep it as a separate PR tho? In case we have to revert the bump, or we start seeing problems, it is easier if they are separated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Again, this is a separate commit.

I'm not very familiar with kubernetes processes. Isn't it possible to revert separate commits, rather than the whole PR?

Comment thread pkg/kubelet/cm/cgroup_manager_linux.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same applies here. I am fairly sure this is totally fine, but I think I would personally prefer if we kept it separate from the bump if possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a separate commit (I guess you are not reviewing this commit-by-commit, since this is the first commit).

I can certainly move it out to a separate PR and made this one a draft waiting for that other PR to be merged. Same for other 5 preparatory commits.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a separate commit (I guess you are not reviewing this commit-by-commit, since this is the first commit).

Yeah, thanks for doing that! I definitely prefer your style of doing it with separate commits with well defined commit messages! I am a huge fan of that, thanks!

I can certainly move it out to a separate PR and made this one a draft waiting for that other PR to be merged. Same for other 5 preparatory commits.

Thanks. The only worry is doing a lot of these cleanups in the same PR as a big dependency change; mostly for being (better) able to bisect the CI running on the master branch, as well as the "work" of reverting if we have to do that. Other than for dependency changes or verrry big PRs, I do prefer your style waay over the alternative. Again, thanks for doing this!

Comment thread pkg/kubelet/cm/cgroup_manager_linux.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This change looks ok as well. Would tho prefer to keep it separated from the bump, since it looks like it is a noop change of how things work. If others disagree with me, its fine, and we can keep it

Comment thread pkg/kubelet/cm/cgroup_manager_linux.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 on this change, especially since it reduce runtime of the destroy code path. As with the other ones, I don't think this is related to the runc bump is it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 on this. Good catch!

Comment thread pkg/kubelet/cm/node_container_manager_linux.go Outdated
Comment thread cmd/kubelet/app/server.go Outdated
@kolyshkin
Copy link
Copy Markdown
Contributor Author

This PR is 6 commits, of which 5 are preparatory/cleanup, and the last one is the actual runc bump. I guess it makes more sense if you can review it commit by commit.

I can move these preparatory commits out of this PR (and make this one a draft until those commits are merged, and then do a rebase and mark it as ready for review).

@odinuge Would you prefer a separate PR for each of the 5 prep commits, or a single PR for all of them?

@kolyshkin
Copy link
Copy Markdown
Contributor Author

Rebased.

@kolyshkin
Copy link
Copy Markdown
Contributor Author

@odinuge Would you prefer a separate PR for each of the 5 prep commits, or a single PR for all of them?

Did a single PR: #108597; PTAL

@kolyshkin
Copy link
Copy Markdown
Contributor Author

Rebased.

@odinuge
Copy link
Copy Markdown
Member

odinuge commented Mar 21, 2022

Did a single PR: #108597; PTAL

Thanks @kolyshkin! Reviewed that one separately. Feel free to hide (or what it is called on github) my earlier PR reviews, since they no longer apply to this PR.

I am still a bit worried about kubernetes/test-infra#24798 still being broken, meaning we have no CI signal for cgroup v2 (I still don't think we have cgroup v2 containerd tests, but I might be wrong..), the systemd cgroup driver or cri-o...

This updates vendored runc/libcontainer to 1.1.0,
and google/cadvisor to a version updated to runc 1.1.0-rc1
(google/cadvisor#3031).

Changes in vendor are generated by (roughly):

	./hack/pin-dependency.sh github.com/google/cadvisor v0.44.0
	./hack/pin-dependency.sh github.com/opencontainers/runc v1.1.0
	./hack/update-vendor.sh
	./hack/lint-dependencies.sh # And follow all its recommendations.
	./hack/update-vendor.sh
	./hack/update-internal-modules.sh
	./hack/lint-dependencies.sh # Re-check everything again.

The changes (mostly in pkg/kubelet/cm) are there to adopt changed
runc 1.1 API, and simplify things a bit. In particular:

1. simplify cgroup manager instantiation, using a new, easier way of
   libcontainers/cgroups/manager.New;

2. replace libcontainerAdapter with a boolean variable (all it did
   was passing on whether systemd manager should be used);

3. trivial change due to removed cgroupfs.HugePageSizes and added
    cgroups.HugePageSizes();

4. do not calculate cgroup paths in update / destroy, since libcontainer
   cgroup managers now calculate the paths upon creation (previously,
   they were doing that only in Apply, so using e.g. Set or Destroy right
   after creation was impossible without specifying paths).

We currently still calculate cgroup paths in Exists -- this is to be
addressed separately.

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin
Copy link
Copy Markdown
Contributor Author

Rebased on top of just-merged #108597; no longer a draft

Copy link
Copy Markdown
Member

@odinuge odinuge left a comment

Choose a reason for hiding this comment

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

Changes looks good to me now! I have looked through the code with the previous regressions we have seen, and I haven't found any red flags this time. Thanks for pushing @kolyshkin

/lgtm

But lets hold some time to let the CI run for the other changes (eg. this run https://prow.k8s.io/view/gs/kubernetes-jenkins/logs/ci-cos-cgroupv2-containerd-node-e2e-serial/1506700583120146432 of ci-cos-cgroupv2-containerd-node-e2e-serial).

Feel free to unhold when we have CI confidence about the other change.
/hold

@odinuge
Copy link
Copy Markdown
Member

odinuge commented Mar 23, 2022

/ok-to-test

@odinuge
Copy link
Copy Markdown
Member

odinuge commented Mar 23, 2022

And lets test this one that failed;

/test pull-kubernetes-node-swap-ubuntu-serial

As well as this one that should pass;

/test pull-kubernetes-node-kubelet-serial-containerd

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: giuseppe, kolyshkin, odinuge
To complete the pull request process, please ask for approval from smarterclayton after the PR has been reviewed.

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

Details 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
Copy link
Copy Markdown
Contributor

k8s-ci-robot commented Mar 23, 2022

@kolyshkin: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-node-kubelet-serial-crio-cgroupv2 a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-kubelet-serial-crio-cgroupv2
pull-kubernetes-node-crio-cgrpv2-e2e a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-crio-cgrpv2-e2e
pull-kubernetes-node-kubelet-serial-crio-cgroupv1 a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-kubelet-serial-crio-cgroupv1
pull-kubernetes-node-kubelet-serial-cpu-manager a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-kubelet-serial-cpu-manager
pull-kubernetes-node-kubelet-serial-topology-manager a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-kubelet-serial-topology-manager
pull-kubernetes-node-kubelet-serial-hugepages a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-kubelet-serial-hugepages
pull-kubernetes-node-kubelet-serial-memory-manager a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-kubelet-serial-memory-manager
pull-kubernetes-node-memoryqos-cgrpv2 a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-memoryqos-cgrpv2
pull-kubernetes-node-crio-e2e a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-crio-e2e
pull-kubernetes-node-crio-cgrpv2-e2e-kubetest2 a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-crio-cgrpv2-e2e-kubetest2
pull-kubernetes-node-swap-fedora a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-swap-fedora
pull-kubernetes-node-crio-e2e-kubetest2 a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-crio-e2e-kubetest2
pull-kubernetes-node-swap-fedora-serial a19343d4bb8b6924763361685a67bba4c75ec414 link false /test pull-kubernetes-node-swap-fedora-serial

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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. I understand the commands that are listed here.

@ehashman
Copy link
Copy Markdown
Member

ehashman commented Mar 24, 2022

/milestone v1.24

@kolyshkin can you please remove draft status on the PR and s/Switch/Update/ in the change note as well as noting the cadvisor version bump?

@odinuge
Copy link
Copy Markdown
Member

odinuge commented Mar 24, 2022

/retest

@ehashman
Copy link
Copy Markdown
Member

I think this needs rebase...

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@kolyshkin: PR needs rebase.

Details

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.

@bobbypage
Copy link
Copy Markdown
Member

This has been replaced with #109029

@bobbypage
Copy link
Copy Markdown
Member

/close

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@bobbypage: Closed this PR.

Details

In response to this:

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubectl area/kubelet area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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.