projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
4956: Refactor http request patching used in Python SDK.
[arvados.git]
/
docker
/
arvdock
diff --git
a/docker/arvdock
b/docker/arvdock
index 8615545a941018296663efb088e350e750302898..142ba27e3141cb6bb5a47667b99e7167dcba965f 100755
(executable)
--- a/
docker/arvdock
+++ b/
docker/arvdock
@@
-1,6
+1,5
@@
#!/bin/bash
#!/bin/bash
-ENABLE_SSH=false
DOCKER=`which docker.io`
if [[ "$DOCKER" == "" ]]; then
DOCKER=`which docker.io`
if [[ "$DOCKER" == "" ]]; then
@@
-22,7
+21,6
@@
function usage {
echo >&2 " -v, --vm Shell server"
echo >&2 " -n, --nameserver Nameserver"
echo >&2 " -k, --keep Keep servers"
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 " -h, --help Display this help and exit"
echo >&2
echo >&2 " If no options are given, the action is applied to all servers."
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
+63,6
@@
function start_container {
fi
local image=$5
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."
`$DOCKER ps |grep -P "$name[^/]" -q`
if [[ "$?" == "0" ]]; then
echo "You have a running container with name $name -- skipping."
@@
-83,18
+76,11
@@
function start_container {
#echo " $DOCKER run --dns=127.0.0.1 $args $image"
echo " $DOCKER run $args $image"
container=`$DOCKER run $args $image`
#echo " $DOCKER run --dns=127.0.0.1 $args $image"
echo " $DOCKER run $args $image"
container=`$DOCKER run $args $image`
- if [
[ "$?" != "0" ]
]; then
+ if [
"$?" != "0" -o "$container" = ""
]; then
echo "Unable to start container"
exit 1
echo "Unable to start container"
exit 1
- fi
- if [[ "$name" == "compute" || $ENABLE_SSH ]];
- 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
if [[ "$name" == "doc_server" ]]; then
fi
if [[ "$name" == "doc_server" ]]; then
@@
-134,8
+120,8
@@
function make_keep_volumes () {
while [ ${#keep_volumes[*]} -lt 2 ]
do
new_keep=$(mktemp -d)
while [ ${#keep_volumes[*]} -lt 2 ]
do
new_keep=$(mktemp -d)
- echo >&2 "mounting
512M
tmpfs keep volume in $new_keep"
- sudo mount -t tmpfs -o size=
512M
tmpfs $new_keep
+ echo >&2 "mounting
2G
tmpfs keep volume in $new_keep"
+ sudo mount -t tmpfs -o size=
2G
tmpfs $new_keep
mkdir $new_keep/keep
keep_volumes+=($new_keep)
done
mkdir $new_keep/keep
keep_volumes+=($new_keep)
done
@@
-153,7
+139,7
@@
function do_start {
# NOTE: This requires GNU getopt (part of the util-linux package on Debian-based distros).
local TEMP=`getopt -o d::s::a::cw::nkvh \
# 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
\
+ --long doc::,sso::,api::,compute,workbench::,nameserver,keep,vm,help \
-n "$0" -- "$@"`
if [ $? != 0 ] ; then echo "Use -h for help"; exit 1 ; fi
-n "$0" -- "$@"`
if [ $? != 0 ] ; then echo "Use -h for help"; exit 1 ; fi
@@
-204,11
+190,6
@@
function do_start {
start_keep=true
shift
;;
start_keep=true
shift
;;
- --ssh)
- # ENABLE_SSH is a global variable
- ENABLE_SSH=true
- shift
- ;;
--)
shift
break
--)
shift
break
@@
-231,7
+212,8
@@
function do_start {
$start_keep == false ]]
then
start_doc=9898
$start_keep == false ]]
then
start_doc=9898
- start_sso=9901
+ #the sso server is currently not used by default so don't start it unless explicitly requested
+ #start_sso=9901
start_api=9900
start_compute=2
start_workbench=9899
start_api=9900
start_compute=2
start_workbench=9899
@@
-247,7
+229,11
@@
function do_start {
if [[ $start_api != false ]]
then
if [[ $start_api != false ]]
then
+ if [[ $start_sso != false ]]; then
start_container "$start_api:443" "api_server" '' "sso_server:sso" "arvados/api"
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_nameserver != false ]]
fi
if [[ $start_nameserver != false ]]
@@
-285,11
+271,11
@@
function do_start {
[ -f $v/keep/.metadata.yml ] && sudo rm $v/keep/.metadata.yml
done
start_container "25107:25107" "keep_server_0" \
[ -f $v/keep/.metadata.yml ] && sudo rm $v/keep/.metadata.yml
done
start_container "25107:25107" "keep_server_0" \
- "${keep_volumes[0]}:/
dev/keep-0
" \
+ "${keep_volumes[0]}:/
keep-data
" \
"api_server:api" \
"arvados/keep"
start_container "25108:25107" "keep_server_1" \
"api_server:api" \
"arvados/keep"
start_container "25108:25107" "keep_server_1" \
- "${keep_volumes[1]}:/
dev/keep-0
" \
+ "${keep_volumes[1]}:/
keep-data
" \
"api_server:api" \
"arvados/keep"
fi
"api_server:api" \
"arvados/keep"
fi
@@
-309,15
+295,20
@@
function do_start {
start_container "$start_workbench:80" "workbench_server" '' "api_server:api" "arvados/workbench"
fi
start_container "$start_workbench:80" "workbench_server" '' "api_server:api" "arvados/workbench"
fi
- if [
-d $HOME/.config/arvados ] || mkdir -p $HOME/.config/arvados
+ if [
[ $start_api != false ]]
then
then
- cat >$HOME/.config/arvados/settings.conf <<EOF
+ if [[ -f "api/generated/superuser_token" ]]
+ then
+ if [ -d $HOME/.config/arvados ] || mkdir -p $HOME/.config/arvados
+ then
+ cat >$HOME/.config/arvados/settings.conf <<EOF
ARVADOS_API_HOST=$(ip_address "api_server")
ARVADOS_API_HOST_INSECURE=yes
ARVADOS_API_TOKEN=$(cat api/generated/superuser_token)
EOF
ARVADOS_API_HOST=$(ip_address "api_server")
ARVADOS_API_HOST_INSECURE=yes
ARVADOS_API_TOKEN=$(cat api/generated/superuser_token)
EOF
+ fi
+ fi
fi
fi
-
}
function do_stop {
}
function do_stop {