closes #6013
[arvados.git] / doc / install / install-crunch-dispatch.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Install the Crunch dispatcher
5
6 ...
7
8
9
10 The dispatcher normally runs on the same host/VM as the API server.
11
12 h4. Perl SDK dependencies
13
14 Install the Perl SDK on the controller.
15
16 * See "Perl SDK":{{site.baseurl}}/sdk/perl/index.html page for details.
17
18 h4. Python SDK dependencies
19
20 Install the Python SDK and CLI tools on controller and all compute nodes.
21
22 * See "Python SDK":{{site.baseurl}}/sdk/python/sdk-python.html page for details.
23
24 h4. Slurm
25
26 On the API server, install slurm and munge, and generate a munge key:
27
28 <notextile>
29 <pre><code>~$ <span class="userinput">sudo /usr/bin/apt-get install slurm-llnl munge</span>
30 ~$ <span class="userinput">sudo /usr/sbin/create-munge-key</span>
31 </code></pre>
32 </notextile>
33
34 Now we need to give slurm a configuration file in @/etc/slurm-llnl/slurm.conf@. Here's an example:
35
36 <notextile>
37 <pre>
38 ControlMachine=uuid_prefix.your.domain
39 SlurmctldPort=6817
40 SlurmdPort=6818
41 AuthType=auth/munge
42 StateSaveLocation=/tmp
43 SlurmdSpoolDir=/tmp/slurmd
44 SwitchType=switch/none
45 MpiDefault=none
46 SlurmctldPidFile=/var/run/slurmctld.pid
47 SlurmdPidFile=/var/run/slurmd.pid
48 ProctrackType=proctrack/pgid
49 CacheGroups=0
50 ReturnToService=2
51 TaskPlugin=task/affinity
52 #
53 # TIMERS
54 SlurmctldTimeout=300
55 SlurmdTimeout=300
56 InactiveLimit=0
57 MinJobAge=300
58 KillWait=30
59 Waittime=0
60 #
61 # SCHEDULING
62 SchedulerType=sched/backfill
63 SchedulerPort=7321
64 SelectType=select/cons_res
65 SelectTypeParameters=CR_CPU_Memory
66 FastSchedule=1
67 #
68 # LOGGING
69 SlurmctldDebug=3
70 #SlurmctldLogFile=
71 SlurmdDebug=3
72 #SlurmdLogFile=
73 JobCompType=jobcomp/none
74 #JobCompLoc=
75 JobAcctGatherType=jobacct_gather/none
76 #
77 # COMPUTE NODES
78 NodeName=DEFAULT
79 PartitionName=DEFAULT MaxTime=INFINITE State=UP
80 PartitionName=compute Default=YES Shared=yes
81
82 NodeName=compute[0-255]
83
84 PartitionName=compute Nodes=compute[0-255]
85 </pre>
86 </notextile>
87
88 Please make sure to update the value of the @ControlMachine@ parameter to the hostname of your dispatcher (api server).
89
90 h4. Crunch user account
91
92 * @adduser crunch@
93
94 The crunch user should have the same UID, GID, and home directory on all compute nodes and on the dispatcher (api server).
95
96 h4. Repositories
97
98 Crunch scripts must be in Git repositories in the directory configured as @git_repositories_dir@/*.git (see the "API server installation":install-api-server.html#git_repositories_dir).
99
100 Once you have a repository with commits -- and you have read access to the repository -- you should be able to create a new job:
101
102 <pre>
103 read -rd $'\000' newjob <<EOF; arv job create --job "$newjob"
104 {"script_parameters":{"input":"f815ec01d5d2f11cb12874ab2ed50daa"},
105  "script_version":"master",
106  "script":"hash",
107  "repository":"arvados"}
108 EOF
109 </pre>
110
111 Without getting this error:
112
113 <pre>
114 ArgumentError: Specified script_version does not resolve to a commit
115 </pre>
116
117 h4. Running jobs
118
119 * @services/api/script/crunch-dispatch.rb@ must be running.
120 * @crunch-dispatch.rb@ needs @services/crunch/crunch-job@ in its @PATH@.
121 * @crunch-job@ needs @sdk/perl/lib@ and @warehouse-apps/libwarehouse-perl/lib@ in its @PERLLIB@
122 * @crunch-job@ needs @ARVADOS_API_HOST@ (and, if necessary in a development environment, @ARVADOS_API_HOST_INSECURE@)
123
124 Example @/var/service/arvados_crunch_dispatch/run@ script:
125
126 <pre>
127 #!/bin/sh
128 set -e
129
130 rvmexec=""
131 ## uncomment this line if you use rvm:
132 #rvmexec="/usr/local/rvm/bin/rvm-exec 2.1.1"
133
134 export PATH="$PATH":/path/to/arvados/services/crunch
135 export ARVADOS_API_HOST={{ site.arvados_api_host }}
136 export CRUNCH_DISPATCH_LOCKFILE=/var/lock/crunch-dispatch
137
138 fuser -TERM -k $CRUNCH_DISPATCH_LOCKFILE || true
139
140 ## Only if your SSL cert is unverifiable:
141 # export ARVADOS_API_HOST_INSECURE=yes
142
143 cd /path/to/arvados/services/api
144 export RAILS_ENV=production
145 exec $rvmexec bundle exec ./script/crunch-dispatch.rb 2>&1
146 </pre>