commit/galaxy-central: Kyle Ellrott: Starting work on 'read-only': object stores that can be added to the distributed object store system and provide remote access to additional data sources
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/73858b780fdc/ Changeset: 73858b780fdc Branch: federate User: Kyle Ellrott Date: 2013-05-15 01:53:32 Summary: Starting work on 'read-only': object stores that can be added to the distributed object store system and provide remote access to additional data sources Affected #: 4 files diff -r 6d72b2db32c0d84032ee40f2cd86b7b09485c441 -r 73858b780fdcede620cb0e42409a856367e330b4 distributed_object_store_conf.xml --- /dev/null +++ b/distributed_object_store_conf.xml @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<backends> + <backend id="files1" type="disk" weight="1"> + <files_dir path="database/files1"/> + <extra_dir type="temp" path="database/tmp1"/> + <extra_dir type="job_work" path="database/job_working_directory1"/> + </backend> + <backend id="files2" type="disk" weight="1"> + <files_dir path="database/files2"/> + <extra_dir type="temp" path="database/tmp2"/> + <extra_dir type="job_work" path="database/job_working_directory2"/> + </backend> + <backend id="galaxy_main" type="galaxy.objectstore.remote:RemoteGalaxyStore"> + <url>https://main.g2.bx.psu.edu/</url> + </backend> +</backends> diff -r 6d72b2db32c0d84032ee40f2cd86b7b09485c441 -r 73858b780fdcede620cb0e42409a856367e330b4 distributed_object_store_conf.xml.sample --- a/distributed_object_store_conf.xml.sample +++ b/distributed_object_store_conf.xml.sample @@ -10,4 +10,7 @@ <extra_dir type="temp" path="database/tmp2"/><extra_dir type="job_work" path="database/job_working_directory2"/></backend> + <!-- backend id="galaxy_main" type="galaxy.objectstore.remote:RemoteGalaxyStore"> + <url>https://main.g2.bx.psu.edu/</url> + </backend --></backends> diff -r 6d72b2db32c0d84032ee40f2cd86b7b09485c441 -r 73858b780fdcede620cb0e42409a856367e330b4 lib/galaxy/objectstore/__init__.py --- a/lib/galaxy/objectstore/__init__.py +++ b/lib/galaxy/objectstore/__init__.py @@ -36,6 +36,7 @@ """ ObjectStore abstract interface """ + is_readonly = False def __init__(self): self.running = True self.extra_dirs = {} @@ -895,7 +896,8 @@ id = elem.get('id') weight = int(elem.get('weight', 1)) maxpctfull = float(elem.get('maxpctfull', 0)) - if elem.get('type', 'disk'): + ostype = elem.get('type', 'disk') + if ostype == 'disk': path = None extra_dirs = {} for sub in elem: @@ -911,6 +913,20 @@ log.debug(" Extra directories:") for type, dir in extra_dirs.items(): log.debug(" %s: %s" % (type, dir)) + else: + fields = ostype.split( ':' ) + ostype_module = fields[0] + ostype_class_name = fields[1] + mfields = ostype_module.split( '.' ) + module = __import__( ostype_module ) + for mod in mfields[1:]: + module = getattr( module, mod ) + ostype_class = getattr( module, ostype_class_name ) + obj = ostype_class({}) + self.backends[id] = obj + if obj.is_readonly: + weight = 0 + for i in range(0, weight): # The simplest way to do weighting: add backend ids to a # sequence the number of times equalling weight, then randomly diff -r 6d72b2db32c0d84032ee40f2cd86b7b09485c441 -r 73858b780fdcede620cb0e42409a856367e330b4 lib/galaxy/objectstore/remote.py --- /dev/null +++ b/lib/galaxy/objectstore/remote.py @@ -0,0 +1,8 @@ + +from galaxy.objectstore import ObjectStore + +class RemoteGalaxyStore(ObjectStore): + is_readonly = True + def __init__(self, params): + print "Remote Galaxy Store Loaded!!!!!" + \ No newline at end of file Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org