Merge branch 'origin-2035-arv-mount-tags-folders'
[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. Likely crunch job dependencies
25
26 On compute nodes:
27
28 * @pip install --upgrade pyvcf@
29
30 h4. Redis
31
32 On controller:
33
34 * @apt-get install redis-server@
35
36 h4. Crunch user account
37
38 On compute nodes and controller:
39
40 * @adduser crunch@
41
42 The crunch user should have the same UID, GID, and home directory on all compute nodes and on the controller.
43
44 h4. Repositories
45
46 Crunch scripts must be in Git repositories in @/var/lib/arvados/git/*.git@ (or whatever is configured in @services/api/config/environments/production.rb@).
47
48 Once you have a repository with commits -- and you have read access to the repository -- you should be able to create a new job:
49
50 <pre>
51 read -rd $'\000' newjob <<EOF; arv job create --job "$newjob"
52 {"script_parameters":{"input":"f815ec01d5d2f11cb12874ab2ed50daa"},
53  "script_version":"master",
54  "script":"hash",
55  "repository":"arvados"}
56 EOF
57 </pre>
58
59 Without getting this error:
60
61 <pre>
62 ArgumentError: Specified script_version does not resolve to a commit
63 </pre>
64
65 h4. Running jobs
66
67 * @services/api/script/crunch-dispatch.rb@ must be running.
68 * @crunch-dispatch.rb@ needs @services/crunch/crunch-job@ in its @PATH@.
69 * @crunch-job@ needs @sdk/perl/lib@ and @warehouse-apps/libwarehouse-perl/lib@ in its @PERLLIB@
70 * @crunch-job@ needs @ARVADOS_API_HOST@ (and, if necessary in a development environment, @ARVADOS_API_HOST_INSECURE@)
71
72 Example @/var/service/arvados_crunch_dispatch/run@ script:
73
74 <pre>
75 #!/bin/sh
76 set -e
77
78 rvmexec=""
79 ## uncomment this line if you use rvm:
80 #rvmexec="/usr/local/rvm/bin/rvm-exec 2.1.1"
81
82 export PATH="$PATH":/path/to/arvados/services/crunch
83 export ARVADOS_API_HOST={{ site.arvados_api_host }}
84 export CRUNCH_DISPATCH_LOCKFILE=/var/lock/crunch-dispatch
85
86 fuser -TERM -k $CRUNCH_DISPATCH_LOCKFILE || true
87
88 ## Only if your SSL cert is unverifiable:
89 # export ARVADOS_API_HOST_INSECURE=yes
90
91 cd /path/to/arvados/services/api
92 export RAILS_ENV=production
93 exec $rvmexec bundle exec ./script/crunch-dispatch.rb 2>&1
94 </pre>