[ARVADOS] updated: 93384273eec4967dd51c4c4e6c2ad76f0cd3861c

Git user git at public.curoverse.com
Mon Mar 6 10:39:59 EST 2017


Summary of changes:
 tools/docker-migrator/docker/migrate.sh | 17 +++++++++++------
 tools/docker-migrator/migrate.py        | 20 ++++++++++----------
 2 files changed, 21 insertions(+), 16 deletions(-)

       via  93384273eec4967dd51c4c4e6c2ad76f0cd3861c (commit)
      from  cee1c18cbf6dedf79a11655113347c166f1214ff (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 93384273eec4967dd51c4c4e6c2ad76f0cd3861c
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Mar 6 10:39:57 2017 -0500

    8567: Creates migration links.

diff --git a/tools/docker-migrator/docker/migrate.sh b/tools/docker-migrator/docker/migrate.sh
index 5638950..63d7274 100755
--- a/tools/docker-migrator/docker/migrate.sh
+++ b/tools/docker-migrator/docker/migrate.sh
@@ -2,13 +2,18 @@
 
 set -e
 
-#/root/dnd.sh &
-/migrator/dnd.sh &
+/root/dnd.sh &
 sleep 2
 
-arv-get $1 | docker load
+image_tar_keepref=$1
+image_id=$2
+image_repo=$3
+image_tag=$4
+project_uuid=$5
 
-docker tag $2 $3:$4
+arv-get $image_tar_keepref | docker load
+
+docker tag $image_id $image_repo:$image_tag
 
 docker images -a
 
@@ -18,12 +23,12 @@ sleep 1
 cd /root/pkgs
 dpkg -i libltdl7_2.4.2-1.11+b1_amd64.deb  docker-engine_1.13.1-0~debian-jessie_amd64.deb
 
-/migrator/dnd.sh &
+/root/dnd.sh &
 sleep 2
 
 docker images -a
 
-UUID=$(arv-keepdocker --project-uuid=$5 $3 $4)
+UUID=$(arv-keepdocker --project-uuid=$project_uuid $image_repo $image_tag)
 
 kill $(cat /var/run/docker.pid)
 sleep 1
diff --git a/tools/docker-migrator/migrate.py b/tools/docker-migrator/migrate.py
index 4fd7dd6..23b8166 100755
--- a/tools/docker-migrator/migrate.py
+++ b/tools/docker-migrator/migrate.py
@@ -27,8 +27,6 @@ def main():
         key = (img["repo"], img["tag"], img["timestamp"])
         old_images.append(img)
 
-    print old_images
-
     migration_links = arvados.util.list_all(api_client.links().list, filters=[
         ['link_class', '=', arvados.commands.keepdocker._migration_link_class],
         ['name', '=', arvados.commands.keepdocker._migration_link_name],
@@ -38,12 +36,6 @@ def main():
     for m in migration_links:
         already_migrated.add(m["tail_uuid"])
 
-#            ['tail_uuid', '=', old_pdh],
-#            ['head_uuid', '=', new_pdh]]).execute()['items']
-
-    pprint(old_images)
-    pprint(already_migrated)
-
     for old_image in old_images:
         if old_image["collection"] in already_migrated:
             continue
@@ -66,12 +58,20 @@ def main():
                          tarfile[0:40],
                          old_image["repo"],
                          old_image["tag"],
-                         old_image["owner_uuid"]]
+                         col.api_response()["owner_uuid"]]
 
             out = subprocess.check_output(dockercmd)
 
             new_collection = re.search(r"Migrated uuid is ([a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15})", out)
-            print "New collection is '%s'" % new_collection.group(1)
+            api_client.links().create(body={"link": {
+                'owner_uuid': col.api_response()["owner_uuid"],
+                'link_class': arvados.commands.keepdocker._migration_link_class,
+                'name': arvados.commands.keepdocker._migration_link_name,
+                'tail_uuid': old_image["collection"],
+                'head_uuid': new_collection.group(1)
+                }}).execute(num_retries=3)
+
+            print "Migrated '%s' to '%s'" % (old_image["collection"], new_collection.group(1))
         finally:
             shutil.rmtree(varlibdocker)
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list