test mode creates certificate so that setting up SSO can succeed
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Wed, 27 Mar 2019 20:04:05 +0000 (16:04 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Wed, 27 Mar 2019 20:04:05 +0000 (16:04 -0400)
also added "arvbox update"

no issue #

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

tools/arvbox/bin/arvbox
tools/arvbox/lib/arvbox/docker/Dockerfile.dev
tools/arvbox/lib/arvbox/docker/waitforpostgres.sh

index 8c443fd71afd3ddb2aee089df9bcb745b1c3315d..a9c85a9608c1cfced8e9fb0274fd7fb8c536d725 100755 (executable)
@@ -285,6 +285,27 @@ run() {
     fi
 }
 
+update() {
+    CONFIG=$1
+    TAG=$2
+
+    if test -n "$TAG"
+    then
+        if test $(echo $TAG | cut -c1-1) != '-' ; then
+           TAG=":$TAG"
+            shift
+        else
+            unset TAG
+        fi
+    fi
+
+    if echo "$CONFIG" | grep 'demo$' ; then
+       docker pull arvados/arvbox-demo$TAG
+    else
+       docker pull arvados/arvbox-dev$TAG
+    fi
+}
+
 stop() {
     if docker ps -a --filter "status=running" | grep -E "$ARVBOX_CONTAINER$" -q ; then
         docker stop $ARVBOX_CONTAINER
@@ -383,6 +404,13 @@ case "$subcmd" in
         run $@
         ;;
 
+    update)
+        check $@
+        stop
+       update $@
+        run $@
+        ;;
+
     ip)
         getip
         ;;
@@ -530,17 +558,18 @@ case "$subcmd" in
     *)
         echo "Arvados-in-a-box                      http://arvados.org"
         echo
-        echo "build   <config>      build arvbox Docker image"
-        echo "rebuild <config>      build arvbox Docker image, no layer cache"
         echo "start|run <config> [tag]  start $ARVBOX_CONTAINER container"
-        echo "open       open arvbox workbench in a web browser"
-        echo "shell      enter arvbox shell"
-        echo "ip         print arvbox docker container ip address"
-        echo "host       print arvbox published host"
-        echo "status     print some information about current arvbox"
         echo "stop       stop arvbox container"
         echo "restart <config>  stop, then run again"
-        echo "reboot  <config>  stop, build arvbox Docker image, run"
+        echo "status     print some information about current arvbox"
+        echo "ip         print arvbox docker container ip address"
+        echo "host       print arvbox published host"
+        echo "shell      enter arvbox shell"
+        echo "open       open arvbox workbench in a web browser"
+        echo "update  <config> stop, pull latest image, run"
+        echo "build   <config> build arvbox Docker image"
+        echo "reboot  <config> stop, build arvbox Docker image, run"
+        echo "rebuild <config> build arvbox Docker image, no layer cache"
         echo "reset      delete arvbox arvados data (be careful!)"
         echo "destroy    delete all arvbox code and data (be careful!)"
         echo "log <service> tail log of specified service"
index bb0ff76fe8f065c1be45338f677cf0e7cd99b8ed..22668253e1bf038c2bcbd297bff85233b92ee430 100644 (file)
@@ -12,5 +12,7 @@ RUN echo "development" > /var/lib/arvados/api_rails_env
 RUN echo "development" > /var/lib/arvados/sso_rails_env
 RUN echo "development" > /var/lib/arvados/workbench_rails_env
 
-RUN mkdir /etc/test-service && ln -sf /var/lib/arvbox/service/postgres /etc/test-service
+RUN mkdir /etc/test-service && \
+    ln -sf /var/lib/arvbox/service/postgres /etc/test-service && \
+    ln -sf /var/lib/arvbox/service/certificate /etc/test-service
 RUN mkdir /etc/devenv-service
\ No newline at end of file
index 58f156cb1775dfb9cbab2a25a8f3d5a3d501e472..6bda618ab899e2a8ca1a429bf319f82263995c49 100755 (executable)
@@ -1,8 +1,14 @@
-#!/bin/sh
+#!/bin/bash
 # Copyright (C) The Arvados Authors. All rights reserved.
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+. /usr/local/lib/arvbox/common.sh
+
 while ! psql postgres -c\\du >/dev/null 2>/dev/null ; do
     sleep 1
 done
+
+while ! test -s /var/lib/arvados/server-cert-${localip}.pem ; do
+    sleep 1
+done