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