Merge branch '8784-dir-listings'
[arvados.git] / doc / install / install-compute-node.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Install a compute node
5 ...
6 {% comment %}
7 Copyright (C) The Arvados Authors. All rights reserved.
8
9 SPDX-License-Identifier: CC-BY-SA-3.0
10 {% endcomment %}
11
12 h2. Install dependencies
13
14 First, "add the appropriate package repository for your distribution":{{ site.baseurl }}/install/install-manual-prerequisites.html#repos.
15
16 {% include 'note_python_sc' %}
17
18 On Red Hat-based systems:
19
20 <notextile>
21 <pre><code>~$ <span class="userinput">echo 'exclude=python2-llfuse' | sudo tee -a /etc/yum.conf</span>
22 ~$ <span class="userinput">sudo yum install perl python-virtualenv fuse python-arvados-python-client python-arvados-fuse crunchrunner crunchstat arvados-docker-cleaner iptables ca-certificates</span>
23 </code></pre>
24 </notextile>
25
26 On Debian-based systems:
27
28 <notextile>
29 <pre><code>~$ <span class="userinput">sudo apt-get install perl python-virtualenv fuse python-arvados-python-client python-arvados-fuse crunchrunner crunchstat arvados-docker-cleaner iptables ca-certificates</span>
30 </code></pre>
31 </notextile>
32
33 {% include 'install_compute_docker' %}
34
35 h2. Set up SLURM
36
37 Install SLURM following "the same process you used to install the Crunch dispatcher":install-crunch-dispatch.html#slurm.
38
39 h2. Copy configuration files from the dispatcher (API server)
40
41 The @slurm.conf@ and @/etc/munge/munge.key@ files need to be identical across the dispatcher and all compute nodes. Copy the files you created in the "Install the Crunch dispatcher":install-crunch-dispatch.html step to this compute node.
42
43 {% include 'install_compute_fuse' %}
44
45 {% include 'install_docker_cleaner' %}
46
47 h2. Add a Crunch user account
48
49 Create a Crunch user account, and add it to the @fuse@ and @docker@ groups so it can use those tools:
50
51 <notextile>
52 <pre><code>~$ <span class="userinput">sudo useradd --groups fuse,docker crunch</span>
53 </code></pre>
54 </notextile>
55
56 The crunch user should have the same UID, GID, and home directory across all compute nodes and the dispatcher (API server).
57
58 h2. Tell the API server about this compute node
59
60 Load your API superuser token on the compute node:
61
62 <notextile>
63 <pre><code>
64 ~$ <span class="userinput">HISTIGNORE=$HISTIGNORE:'export ARVADOS_API_TOKEN=*'</span>
65 ~$ <span class="userinput">export ARVADOS_API_TOKEN=@your-superuser-token@</span>
66 ~$ <span class="userinput">export ARVADOS_API_HOST=@uuid_prefix.your.domain@</span>
67 ~$ <span class="userinput">unset ARVADOS_API_HOST_INSECURE</span>
68 </code>
69 </pre>
70 </notextile>
71
72 Then execute this script to create a compute node object, and set up a cron job to have the compute node ping the API server every five minutes:
73
74 <notextile>
75 <pre><code>
76 #!/bin/bash
77 set -e
78 if ! test -f /root/node.json ; then
79     python - &lt;&lt;EOF
80 import arvados, json, socket
81 fqdn = socket.getfqdn()
82 hostname, _, domain = fqdn.partition('.')
83 node = arvados.api('v1').nodes().create(body={'hostname': hostname, 'domain': domain}).execute()
84 with open('/root/node.json', 'w') as node_file:
85     json.dump(node, node_file, indent=2)
86 EOF
87
88     # Make sure /dev/fuse permissions are correct (the device appears after fuse is loaded)
89     chmod 1660 /dev/fuse && chgrp fuse /dev/fuse
90 fi
91
92 UUID=`grep \"uuid\" /root/node.json  |cut -f4 -d\"`
93 PING_SECRET=`grep \"ping_secret\" /root/node.json  |cut -f4 -d\"`
94
95 if ! test -f /etc/cron.d/node_ping ; then
96     echo "*/5 * * * * root /usr/bin/curl -k -d ping_secret=$PING_SECRET https://$ARVADOS_API_HOST/arvados/v1/nodes/$UUID/ping" > /etc/cron.d/node_ping
97 fi
98
99 /usr/bin/curl -k -d ping_secret=$PING_SECRET https://$ARVADOS_API_HOST/arvados/v1/nodes/$UUID/ping?ping_secret=$PING_SECRET
100 </code>
101 </pre>
102 </notextile>
103
104 And remove your token from the environment:
105
106 <notextile>
107 <pre><code>
108 ~$ <span class="userinput">unset ARVADOS_API_TOKEN</span>
109 ~$ <span class="userinput">unset ARVADOS_API_HOST</span>
110 </code>
111 </pre>
112 </notextile>