From: Brett Smith Date: Tue, 9 Aug 2016 17:58:41 +0000 (-0400) Subject: 9705: Add docker-cleaner unit file to Install Guide. X-Git-Tag: 1.1.0~777^2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/728faddf2628bf1ee9123a0673cb75f4d2ce74fe 9705: Add docker-cleaner unit file to Install Guide. --- diff --git a/doc/_includes/_install_docker_cleaner.liquid b/doc/_includes/_install_docker_cleaner.liquid index e26b2be586..5671a54ad5 100644 --- a/doc/_includes/_install_docker_cleaner.liquid +++ b/doc/_includes/_install_docker_cleaner.liquid @@ -6,34 +6,36 @@ The arvados-docker-cleaner program removes least recently used Docker images as 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@. {% include 'notebox_end' %} -Install runit to supervise the Docker cleaner daemon. {% include 'install_runit' %} - -Configure runit to run the image cleaner using a suitable quota for your compute nodes and workload: +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. -
~$ sudo mkdir -p /etc/sv
-~$ cd /etc/sv
-/etc/sv$ sudo mkdir arvados-docker-cleaner; cd arvados-docker-cleaner
-/etc/sv/arvados-docker-cleaner$ sudo mkdir log log/main
-/etc/sv/arvados-docker-cleaner$ sudo sh -c 'cat >log/run' <<'EOF'
-#!/bin/sh
-exec svlogd -tt main
-EOF
-/etc/sv/arvados-docker-cleaner$ sudo sh -c 'cat >run' <<'EOF'
-#!/bin/sh
-if [ -d /opt/rh/python33 ]; then
-  source scl_source enable python33
-fi
-exec python3 -m arvados_docker.cleaner --quota 50G
-EOF
-/etc/sv/arvados-docker-cleaner$ sudo chmod +x run log/run
-/etc/sv/arvados-docker-cleaner$ sudo ln -s "$(pwd)" /etc/service/
+
[Service]
+# Most deployments will want a quota that's at least 10G.  From there,
+# a larger quota can help reduce compute overhead by preventing reloading
+# the same Docker image repeatedly, but will leave less space for other
+# files on the same storage (usually Docker volumes).  Make sure the quota
+# is less than the total space available for Docker images.
+# If your deployment uses a Python 3 Software Collection, uncomment the
+# ExecStart line below, and delete the following one:
+# ExecStart=scl enable python33 "python3 -m arvados_docker.cleaner --quota 20G"
+ExecStart=python3 -m arvados_docker.cleaner --quota 20G
+Restart=always
+RestartPreventExitStatus=2
+
+[Install]
+WantedBy=default.target
+
+[Unit]
+After=docker.service
 
-If you are using a different daemon supervisor, or if you want to test the daemon in a terminal window, an equivalent shell command to run arvados-docker-cleaner is: +Then enable and start the service: -
python3 -m arvados_docker.cleaner --quota 50G
+
~$ sudo systemctl enable arvados-docker-cleaner.service
+~$ sudo systemctl start arvados-docker-cleaner.service
 
+ +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.