X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6d3636939f60a96d8ede920fec474079d713c7e1..dcf97f13fa730ba7af3fee9b6d7044592a30a2be:/docker/compute/setup.sh.in diff --git a/docker/compute/setup.sh.in b/docker/compute/setup.sh.in index e107d80bdd..efb2c4148e 100755 --- a/docker/compute/setup.sh.in +++ b/docker/compute/setup.sh.in @@ -5,16 +5,23 @@ export ARVADOS_API_HOST=api export ARVADOS_API_HOST_INSECURE=yes export ARVADOS_API_TOKEN=@@API_SUPERUSER_SECRET@@ +export HOME=/root -arv node create --node {} > /tmp/node.json +# Wait for API server to come up. +while ! arv user current ; do sleep 1 ; done -UUID=`grep \"uuid\" /tmp//node.json |cut -f4 -d\"` -PING_SECRET=`grep \"ping_secret\" /tmp//node.json |cut -f4 -d\"` +if ! test -f /root/node.json ; then + arv node create --node "{\"hostname\": \"$(hostname)\"}" > /root/node.json -echo "*/5 * * * * root /usr/bin/curl -k -d ping_secret=$PING_SECRET https://api/arvados/v1/nodes/$UUID/ping" > /etc/cron.d/node_ping + # Make sure /dev/fuse permissions are correct (the device appears after fuse is loaded) + chmod 1660 /dev/fuse && chgrp fuse /dev/fuse +fi -# Send a ping now -/usr/bin/curl -k -d ping_secret=$PING_SECRET https://api/arvados/v1/nodes/$UUID/ping?ping_secret=$PING_SECRET +UUID=`grep \"uuid\" /root/node.json |cut -f4 -d\"` +PING_SECRET=`grep \"ping_secret\" /root/node.json |cut -f4 -d\"` + +if ! test -f /etc/cron.d/node_ping ; then + echo "*/5 * * * * root /usr/bin/curl -k -d ping_secret=$PING_SECRET https://api/arvados/v1/nodes/$UUID/ping" > /etc/cron.d/node_ping +fi -# Just make sure /dev/fuse permissions are correct (the device appears after fuse is loaded) -chmod 1660 /dev/fuse && chgrp fuse /dev/fuse +/usr/bin/curl -k -d ping_secret=$PING_SECRET https://api/arvados/v1/nodes/$UUID/ping?ping_secret=$PING_SECRET