Merge branch '14826-cert-path' refs #14826
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Mon, 11 Feb 2019 19:54:53 +0000 (14:54 -0500)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Mon, 11 Feb 2019 19:54:53 +0000 (14:54 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

sdk/cwl/arvados_cwl/arvcontainer.py
sdk/cwl/arvados_cwl/http.py
sdk/cwl/setup.py
sdk/cwl/tests/test_http.py
sdk/cwl/tests/test_submit.py

index e921b26dfe78279c1ee22fb6a19c5e93569ed542..af7c02a8f30010bfe85e51a6928e63a5a617d37e 100644 (file)
@@ -499,6 +499,9 @@ class RunnerContainer(Runner):
             extra_submit_params["cluster_id"] = runtimeContext.submit_runner_cluster
 
         if runtimeContext.submit_request_uuid:
+            if "cluster_id" in extra_submit_params:
+                # Doesn't make sense for "update" and actually fails
+                del extra_submit_params["cluster_id"]
             response = self.arvrunner.api.container_requests().update(
                 uuid=runtimeContext.submit_request_uuid,
                 body=job_spec,
index ccc2e793b067f4e0853da275947a08d3630723a3..47a304372c58a27ecde8d8c13bb55d6435f9cf79 100644 (file)
@@ -132,7 +132,7 @@ def http_to_keep(api, project_uuid, url, utcnow=datetime.datetime.utcnow):
     count = 0
     start = time.time()
     checkpoint = start
-    with c.open(name, "w") as f:
+    with c.open(name, "wb") as f:
         for chunk in req.iter_content(chunk_size=1024):
             count += len(chunk)
             f.write(chunk)
index 711796374849c115296e089e31a44729330f45fb..22c49a01bf4ed31592db013ac5f2cb49c4e789cd 100644 (file)
@@ -37,7 +37,7 @@ setup(name='arvados-cwl-runner',
           'schema-salad==3.0.20181129082112',
           'typing >= 3.6.4',
           'ruamel.yaml >=0.15.54, <=0.15.77',
-          'arvados-python-client>=1.2.1.20181130020805',
+          'arvados-python-client>=1.3.0.20190205182514',
           'setuptools',
           'ciso8601 >=1.0.6, <2.0.0',
           'subprocess32>=3.5.1',
index 88bd49fcd329faee02fc29f777adbdd41d3f21a2..4119fee383e27bcfe30a97d3de754d1879c067a9 100644 (file)
@@ -60,7 +60,7 @@ class TestHttpToKeep(unittest.TestCase):
 
         getmock.assert_called_with("http://example.com/file1.txt", stream=True, allow_redirects=True)
 
-        cm.open.assert_called_with("file1.txt", "w")
+        cm.open.assert_called_with("file1.txt", "wb")
         cm.save_new.assert_called_with(name="Downloaded from http://example.com/file1.txt",
                                        owner_uuid=None, ensure_unique_name=True)
 
@@ -188,7 +188,7 @@ class TestHttpToKeep(unittest.TestCase):
 
         getmock.assert_called_with("http://example.com/file1.txt", stream=True, allow_redirects=True)
 
-        cm.open.assert_called_with("file1.txt", "w")
+        cm.open.assert_called_with("file1.txt", "wb")
         cm.save_new.assert_called_with(name="Downloaded from http://example.com/file1.txt",
                                        owner_uuid=None, ensure_unique_name=True)
 
@@ -279,7 +279,7 @@ class TestHttpToKeep(unittest.TestCase):
 
         getmock.assert_called_with("http://example.com/download?fn=/file1.txt", stream=True, allow_redirects=True)
 
-        cm.open.assert_called_with("file1.txt", "w")
+        cm.open.assert_called_with("file1.txt", "wb")
         cm.save_new.assert_called_with(name="Downloaded from http://example.com/download?fn=/file1.txt",
                                        owner_uuid=None, ensure_unique_name=True)
 
index 782282d2a0d4312a8a25a18b970d009bc6a9f66f..39117d86e3ca976ffaa19e1e5596e37bf018b842 100644 (file)
@@ -512,7 +512,7 @@ class TestSubmit(unittest.TestCase):
             body=JsonDiffMatcher(expect_pipeline))
 
     @stubs
-    def test_submit_container(self, stubs):        
+    def test_submit_container(self, stubs):
         exited = arvados_cwl.main(
             ["--submit", "--no-wait", "--api=containers", "--debug",
                 "tests/wf/submit_wf.cwl", "tests/submit_test_job.json"],
@@ -559,7 +559,7 @@ class TestSubmit(unittest.TestCase):
         stubs.api.container_requests().create.assert_called_with(
             body=JsonDiffMatcher(expect_container))
         self.assertEqual(stubs.capture_stdout.getvalue(),
-                         stubs.expect_container_request_uuid + '\n') 
+                         stubs.expect_container_request_uuid + '\n')
         self.assertEqual(exited, 0)
 
     @stubs
@@ -602,7 +602,7 @@ class TestSubmit(unittest.TestCase):
             ["--submit", "--no-wait", "--api=containers", "--debug", "--on-error=stop",
                 "tests/wf/submit_wf.cwl", "tests/submit_test_job.json"],
             stubs.capture_stdout, sys.stderr, api_client=stubs.api, keep_client=stubs.keep_client)
+
         expect_container = copy.deepcopy(stubs.expect_container_spec)
         expect_container["command"] = ['arvados-cwl-runner', '--local', '--api=containers',
                                        '--no-log-timestamps', '--disable-validate',
@@ -620,7 +620,7 @@ class TestSubmit(unittest.TestCase):
     @stubs
     def test_submit_container_output_name(self, stubs):
         output_name = "test_output_name"
-  
+
         exited = arvados_cwl.main(
             ["--submit", "--no-wait", "--api=containers", "--debug", "--output-name", output_name,
                 "tests/wf/submit_wf.cwl", "tests/submit_test_job.json"],
@@ -642,7 +642,7 @@ class TestSubmit(unittest.TestCase):
         self.assertEqual(exited, 0)
 
     @stubs
-    def test_submit_storage_classes(self, stubs):     
+    def test_submit_storage_classes(self, stubs):
         exited = arvados_cwl.main(
             ["--debug", "--submit", "--no-wait", "--api=containers", "--storage-classes=foo",
                 "tests/wf/submit_wf.cwl", "tests/submit_test_job.json"],
@@ -726,7 +726,7 @@ class TestSubmit(unittest.TestCase):
             ["--submit", "--no-wait", "--api=containers", "--debug", "--trash-intermediate",
                 "tests/wf/submit_wf.cwl", "tests/submit_test_job.json"],
             stubs.capture_stdout, sys.stderr, api_client=stubs.api, keep_client=stubs.keep_client)
-            
+
 
         expect_container = copy.deepcopy(stubs.expect_container_spec)
         expect_container["command"] = ['arvados-cwl-runner', '--local', '--api=containers',
@@ -1394,7 +1394,7 @@ class TestSubmit(unittest.TestCase):
             stubs.capture_stdout, sys.stderr, api_client=stubs.api, keep_client=stubs.keep_client)
 
         stubs.api.container_requests().update.assert_called_with(
-            uuid="zzzzz-xvhdp-yyyyyyyyyyyyyyy", body=JsonDiffMatcher(stubs.expect_container_spec), cluster_id="zzzzz")
+            uuid="zzzzz-xvhdp-yyyyyyyyyyyyyyy", body=JsonDiffMatcher(stubs.expect_container_spec))
         self.assertEqual(stubs.capture_stdout.getvalue(),
                          stubs.expect_container_request_uuid + '\n')
         self.assertEqual(exited, 0)
@@ -1541,7 +1541,7 @@ class TestCreateTemplate(unittest.TestCase):
         self.assertEqual(stubs.capture_stdout.getvalue(),
                          self.existing_template_uuid + '\n')
         self.assertEqual(exited, 0)
-        
+
 
 class TestCreateWorkflow(unittest.TestCase):
     existing_workflow_uuid = "zzzzz-7fd4e-validworkfloyml"