2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
6 . /usr/local/lib/arvbox/common.sh
10 if ! [[ -d /tmp/arvbox-ready ]] ; then
12 echo "Arvados-in-a-box starting"
14 echo "Note: if this is a fresh arvbox installation, it may take 10-15 minutes (or longer) to download and"
15 echo "install dependencies. Use \"arvbox log\" to monitor the progress of specific services."
17 mkdir -p /tmp/arvbox-ready
24 for s in "${!services[@]}"
26 if ! [[ -f /tmp/arvbox-ready/$s ]] ; then
27 if nc -z localhost ${services[$s]} ; then
28 echo "$s is ready at $localip:${services[$s]}"
29 touch /tmp/arvbox-ready/$s
36 if ! docker version >/dev/null 2>/dev/null ; then
37 waiting="$waiting docker"
40 for sdk_app in arv arv-get cwl-runner arv-mount ; do
41 if ! which $sdk_app >/dev/null ; then
42 waiting="$waiting sdk"
47 if ! (ps x | grep -v grep | grep "crunch-dispatch") > /dev/null ; then
48 waiting="$waiting crunch-dispatch"
51 export ARVADOS_API_HOST=$localip:${services[api]}
52 export ARVADOS_API_HOST_INSECURE=1
55 if test -s /var/lib/arvados/vm-uuid -a -s /var/lib/arvados/superuser_token; then
56 vm_uuid=$(cat /var/lib/arvados/vm-uuid)
57 export ARVADOS_API_TOKEN=$(cat /var/lib/arvados/superuser_token)
58 if (which arv && arv virtual_machine get --uuid $vm_uuid) >/dev/null 2>/dev/null ; then
63 if test $vm_ok = 0 ; then
67 if ! [[ -z "$waiting" ]] ; then
68 if ps x | grep -v grep | grep "bundle install" > /dev/null; then
69 gemcount=$(ls /var/lib/gems/ruby/2.1.0/gems 2>/dev/null | wc -l)
72 for l in /usr/src/arvados/services/api/Gemfile.lock \
73 /usr/src/arvados/apps/workbench/Gemfile.lock \
74 /usr/src/sso/Gemfile.lock ; do
76 | grep -vE "(GEM|PLATFORMS|DEPENDENCIES|BUNDLED|GIT|$^|remote:|specs:|revision:)" \
77 | sed 's/^ *//' | sed 's/(.*)//' | sed 's/ *$//' | sort | uniq | wc -l)
78 gemlockcount=$(($gemlockcount + $gc))
80 waiting="$waiting (installing ruby gems $gemcount of about $gemlockcount)"
83 if ps x | grep -v grep | grep "c++.*/var/lib/passenger" > /dev/null ; then
84 waiting="$waiting (compiling passenger)"
87 if ps x | grep -v grep | grep "pip install" > /dev/null; then
88 waiting="$waiting (installing python packages)"
90 echo " Waiting for$waiting ..."
95 echo "Your Arvados-in-a-box is ready!"
96 echo "Workbench is running at http://$localip"
98 rm -r /tmp/arvbox-ready
100 sv stop ready >/dev/null