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 if ! which arv >/dev/null ; then
38 waiting="$waiting sdk"
39 elif ! which arv-get >/dev/null ; then
40 waiting="$waiting sdk"
43 if ! (ps x | grep -v grep | grep "crunch-dispatch") > /dev/null ; then
44 waiting="$waiting crunch-dispatch"
47 export ARVADOS_API_HOST=$localip:${services[api]}
48 export ARVADOS_API_HOST_INSECURE=1
51 if test -s /var/lib/arvados/vm-uuid -a -s /var/lib/arvados/superuser_token; then
52 vm_uuid=$(cat /var/lib/arvados/vm-uuid)
53 export ARVADOS_API_TOKEN=$(cat /var/lib/arvados/superuser_token)
54 if (which arv && arv virtual_machine get --uuid $vm_uuid) >/dev/null 2>/dev/null ; then
59 if test $vm_ok = 0 ; then
63 if ! [[ -z "$waiting" ]] ; then
64 if ps x | grep -v grep | grep "bundle install" > /dev/null; then
65 gemcount=$(ls /var/lib/gems/ruby/2.1.0/gems 2>/dev/null | wc -l)
68 for l in /usr/src/arvados/services/api/Gemfile.lock \
69 /usr/src/arvados/apps/workbench/Gemfile.lock \
70 /usr/src/sso/Gemfile.lock ; do
72 | grep -vE "(GEM|PLATFORMS|DEPENDENCIES|$^|remote:|specs:)" \
73 | sed 's/^ *//' | sed 's/(.*)//' | sed 's/ *$//' | sort | uniq | wc -l)
74 gemlockcount=$(($gemlockcount + $gc))
76 waiting="$waiting (installing ruby gems $gemcount/$gemlockcount)"
79 if ps x | grep -v grep | grep "c++.*/var/lib/passenger" > /dev/null ; then
80 waiting="$waiting (compiling passenger)"
83 if ps x | grep -v grep | grep "pip install" > /dev/null; then
84 waiting="$waiting (installing python packages)"
86 echo " Waiting for$waiting ..."
91 echo "Your Arvados-in-a-box is ready!"
92 echo "Workbench is running at http://$localip"
94 rm -r /tmp/arvbox-ready
96 sv stop ready >/dev/null