9406: Add -cgroup-parent-subsystem argument.
authorTom Clegg <tom@curoverse.com>
Tue, 2 Aug 2016 13:42:07 +0000 (09:42 -0400)
committerTom Clegg <tom@curoverse.com>
Tue, 2 Aug 2016 13:42:07 +0000 (09:42 -0400)
commit5df1299bef79cbae96aecfd710a8d2cc088e4ecd
tree235aaf3a0da1591a35865e42098c6dd3652c0563
parent483ca35ac4348924cfbc187dab4f1b88a272eea7
9406: Add -cgroup-parent-subsystem argument.

This accommodates setups where the scheduling system (e.g., SLURM)
uses cgroups to impose resource limits on crunch-run itself, and those
limits are meant to include resources used by the container itself.

Normally, when docker creates a container, it creates new cgroups
inside the "docker" cgroup, which circumvents any resource limits set
on crunch-run's own cgroup.

If a subsystem is specified (e.g., -cgroup-parent-subsystem=memory),
crunch-run will look in /proc/self/cgroup to find the current cgroup
for the given subsystem, and instruct docker to use that cgroup as the
parent of the new container's cgroup instead.
services/crunch-run/cgroup.go [new file with mode: 0644]
services/crunch-run/cgroup_test.go [new file with mode: 0644]
services/crunch-run/crunchrun.go