[ARVADOS-DEV] updated: e5a6bdc1950973910e748f2ccc655741d3a73604

git at public.curoverse.com git at public.curoverse.com
Wed Dec 23 15:59:12 EST 2015


Summary of changes:
 arvbox/arvbox                       | 53 ++++++++++++++++---------------------
 arvbox/docker/common.sh             |  7 +++++
 arvbox/docker/service/api/run       |  2 +-
 arvbox/docker/service/ready/run     | 10 +++++--
 arvbox/docker/service/sso/run       |  3 ++-
 arvbox/docker/service/vm/run        |  2 +-
 arvbox/docker/service/workbench/run |  3 ++-
 7 files changed, 44 insertions(+), 36 deletions(-)

       via  e5a6bdc1950973910e748f2ccc655741d3a73604 (commit)
      from  0df06e7b8af5ebfa6675fc84f2d3bd81a1b0d7a8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e5a6bdc1950973910e748f2ccc655741d3a73604
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Dec 23 15:59:08 2015 -0500

    8080: Use shared gems directory, use flock so that only one bundler process updates
    it at once.  Use same container for tests or demo run.

diff --git a/arvbox/arvbox b/arvbox/arvbox
index 357cefc..22973ac 100755
--- a/arvbox/arvbox
+++ b/arvbox/arvbox
@@ -23,9 +23,6 @@ fi
 if test -z "$ARVBOX_CONTAINER" ; then
     ARVBOX_CONTAINER=arvbox
 fi
-if test -z "$ARVBOX_TEST_CONTAINER" ; then
-    ARVBOX_TEST_CONTAINER=arvbox-tests
-fi
 
 PASSENGER=$ARVBOX_DATA/passenger
 PG_DATA=$ARVBOX_DATA/postgres
@@ -84,7 +81,7 @@ case $1 in
         ;;
 
     sh*)
-        docker exec -ti $ARVBOX_CONTAINER /bin/bash
+        docker exec -ti $ARVBOX_CONTAINER /usr/bin/env TERM=$TERM /bin/bash
         ;;
 
     stop)
@@ -127,47 +124,44 @@ case $1 in
         ;;
 
     tests)
+        stop
+
         if ! test -d $ARVADOS_DEV_ROOT ; then
             git clone https://github.com/curoverse/arvados-dev.git $ARVADOS_DEV_ROOT
         fi
 
-        if docker ps |grep -E "\b$ARVBOX_TEST_CONTAINER\b" -q ; then
-            docker start $ARVBOX_TEST_CONTAINER
-        else
-            docker run \
-                   --detach \
-                   --name=$ARVBOX_TEST_CONTAINER \
-                   --privileged \
-                   --volume=$ARVADOS_ROOT:/usr/src/arvados:rw \
-                   --volume=$ARVADOS_DEV_ROOT:/usr/src/arvados-dev:rw \
-                   --volume=$SSO_ROOT:/usr/src/sso:rw \
-                   --volume=$PG_DATA:/var/lib/postgresql:rw \
-                   --volume=$ARV_DATA:/var/lib/arvados:rw \
-                   --volume=$PASSENGER:/var/lib/passenger:rw \
-                   --volume=/var/lib/docker \
-                   arvados/arvbox \
-                   runsvdir /etc/tests-service
-        fi
+        docker run \
+               --detach \
+               --name=$ARVBOX_CONTAINER \
+               --privileged \
+               --volume=$ARVADOS_ROOT:/usr/src/arvados:rw \
+               --volume=$ARVADOS_DEV_ROOT:/usr/src/arvados-dev:rw \
+               --volume=$SSO_ROOT:/usr/src/sso:rw \
+               --volume=$PG_DATA:/var/lib/postgresql:rw \
+               --volume=$ARV_DATA:/var/lib/arvados:rw \
+               --volume=$PASSENGER:/var/lib/passenger:rw \
+               --volume=/var/lib/docker \
+               arvados/arvbox \
+               runsvdir /etc/tests-service
+
         shift
-        docker exec -ti $ARVBOX_TEST_CONTAINER /usr/src/arvados-dev/jenkins/run-tests.sh \
+        docker exec -ti $ARVBOX_CONTAINER /usr/src/arvados-dev/jenkins/run-tests.sh \
                --leave-temp \
                WORKSPACE=/usr/src/arvados \
                VENVDIR=/var/lib/arvados/tests-venv \
                VENV3DIR=/var/lib/arvados/tests-venv3 \
                GOPATH=/var/lib/arvados/tests-gostuff \
+               GEMHOME=/var/lib/arvados/gems \
                "$@"
-        docker stop $ARVBOX_TEST_CONTAINER
-        ;;
-
-    stop-tests)
-        docker rm $ARVBOX_TEST_CONTAINER
+        docker stop $ARVBOX_CONTAINER
+        docker rm $ARVBOX_CONTAINER
         ;;
 
 
     *)
         echo "Arvados-in-a-box"
         echo
-        echo "$0 (build|start|run|open|shell|ip|stop|reboot|reset|log|svrestart|tests|stop-tests)"
+        echo "$0 (build|start|run|open|shell|ip|stop|reboot|reset|log|svrestart|tests)"
         echo
         echo "build      build arvbox Docker image"
         echo "start|run  start $ARVBOX_CONTAINER container "
@@ -179,7 +173,6 @@ case $1 in
         echo "reset      delete persistent data (careful!)"
         echo "log <component>       tail log of specified service"
         echo "svrestart <component> restart specified service inside arvbox"
-        echo "tests      run run-tests.sh inside $ARVBOX_TEST_CONTAINER container"
-        echo "stop-tests stop $ARVBOX_TEST_CONTAINER container"
+        echo "tests      run run-tests.sh inside $ARVBOX_CONTAINER container"
         ;;
 esac
diff --git a/arvbox/docker/common.sh b/arvbox/docker/common.sh
index 16297ba..20d164c 100644
--- a/arvbox/docker/common.sh
+++ b/arvbox/docker/common.sh
@@ -1 +1,8 @@
 localip=$(ip addr show eth0 |grep "inet " | sed 's/ *inet \([^/]*\).*/\1/')
+export GEM_HOME=/var/lib/arvados/gems
+
+run_bundler() {
+    if ! flock /var/lib/arvados/gems.lock bundle install --local --no-deployment "$@" ; then
+        flock /var/lib/arvados/gems.lock bundle install --no-deployment "$@"
+    fi
+}
diff --git a/arvbox/docker/service/api/run b/arvbox/docker/service/api/run
index 935c93c..d290420 100755
--- a/arvbox/docker/service/api/run
+++ b/arvbox/docker/service/api/run
@@ -8,7 +8,7 @@ set -eux
 cd /usr/src/arvados/services/api
 export RAILS_ENV=development
 
-bundle install --without=development --path=vendor
+run_bundler --without=development
 
 if ! test -s /var/lib/arvados/api_uuid_prefix ; then
   ruby -e 'puts "#{rand(2**64).to_s(36)[0,5]}"' > /var/lib/arvados/api_uuid_prefix
diff --git a/arvbox/docker/service/ready/run b/arvbox/docker/service/ready/run
index 17cc0eb..60ac664 100755
--- a/arvbox/docker/service/ready/run
+++ b/arvbox/docker/service/ready/run
@@ -50,8 +50,14 @@ if ! docker version >/dev/null 2>/dev/null ; then
 fi
 
 if ! [[ -z "$waiting" ]] ; then
-  echo "    Waiting for$waiting ..."
-  exit 1
+    if ps x | grep -v grep | grep "bundle install" > /dev/null; then
+        waiting="$waiting (installing ruby gems)"
+    fi
+    if ps x | grep -v grep | grep "pip install" > /dev/null; then
+        waiting="$waiting (installing python packages)"
+    fi
+    echo "    Waiting for$waiting ..."
+    exit 1
 fi
 
 echo
diff --git a/arvbox/docker/service/sso/run b/arvbox/docker/service/sso/run
index 953ea95..718c526 100755
--- a/arvbox/docker/service/sso/run
+++ b/arvbox/docker/service/sso/run
@@ -7,8 +7,9 @@ set -eux
 
 cd /usr/src/sso
 export RAILS_ENV=development
+export GEM_HOME=/var/lib/arvados/gems
 
-bundle install --without=development --path=vendor
+run_bundler --without=development
 
 if ! test -s /var/lib/arvados/sso_uuid_prefix ; then
   ruby -e 'puts "#{rand(2**64).to_s(36)[0,5]}"' > /var/lib/arvados/sso_uuid_prefix
diff --git a/arvbox/docker/service/vm/run b/arvbox/docker/service/vm/run
index 0bdd8ea..807d976 100755
--- a/arvbox/docker/service/vm/run
+++ b/arvbox/docker/service/vm/run
@@ -38,7 +38,7 @@ fi
 export ARVADOS_VIRTUAL_MACHINE_UUID
 
 cd /usr/src/arvados/services/login-sync
-bundle install
+run_bundler
 
 while true ; do
       bundle exec arvados-login-sync
diff --git a/arvbox/docker/service/workbench/run b/arvbox/docker/service/workbench/run
index 50f5b26..a08136c 100755
--- a/arvbox/docker/service/workbench/run
+++ b/arvbox/docker/service/workbench/run
@@ -7,8 +7,9 @@ set -eux
 
 cd /usr/src/arvados/apps/workbench
 export RAILS_ENV=development
+export GEM_HOME=/var/lib/arvados/gems
 
-bundle install --without=development --path=vendor
+run_bundler --without=development
 
 if ! test -s secret_token ; then
   ruby -e 'puts rand(2**400).to_s(36)' > secret_token

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list