-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cgroupns: private cgroupns on cgroupv1 breaks --systemd #17736
cgroupns: private cgroupns on cgroupv1 breaks --systemd #17736
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe 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 |
LGTM |
It seems unfortunate to just error here, I would've thought there'd be a reasonable way to get this working as expected. I left a comment on the issue, I'd be happy to discuss further - perhaps there's slight gaps in my knowledge around the finer details of cgroups, but hopefully I can bring something to the table having spent a lot of time looking into cgroups and how they're set up in a variety of scenarios across different container managers. |
unfortunate, but there is not an easy way to fix it, we'd need changes both in Podman and in the OCI runtime. Given that cgroupv1 is going to be deprecated at some point (already planning that for crun: containers/crun#1149) there is no much sense in trying to solve it IMO. The best fix is to move to cgroupv2 |
RE: cgroups v1 support, as I understand it RHEL 8 goes EOL in 2029, and uses cgroups v1 by default? Our intention is to support cgroups v1 probably for as long as it's reasonable for uses to have a host that's configured with v1 (e.g. RHEL 8 as long as it's supported). |
Sure it is supported until RHEL EOL but that is about security fixes. The current one is more a new feature that affects two components and to correctly implement it, also changes to the OCI runtime specs. With cgroup v2 you also get proper cgroup support for rootless, which is not possible for cgroup v1, and containers are not really contained since you cannot apply any limit to them. Especially for rootless, there is no point for using cgroup v1 unless you are stuck with an old system |
dd02698
to
8726988
Compare
I made a change to the patch. Now if you specify a If you handle the cgroup by yourself, then you are able to use systemd with a new cgroup namespace:
|
8726988
to
c47b780
Compare
LGTM |
@test "podman --systemd fails on cgroup v1 with a private cgroupns" { | ||
skip_if_cgroupsv2 | ||
|
||
run_podman 126 run --systemd=always --cgroupns=private $IMAGE true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add assert "$output" =~ "blah blah blah blah"
. 126 can happen for many reasons, it is important to verify that it's happening here for the expected reason.
LGTM |
LGTM
…On Mon, Mar 13, 2023 at 09:37 Urvashi Mohnani ***@***.***> wrote:
LGTM
—
Reply to this email directly, view it on GitHub
<#17736 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCC2MYU2BIMZHLZDHR3W34PKHANCNFSM6AAAAAAVW5TGHE>
.
You are receiving this because you are on a team that was mentioned.Message
ID: ***@***.***>
|
c47b780
to
97f6c5b
Compare
the error is already clear. Signed-off-by: Giuseppe Scrivano <[email protected]>
On cgroup v1 we need to mount only the systemd named hierarchy as writeable, so we configure the OCI runtime to mount /sys/fs/cgroup as read-only and on top of that bind mount /sys/fs/cgroup/systemd. But when we use a private cgroupns, we cannot do that since we don't know the final cgroup path. Also, do not override the mount if there is already one for /sys/fs/cgroup/systemd. Closes: containers#17727 Signed-off-by: Giuseppe Scrivano <[email protected]>
97f6c5b
to
2d1f4a8
Compare
/lgtm |
/hold cancel |
On cgroup v1 we need to mount only the systemd named hierarchy as writeable, so we configure the OCI runtime to mount /sys/fs/cgroup as read-only and on top of that bind mount /sys/fs/cgroup/systemd.
But when we use a private cgroupns, we cannot do that since we don't know the final cgroup path.
Closes: #17727
Does this PR introduce a user-facing change?