[ARVADOS-DEV] updated: 589d24cf1dde32ecdd2ccdc003bee7af809ed976
git at public.curoverse.com
git at public.curoverse.com
Tue Jan 5 14:07:44 EST 2016
Summary of changes:
arvbox/bin/arvbox | 35 ++++++++++++++++++----
arvbox/lib/arvbox/docker/service/api/run-service | 5 +++-
arvbox/lib/arvbox/docker/service/sso/run-service | 8 +++--
arvbox/lib/arvbox/docker/service/workbench/run | 3 +-
.../arvbox/docker/service/workbench/run-service | 2 +-
5 files changed, 43 insertions(+), 10 deletions(-)
via 589d24cf1dde32ecdd2ccdc003bee7af809ed976 (commit)
from 0d421679b68f9916b83393f0bb2ef777c1b42d2d (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 589d24cf1dde32ecdd2ccdc003bee7af809ed976
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue Jan 5 14:07:41 2016 -0500
8080: Add back in passenger binary caching. Separate "reset" and "destroy"
commands. Add "clone".
diff --git a/arvbox/bin/arvbox b/arvbox/bin/arvbox
index ff93ac7..62bae22 100755
--- a/arvbox/bin/arvbox
+++ b/arvbox/bin/arvbox
@@ -32,9 +32,10 @@ fi
PG_DATA=$ARVBOX_DATA/postgres
VAR_DATA=$ARVBOX_DATA/var
+PASSENGER=$ARVBOX_DATA/passenger
GEMS=$ARVBOX_DATA/gems
-mkdir -p $PG_DATA $VAR_DATA $GEMS
+mkdir -p $PG_DATA $VAR_DATA $PASSENGER $GEMS
run() {
if ! test -d $ARVADOS_ROOT ; then
@@ -54,6 +55,7 @@ run() {
--volume=$SSO_ROOT:/usr/src/sso:rw \
--volume=$PG_DATA:/var/lib/postgresql:rw \
--volume=$VAR_DATA:/var/lib/arvados:rw \
+ --volume=$PASSENGER:/var/lib/passenger:rw \
--volume=$GEMS:/var/lib/gems:rw \
--volume=/var/lib/docker \
arvados/arvbox \
@@ -67,6 +69,7 @@ run() {
--volume=$SSO_ROOT:/usr/src/sso:rw \
--volume=$PG_DATA:/var/lib/postgresql:rw \
--volume=$VAR_DATA:/var/lib/arvados:rw \
+ --volume=$PASSENGER:/var/lib/passenger:rw \
--volume=$GEMS:/var/lib/gems:rw \
--volume=/var/lib/docker \
arvados/arvbox
@@ -122,7 +125,7 @@ case $1 in
;;
ip|open)
- IP=$(docker inspect arvbox | grep \"IPAddress\" | tr -d ' ":,\n' | cut -c10-)
+ IP=$(docker inspect $ARVBOX_CONTAINER | grep \"IPAddress\" | tr -d ' ":,\n' | cut -c10-)
if test $1 = 'ip' ; then
echo $IP
else
@@ -132,7 +135,17 @@ case $1 in
reset)
if test "$2" != -f ; then
- echo "WARNING! This will delete all code and data inside your arvbox ($ARVBOX_DATA). Use reset -f if you really mean it."
+ echo "WARNING! This will delete your database, git and keep files inside your arvbox ($ARVBOX_DATA). Use reset -f if you really mean it."
+ exit 1
+ fi
+ stop
+ rm -rf $ARVBOX_DATA/postgres
+ rm -rf $ARVBOX_DATA/var
+ ;;
+
+ destroy)
+ if test "$2" != -f ; then
+ echo "WARNING! This will delete all code and data inside your arvbox ($ARVBOX_DATA). Use destroy -f if you really mean it."
exit 1
fi
stop
@@ -179,10 +192,20 @@ case $1 in
"$@"
;;
+ clone)
+ if test -n "$3" ; then
+ cp -r $HOME/.arvbox/$2 $HOME/.arvbox/$3
+ echo "Created new arvbox $3"
+ echo "export ARVBOX_CONTAINER=$3"
+ else
+ echo "clone <from> <to> clone an arvbox"
+ fi
+ ;;
+
*)
echo "Arvados-in-a-box"
echo
- echo "$0 (build|start|run|open|shell|ip|stop|reboot|reset|run-tests|log|svrestart)"
+ echo "$0 (build|start|run|open|shell|ip|stop|reboot|reset|destroy|run-tests|log|svrestart)"
echo
echo "build build arvbox Docker image"
echo "start|run start $ARVBOX_CONTAINER container "
@@ -192,9 +215,11 @@ case $1 in
echo "stop stop arvbox container"
echo "restart stop, then run again"
echo "reboot stop, build arvbox Docker image, run"
- echo "reset delete all persistent data (be careful!)"
+ echo "reset delete arvbox arvados data (be careful!)"
+ echo "destroy delete all arvbox code and data (be careful!)"
echo "run-tests run run-tests.sh inside $ARVBOX_CONTAINER container"
echo "log <service> tail log of specified service"
echo "svrestart <service> restart specified service inside arvbox"
+ echo "clone <from> <to> clone an arvbox"
;;
esac
diff --git a/arvbox/lib/arvbox/docker/service/api/run-service b/arvbox/lib/arvbox/docker/service/api/run-service
index 5bd8621..78e709c 100755
--- a/arvbox/lib/arvbox/docker/service/api/run-service
+++ b/arvbox/lib/arvbox/docker/service/api/run-service
@@ -91,4 +91,7 @@ rm -rf tmp
bundle exec rake db:migrate
-ARVADOS_WEBSOCKETS=1 exec bundle exec passenger start -p3001 --ssl --ssl-certificate=/var/lib/arvados/self-signed.pem --ssl-certificate-key=/var/lib/arvados/self-signed.key
+ARVADOS_WEBSOCKETS=1 exec bundle exec passenger start --port=3001 \
+ --runtime-dir=/var/lib/passenger \
+ --ssl --ssl-certificate=/var/lib/arvados/self-signed.pem \
+ --ssl-certificate-key=/var/lib/arvados/self-signed.key
diff --git a/arvbox/lib/arvbox/docker/service/sso/run-service b/arvbox/lib/arvbox/docker/service/sso/run-service
index 085b79a..ac19760 100755
--- a/arvbox/lib/arvbox/docker/service/sso/run-service
+++ b/arvbox/lib/arvbox/docker/service/sso/run-service
@@ -38,9 +38,10 @@ 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_database_setup ; then
+if ! test -f /var/lib/arvados/sso_user_setup ; 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
@@ -85,4 +86,7 @@ rm -rf tmp
bundle exec rake db:migrate
export HOME=/var/lib/passenger
-exec bundle exec passenger start -p3002 --ssl --ssl-certificate=/var/lib/arvados/self-signed.pem --ssl-certificate-key=/var/lib/arvados/self-signed.key
+exec bundle exec passenger start --port=3002 \
+ --runtime-dir=/var/lib/passenger \
+ --ssl --ssl-certificate=/var/lib/arvados/self-signed.pem \
+ --ssl-certificate-key=/var/lib/arvados/self-signed.key
diff --git a/arvbox/lib/arvbox/docker/service/workbench/run b/arvbox/lib/arvbox/docker/service/workbench/run
index 7838220..665d848 100755
--- a/arvbox/lib/arvbox/docker/service/workbench/run
+++ b/arvbox/lib/arvbox/docker/service/workbench/run
@@ -9,4 +9,5 @@ rm -rf tmp
mkdir tmp
chown arvbox:arvbox tmp
-exec bundle exec passenger start --port 80 --user arvbox
+exec bundle exec passenger start --port 80 \
+ --user arvbox --runtime-dir=/var/lib/passenger
diff --git a/arvbox/lib/arvbox/docker/service/workbench/run-service b/arvbox/lib/arvbox/docker/service/workbench/run-service
index 09f929f..359f1e9 100755
--- a/arvbox/lib/arvbox/docker/service/workbench/run-service
+++ b/arvbox/lib/arvbox/docker/service/workbench/run-service
@@ -33,4 +33,4 @@ EOF
#bundle exec passenger start -p443 --ssl --ssl-certificate=self-signed.pem --ssl-certificate-key=self-signed.key
-bundle exec passenger start --runtime-check-only
+bundle exec passenger start --runtime-check-only --runtime-dir=/var/lib/passenger
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list