X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/78691191dfa23c930a00c6d5cb6dcd4ce30b1a5e..cdecff5125a3bc09720be4d210536a183e43ce7e:/docker/arvdock diff --git a/docker/arvdock b/docker/arvdock index 2107ff3417..a41056cd68 100755 --- a/docker/arvdock +++ b/docker/arvdock @@ -6,13 +6,21 @@ if [[ "$DOCKER" == "" ]]; then DOCKER=`which docker` fi +CURL=`which curl` + COMPUTE_COUNTER=0 function usage { echo >&2 - echo >&2 "usage: $0 (start|stop|restart|test|reset) [options]" + echo >&2 "usage: $0 (start|stop|restart|reset|test) [options]" + echo >&2 + echo >&2 "start run new or restart stopped arvados containers" + echo >&2 "stop stop arvados containers" + echo >&2 "restart stop and then start arvados containers" + echo >&2 "reset stop and delete containers WARNING: this will delete the data inside Arvados!" + echo >&2 "test run tests" echo >&2 - echo >&2 "$0 start/stop/restart options:" + echo >&2 "$0 options:" echo >&2 " -d[port], --doc[=port] Documentation server (default port 9898)" echo >&2 " -w[port], --workbench[=port] Workbench server (default port 9899)" echo >&2 " -s[port], --sso[=port] SSO server (default port 9901)" @@ -87,23 +95,6 @@ function start_container { echo "Started container: $container" fi - if [[ "$name" == "doc_server" ]]; then - echo - echo "*****************************************************************" - echo "You can access the Arvados documentation at http://localhost:${port%:*}" - echo "*****************************************************************" - echo - fi - - if [[ "$name" == "workbench_server" ]]; then - echo - echo "*****************************************************************" - echo "You can access the Arvados workbench at http://localhost:${port%:*}" - echo "*****************************************************************" - echo - fi - - } # Create a Docker data volume @@ -236,14 +227,6 @@ function do_start { echo $DOCKER run -d -v /var/run/docker.sock:/docker.sock --name skydock crosbymichael/skydock -ttl 30 -environment dev -s /docker.sock -domain arvados -name skydns $DOCKER run -d -v /var/run/docker.sock:/docker.sock --name skydock crosbymichael/skydock -ttl 30 -environment dev -s /docker.sock -domain arvados -name skydns fi - - echo - echo "*****************************************************************" - echo "To access Arvados using command line tools on the host we recommend you add" - echo "the arvados nameserver to the top of your DNS configuration in /etc/resolv.conf:" - echo "nameserver 172.17.42.1" - echo "*****************************************************************" - echo fi if [[ $start_sso != false ]] @@ -318,6 +301,42 @@ EOF fi fi fi + + if [ "$(awk '($1 == "nameserver"){print $2; exit}' /dev/null 2>/dev/null ; do + echo "Waiting for Arvados to be ready." + sleep 1 + done + + `$DOCKER ps |grep -P "doc_server[^/]" -q` + if [[ "$?" == "0" ]]; then + echo + echo "******************************************************************" + echo "You can access the Arvados documentation at http://doc.dev.arvados" + echo "******************************************************************" + echo + fi + + `$DOCKER ps |grep -P "workbench_server[^/]" -q` + if [[ "$?" == "0" ]]; then + echo + echo "********************************************************************" + echo "You can access the Arvados workbench at http://workbench.dev.arvados" + echo "********************************************************************" + echo + fi + fi + } function do_stop { @@ -446,6 +465,18 @@ function do_reset { done } +if [ "$DOCKER" == '' ] +then + echo "Docker not found. Please install it first." + exit 2 +fi + +if [ "$CURL" == '' ] +then + echo "Curl not found. Please install it first." + exit 3 +fi + if [ $# -lt 1 ] then usage @@ -474,7 +505,6 @@ case $1 in shift do_reset $@ ;; - *) usage exit 1