Skip to content

Always launch docker containers in the correct parent cgroup#1118

Merged
ssalinas merged 3 commits into
HubSpot:masterfrom
PaulFurtado:launch_docker_in_correct_parent_group
Jul 15, 2016
Merged

Always launch docker containers in the correct parent cgroup#1118
ssalinas merged 3 commits into
HubSpot:masterfrom
PaulFurtado:launch_docker_in_correct_parent_group

Conversation

@PaulFurtado

Copy link
Copy Markdown
Member

Currently, the docker executor script hardcodes the parent cgroup of a docker container to mesos/$CGROUPS_GUID. This change makes it instead discover the cgroup using /proc/self/cgroup per the reccommendation of: https://www.freedesktop.org/wiki/Software/systemd/PaxControlGroups/

This change also removes the code for setting memory.use_hierarchy=1 because it is ineffective (you can see the warnings in the logs on our mesos slaves). In order to set that property, it must be set on the root cgroup, before any child cgroups are created. My internal changes to cgroups on our mesos slaves takes care of that and all child cgroups inherit the property.

@ssalinas @tpetr Going to try to test this myself tonight, might need your help with the Singularity bits tomorrow. I tested that function pretty thoroughly so I expect this to just work.

Currently, the docker executor script hardcodes the parent cgroup of a docker
container to "mesos/$CGROUPS_GUID". This change makes it instead discover the
cgroup using "/proc/self/cgroup" per the reccommendation of:
  https://www.freedesktop.org/wiki/Software/systemd/PaxControlGroups/

This change also removes the code for setting memory.use_hierarchy=1 because
it is ineffective. In order to set that property, it must be set on the root
cgroup, before any child cgroups are created. My internal changes to cgroups
on our mesos slaves takes care of that and all child cgroups inherit the
property.
@ssalinas

ssalinas commented Jul 1, 2016

Copy link
Copy Markdown
Contributor

👍 I can test this further. Nitpick, but can we update the examples to be non-hubspot-specific? Other than that looks good, thanks for the cgroup expertise!

@PaulFurtado

Copy link
Copy Markdown
Member Author

@ssalinas 👍 Got rid of the reference to HubSpot in the example

@ssalinas ssalinas merged commit c43a9c0 into HubSpot:master Jul 15, 2016
@ssalinas ssalinas added this to the 0.9.0 milestone Jul 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants