[ARVADOS] updated: 1.2.0-97-gf159fab8f

Git user git at public.curoverse.com
Wed Sep 5 14:53:58 EDT 2018


Summary of changes:
 sdk/cwl/arvados_cwl/__init__.py | 9 +++++++--
 sdk/python/arvados/api.py       | 8 +++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

       via  f159fab8f9d6bc4254192ce43432defd5bd400aa (commit)
       via  0e435239a486e09a889d4f09a30f42053b9f687f (commit)
       via  71e0f70a3095f669e4b136c9d7624c26634db0d3 (commit)
      from  e780e337d170036a69879debeb347a9c26a81518 (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 f159fab8f9d6bc4254192ce43432defd5bd400aa
Merge: e780e337d 0e435239a
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Wed Sep 5 14:53:17 2018 -0400

    Merge branch 'wtsi/python-api-timeout' refs #13542
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --cc sdk/cwl/arvados_cwl/__init__.py
index 8c3f0eade,ffccf4e97..da24dc484
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@@ -537,13 -506,13 +537,13 @@@ http://doc.arvados.org/install/install-
                      "state": "RunningOnClient"}).execute(num_retries=self.num_retries)
              logger.info("Pipeline instance %s", self.pipeline["uuid"])
  
 -        if runnerjob and not kwargs.get("wait"):
 -            submitargs = kwargs.copy()
 -            submitargs['submit'] = False
 -            runnerjob.run(**submitargs)
 +        if runnerjob and not runtimeContext.wait:
 +            submitargs = runtimeContext.copy()
 +            submitargs.submit = False
 +            runnerjob.run(submitargs)
              return (runnerjob.uuid, "success")
  
-         self.poll_api = arvados.api('v1')
+         self.poll_api = arvados.api('v1', timeout=kwargs["http_timeout"])
          self.polling_thread = threading.Thread(target=self.poll_states)
          self.polling_thread.start()
  
@@@ -844,13 -804,16 +847,15 @@@ def main(args, stdout, stderr, api_clie
  
      try:
          if api_client is None:
-             api_client = arvados.safeapi.ThreadSafeApiCache(api_params={"model": OrderedJsonModel()}, keep_params={"num_retries": 4})
+             api_client = arvados.safeapi.ThreadSafeApiCache(
+                 api_params={"model": OrderedJsonModel(), "timeout": arvargs.http_timeout},
+                 keep_params={"num_retries": 4})
              keep_client = api_client.keep
 +            # Make an API object now so errors are reported early.
 +            api_client.users().current().execute()
          if keep_client is None:
              keep_client = arvados.keep.KeepClient(api_client=api_client, num_retries=4)
 -        runner = ArvCwlRunner(api_client, work_api=arvargs.work_api, keep_client=keep_client,
 -                              num_retries=4, output_name=arvargs.output_name,
 -                              output_tags=arvargs.output_tags,
 -                              thread_count=arvargs.thread_count)
 +        runner = ArvCwlRunner(api_client, arvargs, keep_client=keep_client, num_retries=4)
      except Exception as e:
          logger.error(e)
          return 1

commit 0e435239a486e09a889d4f09a30f42053b9f687f
Author: Joshua C. Randall <joshua.randall at sanger.ac.uk>
Date:   Thu Jun 14 18:21:29 2018 +0100

    change http timeout keyword from `http-timeout` to `http_timeout`

diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index 2f11f996e..ffccf4e97 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -512,7 +512,7 @@ class ArvCwlRunner(object):
             runnerjob.run(**submitargs)
             return (runnerjob.uuid, "success")
 
-        self.poll_api = arvados.api('v1', timeout=kwargs["http-timeout"])
+        self.poll_api = arvados.api('v1', timeout=kwargs["http_timeout"])
         self.polling_thread = threading.Thread(target=self.poll_states)
         self.polling_thread.start()
 
@@ -738,7 +738,7 @@ def arg_parser():  # type: () -> argparse.ArgumentParser
                         default=4, help="Number of threads to use for job submit and output collection.")
 
     parser.add_argument("--http-timeout", type=int,
-                        default=5*60, help="Http timeout. Default is 5 minutes.")
+                        default=5*60, dest="http_timeout", help="Http timeout. Default is 5 minutes.")
 
     exgroup = parser.add_mutually_exclusive_group()
     exgroup.add_argument("--trash-intermediate", action="store_true",

commit 71e0f70a3095f669e4b136c9d7624c26634db0d3
Author: ThomasHickman <Thomas.Hickman42 at gmail.com>
Date:   Tue May 29 09:15:42 2018 +0100

    Add timeout for the python api + A.C.R.
    
    Arvados-DCO-1.1-Signed-off-by: Thomas Hickman <th10 at sanger.ac.uk>

diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index 5b29ae517..2f11f996e 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -512,7 +512,7 @@ class ArvCwlRunner(object):
             runnerjob.run(**submitargs)
             return (runnerjob.uuid, "success")
 
-        self.poll_api = arvados.api('v1')
+        self.poll_api = arvados.api('v1', timeout=kwargs["http-timeout"])
         self.polling_thread = threading.Thread(target=self.poll_states)
         self.polling_thread.start()
 
@@ -737,6 +737,9 @@ def arg_parser():  # type: () -> argparse.ArgumentParser
     parser.add_argument("--thread-count", type=int,
                         default=4, help="Number of threads to use for job submit and output collection.")
 
+    parser.add_argument("--http-timeout", type=int,
+                        default=5*60, help="Http timeout. Default is 5 minutes.")
+
     exgroup = parser.add_mutually_exclusive_group()
     exgroup.add_argument("--trash-intermediate", action="store_true",
                         default=False, dest="trash_intermediate",
@@ -801,7 +804,9 @@ def main(args, stdout, stderr, api_client=None, keep_client=None,
 
     try:
         if api_client is None:
-            api_client = arvados.safeapi.ThreadSafeApiCache(api_params={"model": OrderedJsonModel()}, keep_params={"num_retries": 4})
+            api_client = arvados.safeapi.ThreadSafeApiCache(
+                api_params={"model": OrderedJsonModel(), "timeout": arvargs.http_timeout},
+                keep_params={"num_retries": 4})
             keep_client = api_client.keep
         if keep_client is None:
             keep_client = arvados.keep.KeepClient(api_client=api_client, num_retries=4)
diff --git a/sdk/python/arvados/api.py b/sdk/python/arvados/api.py
index 4611a1aad..7e9ad1ee8 100644
--- a/sdk/python/arvados/api.py
+++ b/sdk/python/arvados/api.py
@@ -149,7 +149,7 @@ def http_cache(data_type):
     return cache.SafeHTTPCache(path, max_age=60*60*24*2)
 
 def api(version=None, cache=True, host=None, token=None, insecure=False,
-        request_id=None, **kwargs):
+        request_id=None, timeout=5*60, **kwargs):
     """Return an apiclient Resources object for an Arvados instance.
 
     :version:
@@ -169,6 +169,9 @@ def api(version=None, cache=True, host=None, token=None, insecure=False,
     :insecure:
       If True, ignore SSL certificate validation errors.
 
+    :timeout:
+      A timeout value for http requests.
+
     :request_id:
       Default X-Request-Id header value for outgoing requests that
       don't already provide one. If None or omitted, generate a random
@@ -221,6 +224,9 @@ def api(version=None, cache=True, host=None, token=None, insecure=False,
             http_kwargs['disable_ssl_certificate_validation'] = True
         kwargs['http'] = httplib2.Http(**http_kwargs)
 
+    if kwargs['http'].timeout is None:
+        kwargs['http'].timeout = timeout
+
     kwargs['http'] = _patch_http_request(kwargs['http'], token)
 
     svc = apiclient_discovery.build('arvados', version, cache_discovery=False, **kwargs)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list