[ARVADOS] updated: dc2979a545f9b9f62cbaa7d8df4b566aac3835b4

Git user git at public.curoverse.com
Thu Oct 27 10:42:57 EDT 2016


Summary of changes:
 services/workflow-importer/workflowimporter.py | 30 ++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

       via  dc2979a545f9b9f62cbaa7d8df4b566aac3835b4 (commit)
      from  6900f0920864ca1ed50eb46a762d3900c682a57f (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 dc2979a545f9b9f62cbaa7d8df4b566aac3835b4
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Oct 27 10:42:51 2016 -0400

    10344: Tweak Docker naming and some error reporting.

diff --git a/services/workflow-importer/workflowimporter.py b/services/workflow-importer/workflowimporter.py
index 324c99a..f48e711 100755
--- a/services/workflow-importer/workflowimporter.py
+++ b/services/workflow-importer/workflowimporter.py
@@ -7,6 +7,7 @@ import tempfile
 import shutil
 import argparse
 import StringIO
+import urlparse
 
 import arvados
 import arvados.commands.keepdocker as keepdocker
@@ -14,7 +15,14 @@ import arvados.commands.arv_copy as arv_copy
 import arvados_cwl
 
 def registerDocker((api, reporecord, prefix, branch), dirname, names):
-    name = reporecord["name"]
+    sp = urlparse.urlsplit(reporecord["name"])
+    name = sp.path
+    if name.startswith("/"):
+        name = name[1:]
+    if name.endswith(".git"):
+        name = name[0:-4]
+    name = "/".join(name.split("/")[-2:])
+
     dockerfile = None
     if "Dockerfile" in names:
         dockerfile = "Dockerfile"
@@ -52,12 +60,12 @@ def registerCWL((api, reporecord, prefix, branch), dirname, names):
     if uuid:
         rval = arvados_cwl.main(["--update-workflow="+uuid, cwlfile], stdout, stderr)
         if rval != 0:
-            raise Exception()
+            raise Exception(stderr.getvalue())
         print "Updated workflow", uuid
     else:
         rval = arvados_cwl.main(["--create-workflow", cwlfile], stdout, stderr)
         if rval != 0:
-            raise Exception()
+            raise Exception(stderr.getvalue())
         wf = api.links().create(body={"link_class": "workflow-import",
                                       "tail_uuid": reporecord["uuid"],
                                       "head_uuid": stdout.getvalue().strip(),
@@ -65,7 +73,11 @@ def registerCWL((api, reporecord, prefix, branch), dirname, names):
         print "Created workflow", wf["uuid"]
 
 def gitclone(api, repo, insecure_http):
-    (src_git_url, src_git_config) = arv_copy.select_git_url(api, repo, 3, insecure_http, "--insecure-http")
+    if not (repo.startswith("http://") or repo.startswith("https://") or repo.startswith("/")):
+        (src_git_url, src_git_config) = arv_copy.select_git_url(api, repo, 3, insecure_http, "--insecure-http")
+    else:
+        src_git_config = []
+        src_git_url = repo
 
     tempdir = tempfile.mkdtemp()
     arvados.util.run_command(
@@ -87,13 +99,19 @@ def main(argv):
     parser = argparse.ArgumentParser()
     parser.add_argument('--insecure-http', default=False, action="store_true")
     parser.add_argument('repo', nargs="?", default=None)
-    parser.add_argument('branch', nargs="?", default=None)
+    parser.add_argument('branch', nargs="?", default="master")
     args = parser.parse_args(argv)
 
     if args.repo is None:
         items = api.repositories().list().execute()["items"]
     else:
-        items = api.repositories().list(filters=[["name", "=", args.repo]]).execute()["items"]
+        sp = urlparse.urlsplit(args.repo)
+        if sp.scheme:
+            items = [{"name": args.repo, "uuid": None}]
+        elif os.path.isdir(args.repo):
+            items = [{"name": os.path.abspath(args.repo), "uuid": None}]
+        else:
+            items = api.repositories().list(filters=[["name", "=", args.repo]]).execute()["items"]
 
     for i in items:
         name = i["name"]

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list