Advertise filters param in discovery doc.
[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 h1. Crunch setup
9
10 The dispatcher normally runs on the same host/VM as the API server.
11
12 h4. Perl SDK dependencies
13
14 * @apt-get install libjson-perl libwww-perl libio-socket-ssl-perl libipc-system-simple-perl@
15
16 Add this to @/etc/apt/sources.list@
17
18 @deb http://git.oxf.freelogy.org/apt wheezy main contrib@
19
20 Then
21
22 @apt-get install libwarehouse-perl@
23
24 h4. Python SDK dependencies
25
26 On controller and all compute nodes:
27
28 * @apt-get install python-pip@
29 * @pip install --upgrade virtualenv arvados-python-client@
30
31 h4. Likely crunch job dependencies
32
33 On compute nodes:
34
35 * @pip install --upgrade pyvcf@
36
37 h4. Redis
38
39 On controller:
40
41 * @apt-get install redis-server@
42
43 h4. Crunch user account
44
45 On compute nodes and controller:
46
47 * @adduser crunch@
48
49 The crunch user should have the same UID, GID, and home directory on all compute nodes and on the controller.
50
51 h4. Repositories
52
53 Crunch scripts must be in git repositories in @/var/cache/git/*/.git@ (or whatever is configured in @services/api/config/environments/production.rb@).
54
55 h4. Importing commits
56
57 @services/api/script/import_commits.rb production@ must run periodically. Example @/var/service/arvados_import_commits/run@ script for daemontools or runit:
58
59 <pre>
60 #!/bin/sh
61 set -e
62 while sleep 60
63 do
64   cd /path/to/arvados/services/api
65   setuidgid www-data env RAILS_ENV=production /usr/local/rvm/bin/rvm-exec 2.0.0 bundle exec ./script/import_commits.rb 2>&1
66 done
67 </pre>
68
69 Once you have imported some commits, you should be able to create a new job:
70
71 <pre>
72 read -rd $'\000' newjob <<EOF; arv job create --job "$newjob"
73 {"script_parameters":{"input":"f815ec01d5d2f11cb12874ab2ed50daa"},
74  "script_version":"master",
75  "script":"hash"}
76 EOF
77 </pre>
78
79 Without getting this error:
80
81 <pre>
82 ArgumentError: Specified script_version does not resolve to a commit
83 </pre>
84
85 h4. Running jobs
86
87 * @services/api/script/crunch-dispatch.rb@ must be running.
88 * @crunch-dispatch.rb@ needs @services/crunch/crunch-job@ in its @PATH@.
89 * @crunch-job@ needs @sdk/perl/lib@ and @warehouse-apps/libwarehouse-perl/lib@ in its @PERLLIB@
90 * @crunch-job@ needs @ARVADOS_API_HOST@ (and, if necessary in a development environment, @ARVADOS_API_HOST_INSECURE@)
91
92 Example @/var/service/arvados_crunch_dispatch/run@ script:
93
94 <pre>
95 #!/bin/sh
96 set -e
97 export PATH="$PATH":/path/to/arvados/services/crunch
98 export PERLLIB=/path/to/arvados/sdk/perl/lib:/path/to/warehouse-apps/libwarehouse-perl/lib
99 export ARVADOS_API_HOST={{ site.arvados_api_host }}
100 export CRUNCH_DISPATCH_LOCKFILE=/var/lock/crunch-dispatch
101
102 fuser -TERM -k $CRUNCH_DISPATCH_LOCKFILE || true
103
104 ## Only if your SSL cert is unverifiable:
105 # export ARVADOS_API_HOST_INSECURE=yes
106
107 cd /path/to/arvados/services/api
108 export RAILS_ENV=production
109 exec /usr/local/rvm/bin/rvm-exec 2.0.0 bundle exec ./script/crunch-dispatch.rb 2>&1
110 </pre>