Merge branch 'master' into 8345-llfuse-unpin
authorTom Clegg <tom@curoverse.com>
Tue, 1 Mar 2016 07:42:46 +0000 (02:42 -0500)
committerTom Clegg <tom@curoverse.com>
Tue, 1 Mar 2016 07:42:46 +0000 (02:42 -0500)
15 files changed:
arvbox/bin/arvbox
arvbox/lib/arvbox/docker/Dockerfile.base
arvbox/lib/arvbox/docker/Dockerfile.demo
arvbox/lib/arvbox/docker/Dockerfile.dev
arvbox/lib/arvbox/docker/service/slurmctld/log/main/.gitstub [new file with mode: 0644]
arvbox/lib/arvbox/docker/service/slurmctld/log/run [new symlink]
arvbox/lib/arvbox/docker/service/slurmctld/run [new file with mode: 0755]
arvbox/lib/arvbox/docker/service/slurmd/log/main/.gitstub [new file with mode: 0644]
arvbox/lib/arvbox/docker/service/slurmd/log/run [new symlink]
arvbox/lib/arvbox/docker/service/slurmd/run [new file with mode: 0755]
arvbox/lib/arvbox/docker/service/vm/run
arvbox/lib/arvbox/docker/service/vm/run-service
jenkins/rails-package-scripts/postinst.sh
jenkins/rails-package-scripts/postrm.sh
jenkins/run-library.sh

index 7be361b8783c4ada17e2a215fbbcf0184621f9ce..d790cb6b9f44346011ed41240a039a4d494d6b9f 100755 (executable)
@@ -358,10 +358,9 @@ case "$subcmd" in
         fi
         ;;
 
-    svrestart)
+    sv)
         if test -n "$1" ; then
-            docker exec -ti $ARVBOX_CONTAINER sv restart "$1"
-            docker exec -ti $ARVBOX_CONTAINER sv restart ready
+            docker exec -ti $ARVBOX_CONTAINER sv "$1" "$2"
         else
             echo "Usage: $0 $subcmd <service>"
             echo "Available services:"
@@ -397,7 +396,7 @@ case "$subcmd" in
         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"
-        echo "svrestart <service> restart specified service inside arvbox"
+        echo "sv        <start|stop|restart> <service> change state of service inside arvbox"
         echo "clone <from> <to>   clone an arvbox"
         ;;
 esac
index 160afeed48c496f41c5e4b15910645d505af24a7..280ac6854e1540f8ff82905a29d5572953731d50 100644 (file)
@@ -10,7 +10,7 @@ RUN apt-get update && \
     pkg-config libattr1-dev python-llfuse python-pycurl \
     libwww-perl libio-socket-ssl-perl libcrypt-ssleay-perl \
     libjson-perl nginx gitolite3 lsof python-epydoc graphviz \
-    apt-transport-https ca-certificates
+    apt-transport-https ca-certificates slurm-wlm
 
 VOLUME /var/lib/docker
 VOLUME /var/log/nginx
@@ -38,8 +38,5 @@ ADD crunch-setup.sh gitolite.rc \
     application_yml_override.py \
     /usr/local/lib/arvbox/
 
-ADD service/ /var/lib/arvbox/service
-RUN rmdir /etc/service && ln -sf /var/lib/arvbox/service /etc
-
 # Start the supervisor.
 CMD ["/usr/local/bin/runsvinit"]
index d3e36c63b2ae8dad3f1548599b0a2042e63fc38d..1f134159f7236f4e7d3c5aaddab13b0a7146b0fe 100644 (file)
@@ -4,6 +4,9 @@ RUN cd /usr/src && \
     git clone https://github.com/curoverse/arvados.git && \
     git clone https://github.com/curoverse/sso-devise-omniauth-provider.git sso
 
+ADD service/ /var/lib/arvbox/service
+RUN rmdir /etc/service && ln -sf /var/lib/arvbox/service /etc
+
 RUN chown -R 1000:1000 /usr/src && /usr/local/lib/arvbox/createusers.sh
 
 RUN sudo -u arvbox /var/lib/arvbox/service/sso/run-service --only-deps
index 5ec73bbe68476873675ac703a64e10d89a93cb42..051c274f284974a9c9435fea7d9c6d023ec872ee 100644 (file)
@@ -10,4 +10,7 @@ RUN set -e && \
  tar -C /usr/local -xjf /tmp/$PJS.tar.bz2 && \
  ln -s ../$PJS/bin/phantomjs /usr/local/bin/
 
+ADD service/ /var/lib/arvbox/service
+RUN rmdir /etc/service && ln -sf /var/lib/arvbox/service /etc
+
 RUN mkdir /etc/test-service && ln -sf /var/lib/arvbox/service/postgres /etc/test-service
diff --git a/arvbox/lib/arvbox/docker/service/slurmctld/log/main/.gitstub b/arvbox/lib/arvbox/docker/service/slurmctld/log/main/.gitstub
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/arvbox/lib/arvbox/docker/service/slurmctld/log/run b/arvbox/lib/arvbox/docker/service/slurmctld/log/run
new file mode 120000 (symlink)
index 0000000..d6aef4a
--- /dev/null
@@ -0,0 +1 @@
+/usr/local/lib/arvbox/logger
\ No newline at end of file
diff --git a/arvbox/lib/arvbox/docker/service/slurmctld/run b/arvbox/lib/arvbox/docker/service/slurmctld/run
new file mode 100755 (executable)
index 0000000..bd75bd0
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+exec 2>&1
+set -eux -o pipefail
+
+. /usr/local/lib/arvbox/common.sh
+
+cat > /etc/slurm-llnl/slurm.conf  <<EOF
+ControlMachine=$HOSTNAME
+ControlAddr=$HOSTNAME
+AuthType=auth/munge
+DefaultStorageLoc=/var/log/slurm-llnl
+SelectType=select/cons_res
+SelectTypeParameters=CR_CPU_Memory
+SlurmUser=arvbox
+SlurmdUser=arvbox
+SlurmctldPort=7002
+SlurmctldTimeout=300
+SlurmdPort=7003
+SlurmdSpoolDir=/var/tmp/slurmd.spool
+SlurmdTimeout=300
+StateSaveLocation=/var/tmp/slurm.state
+NodeName=$HOSTNAME
+PartitionName=compute State=UP Default=YES Nodes=$HOSTNAME
+EOF
+
+mkdir -p /var/run/munge
+
+/usr/sbin/munged -f
+
+exec /usr/sbin/slurmctld -v -D
diff --git a/arvbox/lib/arvbox/docker/service/slurmd/log/main/.gitstub b/arvbox/lib/arvbox/docker/service/slurmd/log/main/.gitstub
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/arvbox/lib/arvbox/docker/service/slurmd/log/run b/arvbox/lib/arvbox/docker/service/slurmd/log/run
new file mode 120000 (symlink)
index 0000000..d6aef4a
--- /dev/null
@@ -0,0 +1 @@
+/usr/local/lib/arvbox/logger
\ No newline at end of file
diff --git a/arvbox/lib/arvbox/docker/service/slurmd/run b/arvbox/lib/arvbox/docker/service/slurmd/run
new file mode 100755 (executable)
index 0000000..865a7e6
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+exec 2>&1
+set -eux -o pipefail
+
+exec /usr/local/lib/arvbox/runsu.sh /usr/sbin/slurmd -v -D
index b7fb9cc41f8f02d9336c9ce80b7917f9b49d25a0..0c10cb0c93f63adfb712d83233308dbeff2a6a4e 100755 (executable)
@@ -6,4 +6,16 @@ set -e
 git config --system "credential.http://$localip:${services[arv-git-httpd]}/.username" none
 git config --system "credential.http://$localip:${services[arv-git-httpd]}/.helper" '!cred(){ cat >/dev/null; if [ "$1" = get ]; then echo password=$ARVADOS_API_TOKEN; fi; };cred'
 
-exec /usr/local/lib/arvbox/runsu.sh $0-service
+/usr/local/lib/arvbox/runsu.sh $0-service
+
+cd /usr/src/arvados/services/login-sync
+
+export ARVADOS_API_HOST=$localip:${services[api]}
+export ARVADOS_API_HOST_INSECURE=1
+export ARVADOS_API_TOKEN=$(cat /var/lib/arvados/superuser_token)
+export ARVADOS_VIRTUAL_MACHINE_UUID=$(cat /var/lib/arvados/vm-uuid)
+
+while true ; do
+      bundle exec arvados-login-sync
+      sleep 120
+done
index 5bb68257c58b8f2533667e96e244cec336b90722..fb209f55ff93e4a815cbd59335220c0df3981bec 100755 (executable)
@@ -34,8 +34,3 @@ if arv virtual_machine get --uuid $ARVADOS_VIRTUAL_MACHINE_UUID ; then
 else
     arv virtual_machine create --virtual-machine "$vm"
 fi
-
-while true ; do
-      bundle exec arvados-login-sync
-      sleep 120
-done
index 5ff2a9b2c9d33941cdcdc89c8030f3103d60a7b3..6fac26be8eb34d56d31ccf73df3885501cdfe005 100644 (file)
@@ -94,11 +94,13 @@ setup_conffile() {
         # If there's a config file in /var/www identical to the one in /etc,
         # overwrite it with a symlink after porting its permissions.
         elif cmp --quiet "$release_conffile" "$etc_conffile"; then
-            local ownership="$(stat -c "%U:%G" "$release_conffile")"
+            local ownership="$(stat -c "%u:%g" "$release_conffile")"
+            local owning_group="${ownership#*:}"
+            if [ 0 != "$owning_group" ]; then
+                chgrp "$owning_group" "$CONFIG_PATH" /etc/arvados
+            fi
             chown "$ownership" "$etc_conffile"
             chmod --reference="$release_conffile" "$etc_conffile"
-            chgrp "${ownership#*:}" "$CONFIG_PATH" /etc/arvados
-            chmod g+rx "$CONFIG_PATH" /etc/arvados
             ln --force -s "$etc_conffile" "$release_conffile"
         fi
     fi
index 8c45d2f8ce78e1e9b5e33341070cc0011d7c4a27..2d63f0b9e87cc3bb2fced7b7d4d3e97f032c66a5 100644 (file)
@@ -14,7 +14,7 @@ purge () {
 if [ "$1" = 'purge' ]; then
   # This is a debian-based system and purge was requested
   purge
-elif [ "$1" = "0" ] || [ "$1" = "1" ] || [ "$1" = "2" ]; then
+elif [ "$1" = "0" ]; then
   # This is an rpm-based system, no guarantees are made, always purge
   # Apparently yum doesn't actually remember what it installed.
   # Clean those files up here, then purge.
index 1ebaa551f99c9b031d58040c6a6a69fee077694b..bec5279cef254a631cc84517ab4750197ae70a16 100755 (executable)
@@ -148,9 +148,8 @@ handle_rails_package() {
     local -a pos_args=("$srcdir/=$railsdir" "$pkgname" "Curoverse, Inc." dir
                        "$(cat "$version_file")")
     local license_arg="$license_path=$railsdir/$(basename "$license_path")"
-    # --iteration=3 accommodates the package scripts change from #8014.
-    # --iteration=4 accommodates the packaging changes (inclusion of vendor/cache) from #8008.
-    local -a switches=(--iteration=4
+    # --iteration=5 accommodates the package script bugfixes #8371 and #8413.
+    local -a switches=(--iteration=5
                        --after-install "$scripts_dir/postinst"
                        --before-remove "$scripts_dir/prerm"
                        --after-remove "$scripts_dir/postrm")