Crunch2 installation » History » Version 5
Tom Clegg, 06/17/2016 03:10 PM
| 1 | 1 | Tom Clegg | h1. Crunch2 installation |
|---|---|---|---|
| 2 | |||
| 3 | (DRAFT -- when ready, this will move to doc.arvados.org→install) |
||
| 4 | |||
| 5 | 2 | Tom Clegg | {{toc}} |
| 6 | |||
| 7 | h2. Set up a crunch-dispatch service |
||
| 8 | |||
| 9 | Currently, dispatching containers via SLURM is supported. |
||
| 10 | |||
| 11 | Install crunch-dispatch-slurm on a node that can submit SLURM jobs. This can be the slurm controller node, a worker node, or any other node that has the appropriate SLURM/munge configuration. |
||
| 12 | |||
| 13 | <pre><code class="shell"> |
||
| 14 | sudo apt-get install crunch-dispatch-slurm |
||
| 15 | </code></pre> |
||
| 16 | |||
| 17 | Create a privileged token for use by the dispatcher. If you have multiple dispatch processes, you should give each one a different token. |
||
| 18 | |||
| 19 | <pre><code class="shell"> |
||
| 20 | apiserver:~$ cd /var/www/arvados-api/current |
||
| 21 | apiserver:/var/www/arvados-api/current$ sudo -u webserver-user RAILS_ENV=production bundle exec script/create_superuser_token.rb |
||
| 22 | zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz |
||
| 23 | </code></pre> |
||
| 24 | |||
| 25 | 4 | Tom Clegg | Save the token on the dispatch node, in <code>/etc/sv/crunch-dispatch-slurm/env/ARVADOS_API_TOKEN</code> |
| 26 | 2 | Tom Clegg | |
| 27 | 4 | Tom Clegg | Example runit script (@/etc/sv/crunch-dispatch-slurm/run@): |
| 28 | 2 | Tom Clegg | |
| 29 | 1 | Tom Clegg | <pre><code class="shell"> |
| 30 | #!/bin/sh |
||
| 31 | 4 | Tom Clegg | set -e |
| 32 | exec 2>&1 |
||
| 33 | 2 | Tom Clegg | |
| 34 | export ARVADOS_API_HOST=uuid_prefix.your.domain |
||
| 35 | |||
| 36 | exec chpst -e ./env -u crunch crunch-dispatch-slurm |
||
| 37 | </code></pre> |
||
| 38 | |||
| 39 | Ensure the @crunch@ user exists -- and has the same UID, GID, and home directory -- on the dispatch node and all SLURM compute nodes. Ensure the @crunch@ user can run docker containers on SLURM compute nodes. |
||
| 40 | |||
| 41 | 3 | Tom Clegg | h2. Install crunch-run on all compute nodes |
| 42 | 1 | Tom Clegg | |
| 43 | 3 | Tom Clegg | <pre><code class="shell"> |
| 44 | sudo apt-get install crunch-run |
||
| 45 | </code></pre> |
||
| 46 | |||
| 47 | 1 | Tom Clegg | h2. Enable cgroup accounting on all compute nodes |
| 48 | |||
| 49 | 4 | Tom Clegg | (This requirement isn't new for crunch2/containers, but it seems to be a FAQ. The Docker install guide mentions it's optional and performance-degrading, so it's not too surprising if people skip it. Perhaps we should say why/when it's a good idea to enable it?) |
| 50 | |||
| 51 | 3 | Tom Clegg | Check https://docs.docker.com/engine/installation/linux/ for instructions specific to your distribution. |
| 52 | |||
| 53 | For example, on Ubuntu: |
||
| 54 | # Update @/etc/default/grub@ to include: <pre> |
||
| 55 | GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1" |
||
| 56 | </pre> |
||
| 57 | # @sudo update-grub@ |
||
| 58 | # Reboot |
||
| 59 | 2 | Tom Clegg | |
| 60 | 1 | Tom Clegg | h2. Configure docker |
| 61 | |||
| 62 | 4 | Tom Clegg | Unchanged from current docs. |
| 63 | |||
| 64 | 1 | Tom Clegg | h2. Test the dispatcher |
| 65 | 4 | Tom Clegg | |
| 66 | 5 | Tom Clegg | On the dispatch node, monitor the crunch-dispatch logs. |
| 67 | 4 | Tom Clegg | |
| 68 | <pre><code class="shell"> |
||
| 69 | dispatch-node$ tail -F /etc/sv/crunch-dispatch-slurm/log/main/current |
||
| 70 | </code></pre> |
||
| 71 | |||
| 72 | 5 | Tom Clegg | On a shell VM, install a docker image for testing. |
| 73 | 1 | Tom Clegg | |
| 74 | <pre><code class="shell"> |
||
| 75 | 5 | Tom Clegg | user@shellvm:~$ arv-keepdocker busybox |
| 76 | </code></pre> |
||
| 77 | |||
| 78 | On a shell VM, run a trivial container. |
||
| 79 | |||
| 80 | <pre><code class="shell"> |
||
| 81 | 4 | Tom Clegg | user@shellvm:~$ arv container_request create --container-request '{ |
| 82 | 1 | Tom Clegg | "name": "test", |
| 83 | 4 | Tom Clegg | "state": "Committed", |
| 84 | "priority": 1, |
||
| 85 | 5 | Tom Clegg | "container_image": "busybox", |
| 86 | 4 | Tom Clegg | "command": ["echo", "OK"] |
| 87 | }' |
||
| 88 | </code></pre> |