[ARVADOS-DEV] updated: dbd9987ed8c1514938216504d8ee1f13282f82c3

git at public.curoverse.com git at public.curoverse.com
Thu Jan 7 10:26:59 EST 2016


Summary of changes:
 arvbox/bin/arvbox                                |  2 +-
 arvbox/lib/arvbox/docker/Dockerfile              |  1 -
 arvbox/lib/arvbox/docker/createusers.sh          | 20 +++++++++++++++++---
 arvbox/lib/arvbox/docker/service/api/run-service |  3 +--
 arvbox/lib/arvbox/docker/service/docker/run      |  4 ++--
 arvbox/lib/arvbox/docker/service/sso/run-service |  3 +--
 6 files changed, 22 insertions(+), 11 deletions(-)

       via  dbd9987ed8c1514938216504d8ee1f13282f82c3 (commit)
       via  514df6920bdb330af068a20e1c88d971179cf124 (commit)
      from  91b7d5d373a317e341054a256aed46800c1eb918 (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 dbd9987ed8c1514938216504d8ee1f13282f82c3
Merge: 514df69 91b7d5d
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Jan 7 10:26:54 2016 -0500

    Merge branch '8080-arvbox' of git.curoverse.com:arvados-dev into 8080-arvbox
    
    Conflicts:
    	arvbox/lib/arvbox/docker/service/api/run-service

diff --cc arvbox/lib/arvbox/docker/createusers.sh
index 65c5463,ec02811..25b1dd7
--- a/arvbox/lib/arvbox/docker/createusers.sh
+++ b/arvbox/lib/arvbox/docker/createusers.sh
@@@ -5,29 -5,17 +5,31 @@@ set -
  if ! grep "^arvbox:" /etc/passwd >/dev/null 2>/dev/null ; then
      HOSTUID=$(ls -nd /usr/src/arvados | sed 's/ */ /' | cut -d' ' -f4)
      HOSTGID=$(ls -nd /usr/src/arvados | sed 's/ */ /' | cut -d' ' -f5)
++    FUSEGID=$(ls -nd /dev/fuse | sed 's/ */ /' | cut -d' ' -f5)
  
      mkdir -p /var/lib/arvados/git
 -    groupadd --gid $HOSTGID arvbox
 +    groupadd --gid $HOSTGID --non-unique arvbox
++    groupadd --gid $FUSEGID --non-unique fuse
      groupadd --gid $HOSTGID --non-unique git
      useradd --home-dir /var/lib/arvados \
              --uid $HOSTUID --gid $HOSTGID \
 -            --groups docker arvbox
 +            --non-unique \
-             --groups docker \
++            --groups docker,fuse \
 +            arvbox
      useradd --home-dir /var/lib/arvados/git --uid $HOSTUID --gid $HOSTGID --non-unique git
--    useradd --groups docker crunch
++    useradd --groups docker,fuse crunch
 +
      chown arvbox:arvbox -R /usr/local
 +
 +    mkdir -p /var/lib/gems/ruby/2.1.0
 +    chown arvbox:arvbox -R /var/lib/gems/ruby/2.1.0
 +
      chown arvbox:arvbox -R /var/lib/nginx
 +
 +    # There's something weird about /var/log/nginx that prevents a non-root
 +    # arvbox user from writing to it, even after the ownership has been
 +    # changed.  As a workaround, delete it and recreate it.
 +
      rm -r /var/log/nginx
      mkdir -p /var/log/nginx
      chown arvbox:arvbox -R /var/log/nginx
diff --cc arvbox/lib/arvbox/docker/service/api/run-service
index ae7acd9,5b5bb1c..b4ab386
--- a/arvbox/lib/arvbox/docker/service/api/run-service
+++ b/arvbox/lib/arvbox/docker/service/api/run-service
@@@ -55,9 -55,10 +55,9 @@@ if ! test -f /var/lib/arvados/api_datab
  fi
  database_pw=$(cat /var/lib/arvados/api_database_pw)
  
 -if ! test -f /var/lib/arvados/api_user_setup ; then
 +if ! (psql -c "\du" | grep "^ arvados ") >/dev/null ; then
-    psql -c "create user arvados with password '$database_pw'"
-    psql -c "ALTER USER arvados CREATEDB;"
+     psql -c "create user arvados with password '$database_pw'"
+     psql -c "ALTER USER arvados CREATEDB;"
 -    touch /var/lib/arvados/api_user_setup
  fi
  
  cat >config/database.yml <<EOF

commit 514df6920bdb330af068a20e1c88d971179cf124
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Jan 7 10:05:29 2016 -0500

    8080: Set up ruby gems directory as part of createusers.sh.  Detect if database
    user already exists.  Try Docker overlay driver first before using default.

diff --git a/arvbox/bin/arvbox b/arvbox/bin/arvbox
index 8e01457..e90dce1 100755
--- a/arvbox/bin/arvbox
+++ b/arvbox/bin/arvbox
@@ -127,7 +127,7 @@ case $1 in
         ;;
 
     ip|open)
-        IP=$(docker inspect $ARVBOX_CONTAINER | grep \"IPAddress\" | tr -d ' ":,\n' | cut -c10-)
+        IP=$(docker inspect $ARVBOX_CONTAINER | grep \"IPAddress\" | head -n1 | tr -d ' ":,\n' | cut -c10-)
         if test $1 = 'ip' ; then
             echo $IP
         else
diff --git a/arvbox/lib/arvbox/docker/createusers.sh b/arvbox/lib/arvbox/docker/createusers.sh
index ec02811..65c5463 100755
--- a/arvbox/lib/arvbox/docker/createusers.sh
+++ b/arvbox/lib/arvbox/docker/createusers.sh
@@ -7,15 +7,27 @@ if ! grep "^arvbox:" /etc/passwd >/dev/null 2>/dev/null ; then
     HOSTGID=$(ls -nd /usr/src/arvados | sed 's/ */ /' | cut -d' ' -f5)
 
     mkdir -p /var/lib/arvados/git
-    groupadd --gid $HOSTGID arvbox
+    groupadd --gid $HOSTGID --non-unique arvbox
     groupadd --gid $HOSTGID --non-unique git
     useradd --home-dir /var/lib/arvados \
             --uid $HOSTUID --gid $HOSTGID \
-            --groups docker arvbox
+            --non-unique \
+            --groups docker \
+            arvbox
     useradd --home-dir /var/lib/arvados/git --uid $HOSTUID --gid $HOSTGID --non-unique git
     useradd --groups docker crunch
+
     chown arvbox:arvbox -R /usr/local
+
+    mkdir -p /var/lib/gems/ruby/2.1.0
+    chown arvbox:arvbox -R /var/lib/gems/ruby/2.1.0
+
     chown arvbox:arvbox -R /var/lib/nginx
+
+    # There's something weird about /var/log/nginx that prevents a non-root
+    # arvbox user from writing to it, even after the ownership has been
+    # changed.  As a workaround, delete it and recreate it.
+
     rm -r /var/log/nginx
     mkdir -p /var/log/nginx
     chown arvbox:arvbox -R /var/log/nginx
diff --git a/arvbox/lib/arvbox/docker/service/api/run-service b/arvbox/lib/arvbox/docker/service/api/run-service
index 56988fe..ae7acd9 100755
--- a/arvbox/lib/arvbox/docker/service/api/run-service
+++ b/arvbox/lib/arvbox/docker/service/api/run-service
@@ -55,10 +55,9 @@ if ! test -f /var/lib/arvados/api_database_pw ; then
 fi
 database_pw=$(cat /var/lib/arvados/api_database_pw)
 
-if ! test -f /var/lib/arvados/api_user_setup ; then
+if ! (psql -c "\du" | grep "^ arvados ") >/dev/null ; then
    psql -c "create user arvados with password '$database_pw'"
    psql -c "ALTER USER arvados CREATEDB;"
-   touch /var/lib/arvados/api_user_setup
 fi
 
 cat >config/database.yml <<EOF
diff --git a/arvbox/lib/arvbox/docker/service/docker/run b/arvbox/lib/arvbox/docker/service/docker/run
index 93834ee..83537d3 100755
--- a/arvbox/lib/arvbox/docker/service/docker/run
+++ b/arvbox/lib/arvbox/docker/service/docker/run
@@ -95,6 +95,6 @@ rm -rf /var/run/docker.pid
 read pid cmd state ppid pgrp session tty_nr tpgid rest < /proc/self/stat
 trap "kill -TERM -$pgrp; exit" EXIT TERM KILL SIGKILL SIGTERM SIGQUIT
 
-if ! docker daemon $DOCKER_DAEMON_ARGS ; then
-    docker daemon --storage-driver=overlay $DOCKER_DAEMON_ARGS
+if ! docker daemon --storage-driver=overlay $DOCKER_DAEMON_ARGS ; then
+    docker daemon $DOCKER_DAEMON_ARGS
 fi
diff --git a/arvbox/lib/arvbox/docker/service/sso/run-service b/arvbox/lib/arvbox/docker/service/sso/run-service
index ac19760..26defa7 100755
--- a/arvbox/lib/arvbox/docker/service/sso/run-service
+++ b/arvbox/lib/arvbox/docker/service/sso/run-service
@@ -38,10 +38,9 @@ if ! test -f /var/lib/arvados/sso_database_pw ; then
 fi
 database_pw=$(cat /var/lib/arvados/sso_database_pw)
 
-if ! test -f /var/lib/arvados/sso_user_setup ; then
+if ! (psql -c "\du" | grep "^ arvados_sso ") >/dev/null ; then
     psql -c "create user arvados_sso with password '$database_pw'"
     psql -c "ALTER USER arvados_sso CREATEDB;"
-    touch /var/lib/arvados/sso_user_setup
 fi
 
 cat >config/database.yml <<EOF

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list