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
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 ax | grep -v grep | grep "crunch-dispatch") > /dev/null ; then
45 waiting="$waiting crunch-dispatch"
48 export ARVADOS_API_HOST=$localip:${services[controller-ssl]}
49 export ARVADOS_API_HOST_INSECURE=1
52 if test -s $ARVADOS_CONTAINER_PATH/vm-uuid -a -s $ARVADOS_CONTAINER_PATH/superuser_token; then
53 vm_uuid=$(cat $ARVADOS_CONTAINER_PATH/vm-uuid)
54 export ARVADOS_API_TOKEN=$(cat $ARVADOS_CONTAINER_PATH/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/arvados/lib/ruby/gems/*/gems /var/lib/arvados-arvbox/.gem/ruby/*/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 ; do
72 | grep -vE "(GEM|PLATFORMS|DEPENDENCIES|BUNDLED|GIT|$^|remote:|specs:|revision:)" \
73 | sed 's/^ *//' | sed 's/(.*)//' | sed 's/ *$//' | sort | uniq | wc -l)
74 gemlockcount=$(($gemlockcount + $gc))
76 waiting="$waiting (installing ruby gems $gemcount of about $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 hosted at https://$localip"
93 echo "Workbench2 is hosted at https://$localip:${services[workbench2-ssl]}"
94 echo "Documentation is hosted at http://$localip:${services[doc]}"
96 rm -r /tmp/arvbox-ready