document passenger streaming setup
[arvados.git] / doc / install / install-crunch-dispatch.textile
1 ---
2 layout: default
3 navsection: installguide
4 title: Install the Crunch dispatcher
5 navorder: 3
6 ---
7
8 h1. Crunch setup
9
10 h4. Perl SDK dependencies
11
12 * @apt-get install libjson-perl libwww-perl libio-socket-ssl-perl libipc-system-simple-perl@
13
14 h4. Python SDK dependencies
15
16 On controller and all compute nodes:
17
18 * @apt-get install python-pip@
19 * @pip install --upgrade google-api-python-client@
20
21 h4. Likely crunch job dependencies
22
23 On compute nodes:
24
25 * @pip install --upgrade pyvcf@
26
27 h4. Repositories
28
29 Crunch scripts must be in git repositories in @/var/cache/git/*/.git@ (or whatever is configured in @services/api/config/environments/production.rb@).
30
31 h4. Importing commits
32
33 @services/api/script/import_commits.rb production@ must run periodically. Example @/var/service/arvados_import_commits/run@ script for daemontools or runit:
34
35 <pre>
36 #!/bin/sh
37 set -e
38 while sleep 60
39 do
40   cd /path/to/arvados/services/api
41   setuidgid www-data env RAILS_ENV=production /usr/local/rvm/bin/rvm 2.0.0 do bundle exec ./script/import_commits.rb 2>&1
42 done
43 </pre>
44
45 Once you have imported some commits, you should be able to create a new job:
46
47 <pre>
48 read -rd "\000" newjob <<EOF; arv job create --job "$newjob"
49 {"script_parameters":{"input":"f815ec01d5d2f11cb12874ab2ed50daa"},
50  "script_version":"master",
51  "script":"hash"}
52 EOF
53 </pre>
54
55 Without getting this error:
56
57 <pre>
58 ArgumentError: Specified script_version does not resolve to a commit
59 </pre>
60
61 h4. Running jobs
62
63 * @services/api/script/crunch-dispatch.rb@ must be running.
64 * @crunch-dispatch.rb@ needs @services/crunch/crunch-job@ in its @PATH@.
65 * @crunch-job@ needs @sdk/perl/lib@ and @warehouse-apps/libwarehouse-perl/lib@ in its @PERLLIB@
66 * @crunch-job@ needs @ARVADOS_API_HOST@ (and, if necessary in a development environment, @ARVADOS_API_HOST_INSECURE@)
67
68 Example @/var/service/arvados_crunch_dispatch/run@ script:
69
70 <pre>
71 #!/bin/sh
72 set -e
73 export PATH="$PATH":/path/to/arvados/services/crunch
74 export PERLLIB=/path/to/arvados/sdk/perl/lib:/path/to/warehouse-apps/libwarehouse-perl/lib
75 export ARVADOS_API_HOST=xyzzy.arvadosapi.com
76
77 ## Only if your SSL cert is unverifiable:
78 # export ARVADOS_API_HOST_INSECURE=yes
79
80 cd /path/to/arvados/services/api
81 RAILS_ENV=production /usr/local/rvm/bin/rvm 2.0.0 do bundle exec ./script/crunch-dispatch.rb 2>&1
82 </pre>