[ARVADOS] updated: eff9d0deac0e06f7310ba1463aab89b342e71aa9

git at public.curoverse.com git at public.curoverse.com
Mon Dec 23 11:28:10 EST 2013


Summary of changes:
 apps/admin/setup-new-user.rb                     |    2 +-
 crunch_scripts/pgp-survey-import                 |   18 +++++++++---------
 doc/examples/ruby/list-active-nodes.rb           |    2 +-
 doc/user/tutorials/tutorial-trait-search.textile |   12 ++++++------
 sdk/cli/bin/crunch-job                           |    2 +-
 sdk/python/test_pipeline_template.py             |   10 +++++-----
 services/keep/keep.rb                            |    2 +-
 7 files changed, 24 insertions(+), 24 deletions(-)

       via  eff9d0deac0e06f7310ba1463aab89b342e71aa9 (commit)
       via  b6f6708ada5dd029f90022f7b1b82fccc4868dcc (commit)
       via  44b3e4df6236f40eb4c41663b91e6bde1a3c3d17 (commit)
      from  3811d62f4d0ef73717c6387246fb040eafaa64fe (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 eff9d0deac0e06f7310ba1463aab89b342e71aa9
Author: Tom Clegg <tom at clinicalfuture.com>
Date:   Mon Dec 23 08:27:52 2013 -0800

    Specify apiVersion when instantiating Arvados client. closes #1773

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 44cfee5..655bd15 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -119,7 +119,7 @@ $SIG{'USR2'} = sub
 
 
 
-my $arv = Arvados->new;
+my $arv = Arvados->new('apiVersion' => 'v1');
 my $metastream;
 
 my $User = $arv->{'users'}->{'current'}->execute;

commit b6f6708ada5dd029f90022f7b1b82fccc4868dcc
Author: Tom Clegg <tom at clinicalfuture.com>
Date:   Mon Dec 23 08:26:05 2013 -0800

    Specify api_version when instantiating Arvados client. refs #1773

diff --git a/apps/admin/setup-new-user.rb b/apps/admin/setup-new-user.rb
index 17c19a4..f3758e0 100755
--- a/apps/admin/setup-new-user.rb
+++ b/apps/admin/setup-new-user.rb
@@ -26,7 +26,7 @@ end
 user_arg, user_repo_name, vm_uuid = ARGV
 
 require 'arvados'
-arv = Arvados.new
+arv = Arvados.new(api_version: 'v1')
 
 # Look up the given user by uuid or, failing that, email address.
 user = begin
diff --git a/doc/examples/ruby/list-active-nodes.rb b/doc/examples/ruby/list-active-nodes.rb
index 7a64212..472a0c3 100755
--- a/doc/examples/ruby/list-active-nodes.rb
+++ b/doc/examples/ruby/list-active-nodes.rb
@@ -4,7 +4,7 @@ abort 'Error: Ruby >= 1.9.3 required.' if RUBY_VERSION < '1.9.3'
 
 require 'arvados'
 
-arv = Arvados.new
+arv = Arvados.new(api_version: 'v1')
 arv.node.list[:items].each do |node|
   if node[:crunch_worker_state] != 'down'
     ping_age = (Time.now - Time.parse(node[:last_ping_at])).to_i rescue -1
diff --git a/services/keep/keep.rb b/services/keep/keep.rb
index 5004618..8c19381 100755
--- a/services/keep/keep.rb
+++ b/services/keep/keep.rb
@@ -191,7 +191,7 @@ class Keep < Sinatra::Base
     return if defined? @@last_ping_at and @@last_ping_at > Time.now - 300
     @@last_ping_at = Time.now
     begin
-      @@arvados ||= Arvados.new(api_token: '')
+      @@arvados ||= Arvados.new(api_version: 'v1', api_token: '')
       @@keepdirs.each do |kd|
         ack = @@arvados.keep_disk.ping(uuid: kd[:arvados][:uuid],
                                        service_port: settings.port,

commit 44b3e4df6236f40eb4c41663b91e6bde1a3c3d17
Author: Tom Clegg <tom at clinicalfuture.com>
Date:   Mon Dec 23 08:21:00 2013 -0800

    Use arvados.api('v1') accessor instead of arvados.service. refs #1773

diff --git a/crunch_scripts/pgp-survey-import b/crunch_scripts/pgp-survey-import
index 811dd11..df5758b 100755
--- a/crunch_scripts/pgp-survey-import
+++ b/crunch_scripts/pgp-survey-import
@@ -30,7 +30,7 @@ for input_file in arvados.CollectionReader(this_job_input).all_files():
         words = string.split(string.strip(line), "\t")
         if line_number == 0:
             headings = words
-            for t in arvados.service.traits().list(
+            for t in arvados.api('v1').traits().list(
                 where=json.dumps({'name':words}),
                 limit=1000
                 ).execute()['items']:
@@ -38,28 +38,28 @@ for input_file in arvados.CollectionReader(this_job_input).all_files():
             for i, trait_name in enumerate(words[3:], start=3):
                 # find or create trait
                 if trait_name not in traits:
-                    traits_match = arvados.service.traits().list(
+                    traits_match = arvados.api('v1').traits().list(
                         where=json.dumps({'name':trait_name})
                         ).execute()['items']
                     if len(traits_match) > 0:
                         traits[trait_name] = traits_match[0]
                     else:
-                        traits[trait_name] = arvados.service.traits().create(
+                        traits[trait_name] = arvados.api('v1').traits().create(
                             trait=json.dumps({'name':trait_name})).execute()
                 out.write(separator)
                 out.write(json.dumps(traits[trait_name]))
                 separator = ",\n"
         else:
-            huID_links_match = arvados.service.links().list(
+            huID_links_match = arvados.api('v1').links().list(
                 where=json.dumps({'link_class':'identifier','name':words[0]})
                 ).execute()['items']
             if len(huID_links_match) > 0:
                 human_uuid = huID_links_match[0]['head_uuid']
             else:
-                human = arvados.service.humans().create(
+                human = arvados.api('v1').humans().create(
                     body={}
                     ).execute()
-                huID_link = arvados.service.links().create(
+                huID_link = arvados.api('v1').links().create(
                     body={
                         'link_class':'identifier',
                         'name':words[0],
@@ -69,7 +69,7 @@ for input_file in arvados.CollectionReader(this_job_input).all_files():
                     ).execute()
                 human_uuid = human['uuid']
             human_trait = {}
-            for t in arvados.service.links().list(
+            for t in arvados.api('v1').links().list(
                 limit=10000,
                 where=json.dumps({
                     'tail_uuid':human_uuid,
@@ -87,7 +87,7 @@ for input_file in arvados.CollectionReader(this_job_input).all_files():
                     if trait_link['properties']['value'] != trait_value:
                         # update database value to match survey response
                         trait_link['properties']['value'] = trait_value
-                        arvados.service.links().update(
+                        arvados.api('v1').links().update(
                             uuid=trait_link['uuid'],
                             body={'properties':trait_link['properties']}
                             ).execute()
@@ -106,7 +106,7 @@ for input_file in arvados.CollectionReader(this_job_input).all_files():
                         'name':'pgp-survey-response',
                         'properties': { 'value': trait_value }
                         }
-                    arvados.service.links().create(
+                    arvados.api('v1').links().create(
                         body=trait_link
                         ).execute()
                     out.write(",\n")
diff --git a/doc/user/tutorials/tutorial-trait-search.textile b/doc/user/tutorials/tutorial-trait-search.textile
index a7d78a7..0908c1f 100644
--- a/doc/user/tutorials/tutorial-trait-search.textile
+++ b/doc/user/tutorials/tutorial-trait-search.textile
@@ -128,7 +128,7 @@ h2. Find Personal Genome Project identifiers from Arvados UUIDs
     "link_class": "identifier",
     "head_uuid": human_uuids
   })</span>
->>> <span class="userinput">pgpid_links = arvados.service.links().list(limit=1000, where=human_query).execute()</span>
+>>> <span class="userinput">pgpid_links = arvados.api('v1').links().list(limit=1000, where=human_query).execute()</span>
 >>> <span class="userinput">map(lambda l: l['name'], pgpid_links['items'])</span>
 [u'hu01024B', u'hu11603C', u'hu15402B', u'hu174334', u'hu1BD549', u'hu237A50',
  u'hu34A921', u'hu397733', u'hu414115', u'hu43860C', u'hu474789', u'hu553620',
@@ -167,7 +167,7 @@ for p_link in provenance_links['items']:
   pgpid[p_link['head_uuid']] = pgpid[p_link['tail_uuid']]
 
 # get details (e.g., list of files) of each collection
-collections = arvados.service.collections().list(where=json.dumps({
+collections = arvados.api('v1').collections().list(where=json.dumps({
     "uuid": collection_uuids
   })).execute()
 
@@ -205,7 +205,7 @@ Now we will use crunch to issue a 'grep' job to look for variant rs1126809 in ea
 <pre><code>>>> <span class="userinput">job = {}
 for c in collections['items']:
   if [] != filter(lambda f: re.search('^var-.*\.tsv\.bz2', f[1]), c['files']):
-    job[c['uuid']] = arvados.service.jobs().create(body={
+    job[c['uuid']] = arvados.api('v1').jobs().create(body={
       'script': 'grep',
       'script_parameters': {'input': c['uuid'], 'pattern': "rs1126809\\b"},
       'script_version': 'e7aeb42'
@@ -233,7 +233,7 @@ hu599905 qr1hi-8i9sb-i9ec9g8d7rt70xg
 Monitor job progress by refreshing the Jobs page in Workbench, or by using the API:
 
 <notextile>
-<pre><code>>>> <span class="userinput">map(lambda j: arvados.service.jobs().get(uuid=j['uuid']).execute()['success'], job.values())
+<pre><code>>>> <span class="userinput">map(lambda j: arvados.api('v1').jobs().get(uuid=j['uuid']).execute()['success'], job.values())
 [None, True, None, None, None, None, None, None, None, None, None, None, None, None]
 </code></pre>
 </notextile>
@@ -245,8 +245,8 @@ After the jobs have completed, check output file sizes.
 <notextile>
 <pre><code>>>> <span class="userinput">for collection_uuid in job:
   job_uuid = job[collection_uuid]['uuid']
-  job_output = arvados.service.jobs().get(uuid=job_uuid).execute()['output']
-  output_files = arvados.service.collections().get(uuid=job_output).execute()['files']
+  job_output = arvados.api('v1').jobs().get(uuid=job_uuid).execute()['output']
+  output_files = arvados.api('v1').collections().get(uuid=job_output).execute()['files']
   # Test the output size.  If greater than zero, that means 'grep' found the variant 
   if output_files[0][2] > 0:
     print("%s has variant rs1126809" % (pgpid[collection_uuid]))
diff --git a/sdk/python/test_pipeline_template.py b/sdk/python/test_pipeline_template.py
index bd780a3..d7cb105 100644
--- a/sdk/python/test_pipeline_template.py
+++ b/sdk/python/test_pipeline_template.py
@@ -8,7 +8,7 @@ import apiclient
 
 class PipelineTemplateTest(unittest.TestCase):
     def runTest(self):
-        pt_uuid = arvados.service.pipeline_templates().create(
+        pt_uuid = arvados.api('v1').pipeline_templates().create(
             body={'name':__file__}
             ).execute()['uuid']
         self.assertEqual(len(pt_uuid), 27,
@@ -22,7 +22,7 @@ class PipelineTemplateTest(unittest.TestCase):
             'spass_box': False,
             'spass-box': [True, 'Maybe', False]
             }
-        update_response = arvados.service.pipeline_templates().update(
+        update_response = arvados.api('v1').pipeline_templates().update(
             uuid=pt_uuid,
             body={'components':components}
             ).execute()
@@ -34,19 +34,19 @@ class PipelineTemplateTest(unittest.TestCase):
         self.assertEqual(update_response['name'], __file__,
                          'update() response has a different name (%s, not %s)'
                          % (update_response['name'], __file__))
-        get_response = arvados.service.pipeline_templates().get(
+        get_response = arvados.api('v1').pipeline_templates().get(
             uuid=pt_uuid
             ).execute()
         self.assertEqual(get_response['components'], components,
                          'components got munged by server (%s -> %s)'
                          % (components, update_response['components']))
-        delete_response = arvados.service.pipeline_templates().delete(
+        delete_response = arvados.api('v1').pipeline_templates().delete(
             uuid=pt_uuid
             ).execute()
         self.assertEqual(delete_response['uuid'], pt_uuid,
                          'delete() response has wrong uuid (%s, not %s)'
                          % (delete_response['uuid'], pt_uuid))
         with self.assertRaises(apiclient.errors.HttpError):
-            geterror_response = arvados.service.pipeline_templates().get(
+            geterror_response = arvados.api('v1').pipeline_templates().get(
                 uuid=pt_uuid
                 ).execute()

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list