Set up Docker

Configure Linux cgroups accounting

Linux can report what compute resources are used by processes in a specific cgroup or Docker container. Crunch can use these reports to share that information with users running compute work. This can help pipeline authors debug and optimize their workflows.

To enable cgroups accounting, you must boot Linux with the command line parameters cgroup_enable=memory swapaccount=1.

After making changes, reboot the system to make these changes effective.

Red Hat and CentOS

~$ sudo grubby --update-kernel=ALL --args='cgroup_enable=memory swapaccount=1'

Debian and Ubuntu

Open the file /etc/default/grub in an editor. Find where the string GRUB_CMDLINE_LINUX is set. Add cgroup_enable=memory swapaccount=1 to that string. Save the file and exit the editor. Then run:

~$ sudo update-grub

Install Docker

Compute nodes must have Docker installed to run containers. This requires a relatively recent version of Linux (at least upstream version 3.10, or a distribution version with the appropriate patches backported). Follow the Docker Engine installation documentation for your distribution.

Make sure Docker is enabled to start on boot:

# systemctl enable --now docker

Configure the Docker daemon

Depending on your anticipated workload or cluster configuration, you may need to tweak Docker options.

For information about how to set configuration options for the Docker daemon, see https://docs.docker.com/config/daemon/systemd/

Changing ulimits

Docker containers inherit ulimits from the Docker daemon. However, the ulimits for a single Unix daemon may not accommodate a long-running Crunch job. You may want to increase default limits for compute containers by passing --default-ulimit options to the Docker daemon. For example, to allow containers to open 10,000 files, set --default-ulimit nofile=10000:10000.


Previous: Install Nginx

The content of this documentation is licensed under the Creative Commons Attribution-Share Alike 3.0 United States licence.
Code samples in this documentation are licensed under the Apache License, Version 2.0.