Rename "rebuild" back to "reboot" and change "rebuild" to mean "build
authorPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 12 Apr 2016 17:45:08 +0000 (13:45 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 12 Apr 2016 17:45:08 +0000 (13:45 -0400)
--no-cache". "arvbox start" no longer fails if the container is already
running. Update docs.  no issue #

doc/install/arvbox.html.textile.liquid
tools/arvbox/bin/arvbox

index 3ddc7c825819e2799d75ea8e9b94eb7f2bb6a41d..9c8cd49f7e8228f7a7a2ff84c9a6bfdadb984caf 100644 (file)
@@ -26,9 +26,8 @@ h2. Usage
 $ arvbox
 Arvados-in-a-box                      http://arvados.org
 
-arvbox (build|start|run|open|shell|ip|stop|rebuild|reset|destroy|log|svrestart)
-
-build <config>      build arvbox Docker image
+build   <config>      build arvbox Docker image
+rebuild <config>      build arvbox Docker image, no layer cache
 start|run <config>  start arvbox container
 open       open arvbox workbench in a web browser
 shell      enter arvbox shell
@@ -37,7 +36,7 @@ host       print arvbox published host
 status     print some information about current arvbox
 stop       stop arvbox container
 restart <config>  stop, then run again
-rebuild  <config>  stop, build arvbox Docker image, run
+reboot  <config>  stop, build arvbox Docker image, run
 reset      delete arvbox arvados data (be careful!)
 destroy    delete all arvbox code and data (be careful!)
 log <service> tail log of specified service
@@ -122,14 +121,14 @@ h2. Making Arvbox accessible from other hosts
 In "dev" and "localdemo" mode, Arvbox can only be accessed on the same host it is running.  To publish Arvbox service ports to the host's service ports and advertise the host's IP address for services, use @publicdev@ or @publicdemo@:
 
 <pre>
-$ arvbox rebuild publicdemo
+$ arvbox start publicdemo
 </pre>
 
 This attempts to auto-detect the correct IP address to use by taking the IP address of the default route device.  If the auto-detection is wrong, you want to publish a hostname instead of a raw address, or you need to access it through a different device (such as a router or firewall), set @ARVBOX_PUBLISH_IP@ to the desire hostname or IP address.
 
 <pre>
 $ export ARVBOX_PUBLISH_IP=example.com
-$ arvbox rebuild publicdemo
+$ arvbox start publicdemo
 </pre>
 
 Note: this expects to bind the host's port 80 (http) for workbench, so you cannot have a conflicting web server already running on the host.  It does not attempt to take bind the host's port 22 (ssh), as a result the arvbox ssh port is not published.
index 928adf8f2856d0cabd65b0076f0db56096a0e188..2e46886681ac77b2edde0fd8694734a3cc209020 100755 (executable)
@@ -101,8 +101,13 @@ wait_for_arvbox() {
 }
 
 run() {
+    if docker ps -a --filter "status=running" | grep -E "$ARVBOX_CONTAINER$" -q ; then
+        echo "Container $ARVBOX_CONTAINER is already running"
+        exit 0
+    fi
+
     if docker ps -a | grep -E "$ARVBOX_CONTAINER$" -q ; then
-        echo "Container $ARVBOX_CONTAINER is already running, use stop, restart or rebuild"
+        echo "Container $ARVBOX_CONTAINER already exists but is not running; use restart or rebuild"
         exit 1
     fi
 
@@ -247,11 +252,11 @@ build() {
         echo "Could not find Dockerfile (expected it at $ARVBOX_DOCKER/Dockerfile.base)"
         exit 1
     fi
-    docker build -t arvados/arvbox-base -f "$ARVBOX_DOCKER/Dockerfile.base" "$ARVBOX_DOCKER"
+    docker build $NO_CACHE -t arvados/arvbox-base -f "$ARVBOX_DOCKER/Dockerfile.base" "$ARVBOX_DOCKER"
     if test "$1" = localdemo -o "$1" = publicdemo ; then
-        docker build -t arvados/arvbox-demo -f "$ARVBOX_DOCKER/Dockerfile.demo" "$ARVBOX_DOCKER"
+        docker build $NO_CACHE -t arvados/arvbox-demo -f "$ARVBOX_DOCKER/Dockerfile.demo" "$ARVBOX_DOCKER"
     else
-        docker build -t arvados/arvbox-dev -f "$ARVBOX_DOCKER/Dockerfile.dev" "$ARVBOX_DOCKER"
+        docker build $NO_CACHE -t arvados/arvbox-dev -f "$ARVBOX_DOCKER/Dockerfile.dev" "$ARVBOX_DOCKER"
     fi
 }
 
@@ -277,6 +282,11 @@ case "$subcmd" in
         build $@
         ;;
 
+    rebuild)
+        check $@
+        NO_CACHE=--no-cache build $@
+        ;;
+
     start|run)
         check $@
         run $@
@@ -300,7 +310,7 @@ case "$subcmd" in
         run $@
         ;;
 
-    rebuild)
+    reboot)
         check $@
         stop
         build $@
@@ -413,9 +423,8 @@ case "$subcmd" in
     *)
         echo "Arvados-in-a-box                      http://arvados.org"
         echo
-        echo "$(basename $0) (build|start|run|open|shell|ip|stop|rebuild|reset|destroy|log|svrestart)"
-        echo
-        echo "build <config>      build arvbox Docker image"
+        echo "build   <config>      build arvbox Docker image"
+        echo "rebuild <config>      build arvbox Docker image, no layer cache"
         echo "start|run <config>  start $ARVBOX_CONTAINER container"
         echo "open       open arvbox workbench in a web browser"
         echo "shell      enter arvbox shell"
@@ -424,7 +433,7 @@ case "$subcmd" in
         echo "status     print some information about current arvbox"
         echo "stop       stop arvbox container"
         echo "restart <config>  stop, then run again"
-        echo "rebuild <config>  stop, build arvbox Docker image, run"
+        echo "reboot  <config>  stop, build arvbox Docker image, run"
         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"