[ARVADOS] created: 1.3.0-2091-gc8828ded7

Git user git at public.arvados.org
Fri Jan 17 19:49:28 UTC 2020


        at  c8828ded72f562811dfe29ca20809dd5641f7a1d (commit)


commit c8828ded72f562811dfe29ca20809dd5641f7a1d
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Jan 17 14:47:23 2020 -0500

    16046: Replace slash with space for "repo/image" collection name
    
    Add a property with the original repo/image name so that it is still
    findable in search.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/sdk/python/arvados/commands/keepdocker.py b/sdk/python/arvados/commands/keepdocker.py
index 62b9a9ed1..c89fa644c 100644
--- a/sdk/python/arvados/commands/keepdocker.py
+++ b/sdk/python/arvados/commands/keepdocker.py
@@ -405,7 +405,7 @@ def main(arguments=None, stdout=sys.stdout, install_sig_handlers=True, api=None)
 
     if args.name is None:
         if image_repo_tag:
-            collection_name = 'Docker image {} {}'.format(image_repo_tag, image_hash[0:12])
+            collection_name = 'Docker image {} {}'.format(image_repo_tag.replace("/", " "), image_hash[0:12])
         else:
             collection_name = 'Docker image {}'.format(image_hash[0:12])
     else:
@@ -463,7 +463,8 @@ def main(arguments=None, stdout=sys.stdout, install_sig_handlers=True, api=None)
                         coll_uuid = api.collections().create(
                             body={"manifest_text": collections[0]['manifest_text'],
                                   "name": collection_name,
-                                  "owner_uuid": parent_project_uuid},
+                                  "owner_uuid": parent_project_uuid,
+                                  "properties": {"docker-image-repo-tag": image_repo_tag}},
                             ensure_unique_name=True
                             ).execute(num_retries=args.retries)['uuid']
 
@@ -504,6 +505,8 @@ def main(arguments=None, stdout=sys.stdout, install_sig_handlers=True, api=None)
             put_args + ['--filename', outfile_name, image_file.name], stdout=stdout,
             install_sig_handlers=install_sig_handlers).strip()
 
+        api.collections().update(uuid=coll_uuid, body={"properties": {"docker-image-repo-tag": image_repo_tag}}).execute(num_retries=args.retries)
+
         # Read the image metadata and make Arvados links from it.
         image_file.seek(0)
         image_tar = tarfile.open(fileobj=image_file)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list