3 . /usr/local/lib/arvbox/common.sh
7 if ! [[ -d /tmp/arvbox-ready ]] ; then
9 echo "Arvados-in-a-box starting"
11 echo "Note: if this is a fresh arvbox installation, it may take 10-15 minutes (or longer) to download and"
12 echo "install dependencies. Use \"arvbox log\" to monitor the progress of specific services."
14 mkdir -p /tmp/arvbox-ready
21 for s in "${!services[@]}"
23 if ! [[ -f /tmp/arvbox-ready/$s ]] ; then
24 if nc -z localhost ${services[$s]} ; then
25 echo "$s is ready at $localip:${services[$s]}"
26 touch /tmp/arvbox-ready/$s
33 if ! docker version >/dev/null 2>/dev/null ; then
34 waiting="$waiting docker"
37 for sdk_app in arv arv-get cwl-runner arv-mount ; do
38 if ! which $sdk_app >/dev/null ; then
39 waiting="$waiting sdk"
44 if ! (ps x | grep -v grep | grep "crunch-dispatch") > /dev/null ; then
45 waiting="$waiting crunch-dispatch"
48 export ARVADOS_API_HOST=$localip:${services[api]}
49 export ARVADOS_API_HOST_INSECURE=1
52 if test -s /var/lib/arvados/vm-uuid -a -s /var/lib/arvados/superuser_token; then
53 vm_uuid=$(cat /var/lib/arvados/vm-uuid)
54 export ARVADOS_API_TOKEN=$(cat /var/lib/arvados/superuser_token)
55 if (which arv && arv virtual_machine get --uuid $vm_uuid) >/dev/null 2>/dev/null ; then
60 if test $vm_ok = 0 ; then
64 if ! [[ -z "$waiting" ]] ; then
65 if ps x | grep -v grep | grep "bundle install" > /dev/null; then
66 gemcount=$(ls /var/lib/gems/ruby/2.1.0/gems 2>/dev/null | wc -l)
69 for l in /usr/src/arvados/services/api/Gemfile.lock \
70 /usr/src/arvados/apps/workbench/Gemfile.lock \
71 /usr/src/sso/Gemfile.lock ; do
73 | grep -vE "(GEM|PLATFORMS|DEPENDENCIES|$^|remote:|specs:)" \
74 | sed 's/^ *//' | sed 's/(.*)//' | sed 's/ *$//' | sort | uniq | wc -l)
75 gemlockcount=$(($gemlockcount + $gc))
77 waiting="$waiting (installing ruby gems $gemcount/$gemlockcount)"
80 if ps x | grep -v grep | grep "c++.*/var/lib/passenger" > /dev/null ; then
81 waiting="$waiting (compiling passenger)"
84 if ps x | grep -v grep | grep "pip install" > /dev/null; then
85 waiting="$waiting (installing python packages)"
87 echo " Waiting for$waiting ..."
92 echo "Your Arvados-in-a-box is ready!"
93 echo "Workbench is running at http://$localip"
95 rm -r /tmp/arvbox-ready
97 sv stop ready >/dev/null