dcos-e2e icon indicating copy to clipboard operation
dcos-e2e copied to clipboard

Mounting of `/sys/fs/cgroup` is not necessary in Docker backend.

Open jieyu opened this issue 5 years ago • 6 comments

This allows each dc/os container to see the host cgroups. For the sake of isolation, this is not the ideal way. I don't see a reason why /sys/fs/cgroup needs to be bind mounted into the DC/OS container.

By default, in privileged mode, Docker gives you write access to the cgroup of the container itself.

There might be some tweak needed to make Mesos agent happy. This is definitely doable.

jieyu avatar Jul 27 '18 15:07 jieyu

FWIW I also don't know why this is there and it comes from the port of DC/OS Docker - see https://github.com/dcos/dcos-docker/blob/feed8d98a88262b7023c0ed98f454644360318aa/Makefile#L58.

adamtheturtle avatar Jul 29 '18 13:07 adamtheturtle

This is the original commit which added the mounting - https://github.com/dcos/dcos-docker/commit/bb568221f55808c03d8fa9821b5eeca3b1d42065. We have no context except the commit message "mount systemd all the things".

adamtheturtle avatar Oct 22 '18 13:10 adamtheturtle

The comment by the code is "# Mount cgroups into agents for Mesos DRF." from @timaa2k . Any thoughts on whether removing this would be an issue @jieyu or how to maybe get around it?

Prompted by @vishnu2kmohan 's comment "Just wanted to let you know that it doesn't work on non-systemd distributions like Gentoo with OpenRC and I need to fake mount the systemd cgroup on my machine, just to get started."

adamtheturtle avatar Oct 22 '18 13:10 adamtheturtle

I removed the mount in https://github.com/dcos/dcos-e2e/pull/1601 - let's see if this comes back to bite us! At least if it does we will know why we had this mount.

adamtheturtle avatar Jan 27 '19 17:01 adamtheturtle

When we remove the mount, and do no tinkering, we see the following when attempting to deploy Kafka.

Feb 14 15:13:40 dcos-e2e-default-4d773-agent-2 mesos-agent[1873]: E0214 15:13:40.545511  1882 cgroups.cpp:712] Failed to assign container cd4b727a-885d-4674-9f8b-8c3c39aa8d81 pid 2850 to cgroup at '/sys/fs/cgroup/cpuset/docker/6c77bd70585c35ba8c7ccdd785f15278d29fbc2a025616a5359df66f3f24e7cb/mesos/cd4b727a-885d-4674-9f8b-8c3c39aa8d81': No space left on device

@jieyu , @Gilbert88 - any ideas what tinkering we need to do.

adamtheturtle avatar Feb 15 '19 12:02 adamtheturtle

Because of the above, @mhrabovcin and I added "Mount cgroups by default, adding an option to not mount #1611". We would like to be able to offer users an option to not mount /sys/fs/cgroups while allowing them to deploy applications such as Kafka.

adamtheturtle avatar Feb 16 '19 10:02 adamtheturtle