4752: Fix failing setup by polling for API server to come up.
[arvados.git] / docker / compute / setup.sh.in
index ade905dc1bbcd9ff2bac5cf1357aa2fc35a727db..6a4e95160a5493d7512824c46d5d19d48cff65a2 100755 (executable)
@@ -6,6 +6,9 @@ export ARVADOS_API_HOST=api
 export ARVADOS_API_HOST_INSECURE=yes
 export ARVADOS_API_TOKEN=@@API_SUPERUSER_SECRET@@
 
+# Wait for API server to come up.
+while ! arv user current ; do sleep 1 ; done
+
 arv node create --node {} > /tmp/node.json
 
 UUID=`grep \"uuid\" /tmp//node.json  |cut -f4 -d\"`
@@ -16,3 +19,5 @@ echo "*/5 * * * * root /usr/bin/curl -k -d ping_secret=$PING_SECRET https://api/
 # Send a ping now
 /usr/bin/curl -k -d ping_secret=$PING_SECRET https://api/arvados/v1/nodes/$UUID/ping?ping_secret=$PING_SECRET
 
+# Just make sure /dev/fuse permissions are correct (the device appears after fuse is loaded)
+chmod 1660 /dev/fuse && chgrp fuse /dev/fuse