[ARVADOS] updated: 252d0e3c02b355577e4d20331c787cbb7b02a7d8

git at public.curoverse.com git at public.curoverse.com
Wed Sep 3 15:24:19 EDT 2014


Summary of changes:
 services/fuse/arvados_fuse/__init__.py | 21 ++++++++++----------
 services/fuse/bin/arv-mount            | 35 ++++++++++++++++++++--------------
 2 files changed, 32 insertions(+), 24 deletions(-)

       via  252d0e3c02b355577e4d20331c787cbb7b02a7d8 (commit)
      from  918f5ae5518079a35b5008c3df8429e0c4fab1d6 (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 252d0e3c02b355577e4d20331c787cbb7b02a7d8
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Sep 3 15:24:15 2014 -0400

    3644: Default mount mode now includes home, shared, by_hash, and by_tag.

diff --git a/services/fuse/arvados_fuse/__init__.py b/services/fuse/arvados_fuse/__init__.py
index ed551b2..fd5463a 100644
--- a/services/fuse/arvados_fuse/__init__.py
+++ b/services/fuse/arvados_fuse/__init__.py
@@ -257,6 +257,8 @@ class CollectionDirectory(Directory):
 
     def update(self):
         try:
+            if re.match(r'^[a-f0-9]{32}', self.collection_locator):
+                return
             #with llfuse.lock_released:
             new_collection_object = self.api.collections().get(uuid=self.collection_locator).execute()
             if "portable_data_hash" not in new_collection_object:
@@ -287,7 +289,6 @@ class CollectionDirectory(Directory):
                     for k, v in s.files().items():
                         cwd._entries[sanitize_filename(k)] = self.inodes.add_entry(StreamReaderFile(cwd.inode, v, self.ctime(), self.mtime()))
             self.fresh()
-            return True
         except Exception as detail:
             _logger.error("arv-mount %s: error", self.collection_locator)
             _logger.exception(detail)
@@ -378,11 +379,11 @@ class TagsDirectory(RecursiveInvalidateDirectory):
         super(TagsDirectory, self).__init__(parent_inode)
         self.inodes = inodes
         self.api = api
-        try:
-            arvados.events.subscribe(self.api, [['object_uuid', 'is_a', 'arvados#link']], lambda ev: self.invalidate())
-        except:
-            self._poll = True
-            self._poll_time = poll_time
+        #try:
+        #    arvados.events.subscribe(self.api, [['object_uuid', 'is_a', 'arvados#link']], lambda ev: self.invalidate())
+        #except:
+        self._poll = True
+        self._poll_time = poll_time
 
     def update(self):
         tags = self.api.links().list(filters=[['link_class', '=', 'tag']], select=['name'], distinct = True).execute()
@@ -491,11 +492,11 @@ class ProjectDirectory(RecursiveInvalidateDirectory):
 
 
 
-class HomeDirectory(RecursiveInvalidateDirectory):
+class SharedDirectory(RecursiveInvalidateDirectory):
     '''A special directory that represents users or groups who have shared projects with me.'''
 
-    def __init__(self, parent_inode, inodes, api, poll=False, poll_time=60):
-        super(HomeDirectory, self).__init__(parent_inode)
+    def __init__(self, parent_inode, inodes, api, exclude, poll=False, poll_time=60):
+        super(SharedDirectory, self).__init__(parent_inode)
         self.current_user = api.users().current().execute()
         self.inodes = inodes
         self.api = api
@@ -516,7 +517,7 @@ class HomeDirectory(RecursiveInvalidateDirectory):
         roots = []
         root_owners = {}
         for ob in all_projects:
-            if ob['owner_uuid'] == self.current_user['uuid'] or ob['owner_uuid'] not in objects:
+            if ob['owner_uuid'] != self.current_user['uuid'] and ob['owner_uuid'] not in objects:
                 roots.append(ob)
                 root_owners[ob['owner_uuid']] = True
 
diff --git a/services/fuse/bin/arv-mount b/services/fuse/bin/arv-mount
index 1b7f13b..db70036 100755
--- a/services/fuse/bin/arv-mount
+++ b/services/fuse/bin/arv-mount
@@ -27,15 +27,15 @@ with "--".
 
     mount_mode = parser.add_mutually_exclusive_group()
 
-    mount_mode.add_argument('--home', action='store_true', help="""Mount the user's home project (default).""")
-    mount_mode.add_argument('--collection', type=str, help="""Mount only the specified collection at the mount point.""")
-    mount_mode.add_argument('--tags', action='store_true',
-                            help="""Mount as a virtual directory consisting of subdirectories representing
-tagged collections on the server.""")
-    mount_mode.add_argument('--project', type=str, help="""Mount a specific project by uuid.""")
+    mount_mode.add_argument('--all', action='store_true', help="""Mount a subdirectory for each mode: home, shared, tags, portable data hash (default).""")
+    mount_mode.add_argument('--home', action='store_true', help="""Mount only the user's home project.""")
+    mount_mode.add_argument('--shared', action='store_true', help="""Mount only list of projects shared with the user.""")
+    mount_mode.add_argument('--by-tag', action='store_true',
+                            help="""Mount subdirectories listed by tag.""")
     mount_mode.add_argument('--by-hash', action='store_true',
-                            help="""Mount as a virtual directory consisting of subdirectories for each
-collection by portable data hash.""")
+                            help="""Mount subdirectories listed by portable data hash.""")
+    mount_mode.add_argument('--project', type=str, help="""Mount a specific project.""")
+    mount_mode.add_argument('--collection', type=str, help="""Mount only the specified collection.""")
 
     parser.add_argument('--debug', action='store_true', help="""Debug mode""")
     parser.add_argument('--logfile', help="""Write debug logs and errors to the specified file (default stderr).""")
@@ -90,16 +90,23 @@ collection by portable data hash.""")
 
         if args.by_hash:
             # Set up the request handler with the 'magic directory' at the root
-            operations.inodes.add_entry(MagicDirectory(llfuse.ROOT_INODE, operations.inodes))
-        elif args.tags:
-            e = operations.inodes.add_entry(TagsDirectory(llfuse.ROOT_INODE, operations.inodes, api))
+            operations.inodes.add_entry(MagicDirectory(llfuse.ROOT_INODE, operations.inodes, api))
+        elif args.by_tag:
+            operations.inodes.add_entry(TagsDirectory(llfuse.ROOT_INODE, operations.inodes, api))
+        elif args.shared:
+            operations.inodes.add_entry(SharedDirectory(llfuse.ROOT_INODE, operations.inodes, api))
         elif args.collection != None:
             # Set up the request handler with the collection at the root
-            e = operations.inodes.add_entry(CollectionDirectory(llfuse.ROOT_INODE, operations.inodes, args.collection))
+            operations.inodes.add_entry(CollectionDirectory(llfuse.ROOT_INODE, operations.inodes, args.collection))
         elif args.project != None:
-            e = operations.inodes.add_entry(ProjectDirectory(llfuse.ROOT_INODE, operations.inodes, args.project))
+            operations.inodes.add_entry(ProjectDirectory(llfuse.ROOT_INODE, operations.inodes, args.project))
         else:
-            e = operations.inodes.add_entry(HomeDirectory(llfuse.ROOT_INODE, operations.inodes, api))
+            e = operations.inodes.add_entry(Directory(llfuse.ROOT_INODE))
+            usr = api.users().current().execute()
+            e._entries['home'] = operations.inodes.add_entry(ProjectDirectory(e.inode, operations.inodes, api, usr))
+            e._entries['shared'] = operations.inodes.add_entry(SharedDirectory(e.inode, operations.inodes, api, usr))
+            e._entries['by_tag'] = operations.inodes.add_entry(TagsDirectory(e.inode, operations.inodes, api))
+            e._entries['by_hash'] = operations.inodes.add_entry(MagicDirectory(e.inode, operations.inodes, api))
 
     except Exception:
         logger.exception("arv-mount: exception during API setup")

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list