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