X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e34d6859d936f0b82f981d44be415a46b1aa61e1..2e59e0a48d1f34df2aa0d0600162012424a0f3ee:/docker/arvdock diff --git a/docker/arvdock b/docker/arvdock index 27b7085ef1..ecd90c916e 100755 --- a/docker/arvdock +++ b/docker/arvdock @@ -1,6 +1,5 @@ #!/bin/bash -ENABLE_SSH=false DOCKER=`which docker.io` if [[ "$DOCKER" == "" ]]; then @@ -22,7 +21,7 @@ function usage { echo >&2 " -v, --vm Shell server" echo >&2 " -n, --nameserver Nameserver" echo >&2 " -k, --keep Keep servers" - echo >&2 " --ssh Enable SSH access to server containers" + echo >&2 " -p, --keepproxy Keepproxy server" echo >&2 " -h, --help Display this help and exit" echo >&2 echo >&2 " If no options are given, the action is applied to all servers." @@ -65,11 +64,6 @@ function start_container { fi local image=$5 - if $ENABLE_SSH - then - args="$args -e ENABLE_SSH=$ENABLE_SSH" - fi - `$DOCKER ps |grep -P "$name[^/]" -q` if [[ "$?" == "0" ]]; then echo "You have a running container with name $name -- skipping." @@ -80,21 +74,11 @@ function start_container { $DOCKER rm "$name" 2>/dev/null echo "Starting container:" - #echo " $DOCKER run --dns=127.0.0.1 $args $image" echo " $DOCKER run $args $image" container=`$DOCKER run $args $image` if [ "$?" != "0" -o "$container" = "" ]; then echo "Unable to start container" exit 1 - fi - if [ "$name" == "compute" -o "$ENABLE_SSH" != "false" ]; - then - ip=$(ip_address $container ) - echo - echo "You can ssh into the container with:" - echo - echo " ssh root@$ip" - echo else echo "Started container: $container" fi @@ -152,10 +136,11 @@ function do_start { local start_vm=false local start_nameserver=false local start_keep=false + local start_keepproxy=false # NOTE: This requires GNU getopt (part of the util-linux package on Debian-based distros). - local TEMP=`getopt -o d::s::a::cw::nkvh \ - --long doc::,sso::,api::,compute,workbench::,nameserver,keep,vm,help,ssh \ + local TEMP=`getopt -o d::s::a::cw::nkpvh \ + --long doc::,sso::,api::,compute,workbench::,nameserver,keep,keepproxy,vm,help \ -n "$0" -- "$@"` if [ $? != 0 ] ; then echo "Use -h for help"; exit 1 ; fi @@ -206,9 +191,8 @@ function do_start { start_keep=true shift ;; - --ssh) - # ENABLE_SSH is a global variable - ENABLE_SSH=true + -p | --keepproxy) + start_keepproxy=true shift ;; --) @@ -230,7 +214,8 @@ function do_start { $start_workbench == false && $start_vm == false && $start_nameserver == false && - $start_keep == false ]] + $start_keep == false && + $start_keepproxy == false ]] then start_doc=9898 #the sso server is currently not used by default so don't start it unless explicitly requested @@ -241,20 +226,7 @@ function do_start { start_vm=true start_nameserver=true start_keep=true - fi - - if [[ $start_sso != false ]] - then - start_container "$start_sso:443" "sso_server" '' '' "arvados/sso" - fi - - if [[ $start_api != false ]] - then - if [[ $start_sso != false ]]; then - start_container "$start_api:443" "api_server" '' "sso_server:sso" "arvados/api" - else - start_container "$start_api:443" "api_server" '' '' "arvados/api" - fi + start_keepproxy=true fi if [[ $start_nameserver != false ]] @@ -275,6 +247,20 @@ function do_start { fi fi + if [[ $start_sso != false ]] + then + start_container "$start_sso:443" "sso_server" '' '' "arvados/sso" + fi + + if [[ $start_api != false ]] + then + if [[ $start_sso != false ]]; then + start_container "$start_api:443" "api_server" '' "sso_server:sso" "arvados/api" + else + start_container "$start_api:443" "api_server" '' '' "arvados/api" + fi + fi + if [[ $start_compute != false ]] then for i in `seq 0 $(($start_compute - 1))`; do @@ -301,6 +287,13 @@ function do_start { "arvados/keep" fi + if [[ $start_keepproxy != false ]] + then + start_container "9902:9100" "keepproxy_server" '' \ + "api_server:api" \ + "arvados/keepproxy" + fi + if [[ $start_doc != false ]] then start_container "$start_doc:80" "doc_server" '' '' "arvados/doc" @@ -318,16 +311,18 @@ function do_start { if [[ $start_api != false ]] then - if [ -d $HOME/.config/arvados ] || mkdir -p $HOME/.config/arvados + if [[ -f "api/generated/superuser_token" ]] then + if [ -d $HOME/.config/arvados ] || mkdir -p $HOME/.config/arvados + then cat >$HOME/.config/arvados/settings.conf </dev/null }