[ARVADOS] updated: ac86cc3a04d65c1f330e237aa70df468faffd207
git at public.curoverse.com
git at public.curoverse.com
Tue Jan 14 10:23:43 EST 2014
Summary of changes:
.../app/assets/stylesheets/application.css | 18 ++++++
.../app/controllers/application_controller.rb | 2 +-
.../app/controllers/collections_controller.rb | 58 ++++++++++----------
apps/workbench/app/controllers/users_controller.rb | 7 ++
apps/workbench/app/helpers/application_helper.rb | 46 ++++++++++++---
apps/workbench/app/models/repository.rb | 3 +
apps/workbench/app/models/virtual_machine.rb | 1 -
.../views/application/_arvados_attr_value.html.erb | 21 +++++++
.../app/views/application/_arvados_object.html.erb | 42 ++++++++++++++
.../application/_arvados_object_attr.html.erb | 19 +------
.../app/views/application/_index.html.erb | 4 +-
.../app/views/collections/_index_tbody.html.erb | 27 +++++++++
.../workbench/app/views/collections/index.html.erb | 60 ++++++++++----------
apps/workbench/app/views/collections/index.js.erb | 4 +
apps/workbench/app/views/collections/show.html.erb | 32 ++++++----
apps/workbench/app/views/users/_home.html.erb | 9 ---
apps/workbench/app/views/users/_tables.html.erb | 27 ++++++++-
doc/user/tutorials/tutorial-firstscript.textile | 2 +-
sdk/cli/arvados-cli.gemspec | 3 +-
sdk/cli/bin/arv | 2 +-
sdk/cli/test/test_arv-put.rb | 7 +--
.../api/app/controllers/application_controller.rb | 9 ++-
.../v1/api_client_authorizations_controller.rb | 11 ++++
.../arvados/v1/collections_controller.rb | 6 +-
services/api/app/models/collection.rb | 8 ++-
.../arvados/v1/collections_controller_test.rb | 38 ++++++++++++
26 files changed, 336 insertions(+), 130 deletions(-)
create mode 100644 apps/workbench/app/views/application/_arvados_attr_value.html.erb
create mode 100644 apps/workbench/app/views/collections/_index_tbody.html.erb
create mode 100644 apps/workbench/app/views/collections/index.js.erb
via ac86cc3a04d65c1f330e237aa70df468faffd207 (commit)
via 8e0fd05a52fca56bc67e0347f82897faaba8a958 (commit)
via ceddd030ffb6d11d0fc4244d45fd7b8e17d337e6 (commit)
via 2d03682c2dbc5ee4567ed93e5f2cba770b8ba65e (commit)
via 56d8ed80ce834a051be71d2bcf76a346b7bc7f0b (commit)
via 8632354e4ec2361d8f53563a0df1da1ff0c01e63 (commit)
via f8aea2b0a7b6c0aebd2c97a0ca243a1299650ade (commit)
via c9b7cc4f504a879feb89df28a5f651e32839048a (commit)
via 9197c69b5780a5b5ce9c40bd67e530aefdf0c7a9 (commit)
via d9752d891b40a8aa800ea1bb025f9c371d1fe454 (commit)
via 7e4cdc1969319161c8412f57e4c68692421408a4 (commit)
via 976a754dc7fceee767322ae964c287b63595211f (commit)
via 57dbb702fde186b90fb2ad2504a35603a33b15dc (commit)
via 2f464437d84aaccd5310d39e493767f93b0eab2c (commit)
via 356878b49264fc1b2841e2a89d4406d2c5c4484a (commit)
via 9feb81aabda1360618b363c65e190374091f6ff2 (commit)
via 7aff46a6515cfb7531eaad04495430b0487d8375 (commit)
via ff458bd54745cc49632324f29934039a623f4287 (commit)
via 123e96939cfdd9bb9a079f5598196e47b74b1f86 (commit)
via efa22e16995170b1c30cb745b4efbff752591dd6 (commit)
via 567c0270bc7665e630bf5012e0fd2953fea462ce (commit)
via 36601cdb390b06d0128152cbda6df7aadfab6aca (commit)
via c16fd46f51a61f5d66e08b786362d91ef5a33f7d (commit)
via 030d673e455ac7fa92732eafe95f1db12f6a46b6 (commit)
via e52eb49c5e240f6adecf0242cd967a1ae6991291 (commit)
via 83f85a702927b37236b88ab9633d8e0e918e1218 (commit)
via 08a34a30d20d9adf5c1a87769a756a5fec87de71 (commit)
via e47f06d00fa65678102594eb6a85b0aba298b33c (commit)
via de09cec28729344b8bde815019563082b8e57fb5 (commit)
via 6696af28df909c0eb45f6cee8e7a3fc1d5658104 (commit)
via a999d262ee97000ed313cd4c127e0acf55e98c08 (commit)
via c2de465791157effa0b4d95fafe46e6976665439 (commit)
from 78010f9d4ecb20c28756f2551e40420d6e850303 (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 ac86cc3a04d65c1f330e237aa70df468faffd207
Merge: 8e0fd05 78010f9
Author: Tim Pierce <twp at curoverse.com>
Date: Tue Jan 14 10:23:25 2014 -0500
Merge branch '1510-arv-tag-unit-tests' of git.clinicalfuture.com:arvados into 1510-arv-tag-unit-tests
commit 8e0fd05a52fca56bc67e0347f82897faaba8a958
Author: Tim Pierce <twp at curoverse.com>
Date: Fri Jan 10 18:37:00 2014 -0500
Command-line clients use $HOME/.config/arvados for config settings.
diff --git a/sdk/cli/bin/arv b/sdk/cli/bin/arv
index 3f0f252..fa371ad 100755
--- a/sdk/cli/bin/arv
+++ b/sdk/cli/bin/arv
@@ -10,9 +10,9 @@ if RUBY_VERSION < '1.9.3' then
EOS
end
-# read authentication data from ~/.arvados if present
+# read authentication data from ~/.config/arvados if present
lineno = 0
-config_file = File.expand_path('~/.arvados')
+config_file = File.expand_path('~/.config/arvados')
if File.exist? config_file then
File.open(config_file, 'r').each do |line|
lineno = lineno + 1
diff --git a/sdk/python/arvados/__init__.py b/sdk/python/arvados/__init__.py
index a7b3b32..ca91963 100644
--- a/sdk/python/arvados/__init__.py
+++ b/sdk/python/arvados/__init__.py
@@ -21,7 +21,24 @@ import threading
import apiclient
import apiclient.discovery
-if 'ARVADOS_DEBUG' in os.environ:
+# Arvados configuration settings are taken from $HOME/.config/arvados.
+# Environment variables override settings in the config file.
+#
+class ArvadosConfig(dict):
+ def __init__(self, config_file):
+ dict.__init__(self)
+ with open(config_file, "r") as f:
+ for config_line in f:
+ var, val = config_line.rstrip().split('=', 2)
+ self[var] = val
+ for var in os.environ:
+ if var.startswith('ARVADOS_'):
+ self[var] = os.environ[var]
+
+
+config = ArvadosConfig(os.environ['HOME'] + '/.config/arvados')
+
+if 'ARVADOS_DEBUG' in config:
logging.basicConfig(level=logging.DEBUG)
EMPTY_BLOCK_LOCATOR = 'd41d8cd98f00b204e9800998ecf8427e+0'
@@ -45,10 +62,11 @@ class errors:
class CredentialsFromEnv(object):
@staticmethod
def http_request(self, uri, **kwargs):
+ global config
from httplib import BadStatusLine
if 'headers' not in kwargs:
kwargs['headers'] = {}
- kwargs['headers']['Authorization'] = 'OAuth2 %s' % os.environ['ARVADOS_API_TOKEN']
+ kwargs['headers']['Authorization'] = 'OAuth2 %s' % config.get('ARVADOS_API_TOKEN', 'ARVADOS_API_TOKEN_not_set')
try:
return self.orig_http_request(uri, **kwargs)
except BadStatusLine:
@@ -111,7 +129,7 @@ def _cast_objects_too(value, schema_type):
apiclient.discovery._cast = _cast_objects_too
def api(version=None):
- global services
+ global services, config
if not services.get(version):
apiVersion = version
if not version:
@@ -119,10 +137,10 @@ def api(version=None):
logging.info("Using default API version. " +
"Call arvados.api('%s') instead." %
apiVersion)
- if 'ARVADOS_API_HOST' not in os.environ:
+ if 'ARVADOS_API_HOST' not in config:
raise Exception("ARVADOS_API_HOST is not set. Aborting.")
url = ('https://%s/discovery/v1/apis/{api}/{apiVersion}/rest' %
- os.environ['ARVADOS_API_HOST'])
+ config['ARVADOS_API_HOST'])
credentials = CredentialsFromEnv()
# Use system's CA certificates (if we find them) instead of httplib2's
@@ -133,7 +151,7 @@ def api(version=None):
http = httplib2.Http(ca_certs=ca_certs)
http = credentials.authorize(http)
if re.match(r'(?i)^(true|1|yes)$',
- os.environ.get('ARVADOS_API_HOST_INSECURE', '')):
+ config.get('ARVADOS_API_HOST_INSECURE', 'no')):
http.disable_ssl_certificate_validation=True
services[version] = apiclient.discovery.build(
'arvados', apiVersion, http=http, discoveryServiceUrl=url)
@@ -924,6 +942,7 @@ class KeepClient(object):
super(KeepClient.KeepWriterThread, self).__init__()
self.args = kwargs
def run(self):
+ global config
with self.args['thread_limiter'] as limiter:
if not limiter.shall_i_proceed():
# My turn arrived, but the job has been done without
@@ -935,7 +954,7 @@ class KeepClient(object):
self.args['service_root']))
h = httplib2.Http()
url = self.args['service_root'] + self.args['data_hash']
- api_token = os.environ['ARVADOS_API_TOKEN']
+ api_token = config['ARVADOS_API_TOKEN']
headers = {'Authorization': "OAuth2 %s" % api_token}
try:
resp, content = h.request(url.encode('utf-8'), 'PUT',
@@ -995,6 +1014,7 @@ class KeepClient(object):
return pseq
def get(self, locator):
+ global config
if re.search(r',', locator):
return ''.join(self.get(x) for x in locator.split(','))
if 'KEEP_LOCAL_STORE' in os.environ:
@@ -1003,7 +1023,7 @@ class KeepClient(object):
for service_root in self.shuffled_service_roots(expect_hash):
h = httplib2.Http()
url = service_root + expect_hash
- api_token = os.environ['ARVADOS_API_TOKEN']
+ api_token = config['ARVADOS_API_TOKEN']
headers = {'Authorization': "OAuth2 %s" % api_token,
'Accept': 'application/octet-stream'}
try:
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list