[ARVADOS-DEV] updated: a1ca4978b7e4e6d917c50c64c3bf5e527690a7e4

git at public.curoverse.com git at public.curoverse.com
Thu Jan 28 14:55:31 EST 2016


Summary of changes:
 arvbox/bin/arvbox                                     |  3 +++
 arvbox/lib/arvbox/docker/Dockerfile.base              |  2 ++
 arvbox/lib/arvbox/docker/createusers.sh               | 13 ++-----------
 arvbox/lib/arvbox/docker/service/api/run-service      |  6 +++---
 arvbox/lib/arvbox/docker/service/gitolite/run-service |  2 +-
 arvbox/lib/arvbox/docker/service/postgres/run-service |  2 +-
 arvbox/lib/arvbox/docker/service/sso/run-service      |  6 +++---
 arvbox/lib/arvbox/docker/waitforpostgres.sh           |  2 +-
 8 files changed, 16 insertions(+), 20 deletions(-)

       via  a1ca4978b7e4e6d917c50c64c3bf5e527690a7e4 (commit)
       via  a86550746f8343128d9bc38eb115d9495decc58f (commit)
      from  42f2e4db0a40db50617d8631a2ff7e5add6539e4 (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 a1ca4978b7e4e6d917c50c64c3bf5e527690a7e4
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Jan 28 14:55:29 2016 -0500

    Use volumes for /var/log/nginx and /etc/ssl/private so that changing ownership
    sticks. refs #8080

diff --git a/arvbox/lib/arvbox/docker/Dockerfile.base b/arvbox/lib/arvbox/docker/Dockerfile.base
index cdbface..108ed53 100644
--- a/arvbox/lib/arvbox/docker/Dockerfile.base
+++ b/arvbox/lib/arvbox/docker/Dockerfile.base
@@ -13,6 +13,8 @@ RUN apt-get update && \
 
 RUN curl -sSL https://get.docker.com/ | sh
 VOLUME /var/lib/docker
+VOLUME /var/log/nginx
+VOLUME /etc/ssl/private
 
 RUN rm -rf /var/lib/postgresql && mkdir -p /var/lib/postgresql
 
diff --git a/arvbox/lib/arvbox/docker/createusers.sh b/arvbox/lib/arvbox/docker/createusers.sh
index 4a8abfd..b77c9c2 100755
--- a/arvbox/lib/arvbox/docker/createusers.sh
+++ b/arvbox/lib/arvbox/docker/createusers.sh
@@ -21,21 +21,12 @@ if ! grep "^arvbox:" /etc/passwd >/dev/null 2>/dev/null ; then
     useradd --groups docker,fuse crunch
 
     chown arvbox:arvbox -R /usr/local /var/lib/arvados /var/lib/gems \
-          /var/lib/passenger /var/lib/postgresql /etc/ssl/private
+          /var/lib/passenger /var/lib/postgresql \
+          /var/lib/nginx /var/log/nginx /etc/ssl/private
 
     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
-
     mkdir -p /tmp/crunch0 /tmp/crunch1
     chown crunch:crunch -R /tmp/crunch0 /tmp/crunch1
 

commit a86550746f8343128d9bc38eb115d9495decc58f
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Jan 28 14:22:23 2016 -0500

    Arvbox fixes: use 'postgres' database when testing if a user exists.  Copy
    gitolite.rc to the right place.  Print out what is being deleted when using
    "reset" or "destroy". refs #8080

diff --git a/arvbox/bin/arvbox b/arvbox/bin/arvbox
index 4f1d94a..d60c354 100755
--- a/arvbox/bin/arvbox
+++ b/arvbox/bin/arvbox
@@ -325,6 +325,7 @@ case "$subcmd" in
                     echo "Use destroy -f if you really mean it."
                     exit 1
                 fi
+                set -x
                 rm -rf "$ARVBOX_DATA"
             else
                 if test "$1" != -f ; then
@@ -333,6 +334,7 @@ case "$subcmd" in
                     echo "Use reset -f if you really mean it."
                     exit 1
                 fi
+                set -x
                 rm -rf "$ARVBOX_DATA/postgres"
                 rm -rf "$ARVBOX_DATA/var"
             fi
@@ -341,6 +343,7 @@ case "$subcmd" in
                 echo "WARNING!  This will delete your data container $ARVBOX_CONTAINER-data.  Use -f if you really mean it."
                 exit 1
             fi
+            set -x
             docker rm "$ARVBOX_CONTAINER-data"
         fi
         ;;
diff --git a/arvbox/lib/arvbox/docker/service/api/run-service b/arvbox/lib/arvbox/docker/service/api/run-service
index 31f90d1..530a039 100755
--- a/arvbox/lib/arvbox/docker/service/api/run-service
+++ b/arvbox/lib/arvbox/docker/service/api/run-service
@@ -69,9 +69,9 @@ if ! test -f /var/lib/arvados/api_database_pw ; then
 fi
 database_pw=$(cat /var/lib/arvados/api_database_pw)
 
-if ! (psql -c "\du" | grep "^ arvados ") >/dev/null ; then
-    psql -c "create user arvados with password '$database_pw'"
-    psql -c "ALTER USER arvados CREATEDB;"
+if ! (psql postgres -c "\du" | grep "^ arvados ") >/dev/null ; then
+    psql postgres -c "create user arvados with password '$database_pw'"
+    psql postgres -c "ALTER USER arvados CREATEDB;"
 fi
 
 sed "s/password:.*/password: $database_pw/" <config/database.yml.example >config/database.yml
diff --git a/arvbox/lib/arvbox/docker/service/gitolite/run-service b/arvbox/lib/arvbox/docker/service/gitolite/run-service
index 8e6cb0e..e0e8771 100755
--- a/arvbox/lib/arvbox/docker/service/gitolite/run-service
+++ b/arvbox/lib/arvbox/docker/service/gitolite/run-service
@@ -40,7 +40,7 @@ if ! test -f /var/lib/arvados/gitolite-setup ; then
     ssh -o stricthostkeychecking=no git at localhost true
     rm .ssh/authorized_keys
 
-    cp -r /usr/local/lib/arvbox/gitolite.rc .
+    cp /usr/local/lib/arvbox/gitolite.rc .gitolite.rc
 
     gitolite setup -pk .ssh/id_rsa.pub
 
diff --git a/arvbox/lib/arvbox/docker/service/postgres/run-service b/arvbox/lib/arvbox/docker/service/postgres/run-service
index ecb0aa6..a05be62 100755
--- a/arvbox/lib/arvbox/docker/service/postgres/run-service
+++ b/arvbox/lib/arvbox/docker/service/postgres/run-service
@@ -5,7 +5,7 @@ set -eux -o pipefail
 
 if ! test -d /var/lib/postgresql/9.4/main ; then
     /usr/lib/postgresql/9.4/bin/initdb -D /var/lib/postgresql/9.4/main
-    sh -c "while ! (psql -c'\du' | grep '^ arvbox ') >/dev/null ; do createuser -s arvbox ; sleep 1 ; done" &
+    sh -c "while ! (psql postgres -c'\du' | grep '^ arvbox ') >/dev/null ; do createuser -s arvbox ; sleep 1 ; done" &
 fi
 mkdir -p /var/run/postgresql/9.4-main.pg_stat_tmp
 
diff --git a/arvbox/lib/arvbox/docker/service/sso/run-service b/arvbox/lib/arvbox/docker/service/sso/run-service
index 8a96d47..2f501a4 100755
--- a/arvbox/lib/arvbox/docker/service/sso/run-service
+++ b/arvbox/lib/arvbox/docker/service/sso/run-service
@@ -44,9 +44,9 @@ if ! test -f /var/lib/arvados/sso_database_pw ; then
 fi
 database_pw=$(cat /var/lib/arvados/sso_database_pw)
 
-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;"
+if ! (psql postgres -c "\du" | grep "^ arvados_sso ") >/dev/null ; then
+    psql postgres -c "create user arvados_sso with password '$database_pw'"
+    psql postgres -c "ALTER USER arvados_sso CREATEDB;"
 fi
 
 sed "s/password:.*/password: $database_pw/" <config/database.yml.example >config/database.yml
diff --git a/arvbox/lib/arvbox/docker/waitforpostgres.sh b/arvbox/lib/arvbox/docker/waitforpostgres.sh
index a07fa8c..84d9904 100755
--- a/arvbox/lib/arvbox/docker/waitforpostgres.sh
+++ b/arvbox/lib/arvbox/docker/waitforpostgres.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
-while ! psql -c\\du >/dev/null 2>/dev/null ; do
+while ! psql postgres -c\\du >/dev/null 2>/dev/null ; do
     sleep 1
 done

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list