Merge branch 'master' into 6219-fuse-performance-testing
[arvados.git] / docker / api / crunch-dispatch-run.sh
1 #!/bin/bash
2 set -e
3 export PATH="$PATH":/usr/src/arvados/services/crunch
4 export PERLLIB=/usr/src/arvados/sdk/perl/lib
5 export ARVADOS_API_HOST=api
6 export ARVADOS_API_HOST_INSECURE=yes
7 export CRUNCH_DISPATCH_LOCKFILE=/var/lock/crunch-dispatch
8
9 if [[ ! -e $CRUNCH_DISPATCH_LOCKFILE ]]; then
10   touch $CRUNCH_DISPATCH_LOCKFILE
11 fi
12
13 export CRUNCH_JOB_BIN=/usr/src/arvados/services/crunch/crunch-job
14 export HOME=`pwd`
15 fuser -TERM -k $CRUNCH_DISPATCH_LOCKFILE || true
16
17 # Give the compute nodes some time to start up
18 sleep 5
19
20 cd /usr/src/arvados/services/api
21 export RAILS_ENV=production
22 /usr/local/rvm/bin/rvm-exec default bundle install
23 exec /usr/local/rvm/bin/rvm-exec default bundle exec ./script/crunch-dispatch.rb 2>&1
24