9701: Merge branch '9463-change-arvput-use-collection-class' into 9701-collection...
[arvados.git] / doc / _includes / _install_docker_cleaner.liquid
1 h2. Configure the Docker cleaner
2
3 The arvados-docker-cleaner program removes least recently used Docker images as needed to keep disk usage below a configured limit.
4
5 {% include 'notebox_begin' %}
6 This also removes all containers as soon as they exit, as if they were run with @docker run --rm@. If you need to debug or inspect containers after they stop, temporarily stop arvados-docker-cleaner or run it with @--remove-stopped-containers never@.
7 {% include 'notebox_end' %}
8
9 Create a file @/etc/systemd/system/arvados-docker-cleaner.service@ in an editor.  Include the text below as its contents.  Make sure to edit the @ExecStart@ line appropriately for your compute node.
10
11 <notextile>
12 <pre><code>[Service]
13 # Most deployments will want a quota that's at least 10G.  From there,
14 # a larger quota can help reduce compute overhead by preventing reloading
15 # the same Docker image repeatedly, but will leave less space for other
16 # files on the same storage (usually Docker volumes).  Make sure the quota
17 # is less than the total space available for Docker images.
18 # If your deployment uses a Python 3 Software Collection, uncomment the
19 # ExecStart line below, and delete the following one:
20 # ExecStart=scl enable python33 "python3 -m arvados_docker.cleaner --quota <span class="userinput">20G</span>"
21 ExecStart=python3 -m arvados_docker.cleaner --quota <span class="userinput">20G</span>
22 Restart=always
23 RestartPreventExitStatus=2
24
25 [Install]
26 WantedBy=default.target
27
28 [Unit]
29 After=docker.service
30 </code></pre>
31 </notextile>
32
33 Then enable and start the service:
34
35 <notextile>
36 <pre><code>~$ <span class="userinput">sudo systemctl enable arvados-docker-cleaner.service</span>
37 ~$ <span class="userinput">sudo systemctl start arvados-docker-cleaner.service</span>
38 </code></pre>
39 </notextile>
40
41 If you are using a different daemon supervisor, or if you want to test the daemon in a terminal window, use the command on the @ExecStart@ line above.