[ARVADOS] updated: 659b49449d313cdb218a46ca36ac124674a4d00b

Git user git at public.curoverse.com
Wed Mar 22 11:57:24 EDT 2017


Summary of changes:
 docker/migrate-docker19/migrate.sh | 38 +++++++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 9 deletions(-)

       via  659b49449d313cdb218a46ca36ac124674a4d00b (commit)
      from  05c97120decfeeb9ba2faa20561ee1f37c8293ba (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 659b49449d313cdb218a46ca36ac124674a4d00b
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Mar 22 11:57:17 2017 -0400

    8567: Add start_docker and kill_docker functions with wait loops.

diff --git a/docker/migrate-docker19/migrate.sh b/docker/migrate-docker19/migrate.sh
index bdc267a..8e39be4 100755
--- a/docker/migrate-docker19/migrate.sh
+++ b/docker/migrate-docker19/migrate.sh
@@ -2,17 +2,39 @@
 
 set -e
 
+function start_docker {
+    /root/dnd.sh &
+    for i in $(seq 1 10) ; do
+        if docker version >/dev/null 2>/dev/null ; then
+            return
+        fi
+        sleep 1
+    done
+    false
+}
+
+function kill_docker {
+    if test -f /var/run/docker.pid ; then
+        kill $(cat /var/run/docker.pid)
+    fi
+    for i in $(seq 1 10) ; do
+        if ! docker version >/dev/null 2>/dev/null ; then
+            return
+        fi
+        sleep 1
+    done
+    false
+}
+
 function cleanup {
-    kill $(cat /var/run/docker.pid)
-    sleep 1
+    kill_docker
     rm -rf /var/lib/docker/*
     rm -rf /root/.cache/arvados/docker/*
 }
 
 trap cleanup EXIT
 
-/root/dnd.sh &
-sleep 2
+start_docker
 
 image_tar_keepref=$1
 image_id=$2
@@ -26,14 +48,12 @@ docker tag $image_id $image_repo:$image_tag
 
 docker images -a
 
-kill $(cat /var/run/docker.pid)
-sleep 1
+kill_docker
 
 cd /root/pkgs
-dpkg -i libltdl7_2.4.2-1.11+b1_amd64.deb  docker-engine_1.13.1-0~debian-jessie_amd64.deb
+dpkg -i libltdl7_2.4.2-1.11+b1_amd64.deb docker-engine_1.13.1-0~debian-jessie_amd64.deb
 
-/root/dnd.sh &
-sleep 2
+start_docker
 
 docker images -a
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list