[ARVADOS] created: 64027668d7b5bd47a863c86277c83961d8a29914

git at public.curoverse.com git at public.curoverse.com
Tue Nov 3 10:08:17 EST 2015


        at  64027668d7b5bd47a863c86277c83961d8a29914 (commit)


commit 64027668d7b5bd47a863c86277c83961d8a29914
Author: radhika <radhika at curoverse.com>
Date:   Tue Nov 3 10:04:02 2015 -0500

    7661: add --by-pdh option to FUSE and use this option in crunch-job. Do not start web socket client when --by-pdh is used.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 555c4d1..a8de76b 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -893,7 +893,7 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
         .q{&& SWAP=$(awk '($1 == "SwapTotal:"){print $2}' </proc/meminfo) }
         ."&& MEMLIMIT=\$(( (\$MEM * 95) / ($ENV{CRUNCH_NODE_SLOTS} * 100) )) "
         ."&& let SWAPLIMIT=\$MEMLIMIT+\$SWAP ";
-    $command .= "&& exec arv-mount --by-id --allow-other $ENV{TASK_KEEPMOUNT} --exec ";
+    $command .= "&& exec arv-mount --by-pdh --allow-other $ENV{TASK_KEEPMOUNT} --exec ";
     if ($docker_hash)
     {
       my $cidfile = "$ENV{CRUNCH_TMP}/$Jobstep->{arvados_task}->{uuid}-$Jobstep->{failures}.cid";
diff --git a/services/fuse/arvados_fuse/fusedir.py b/services/fuse/arvados_fuse/fusedir.py
index 8ffca49..5856888 100644
--- a/services/fuse/arvados_fuse/fusedir.py
+++ b/services/fuse/arvados_fuse/fusedir.py
@@ -496,10 +496,11 @@ point the collection will actually be looked up on the server and the directory
 will appear if it exists.
 """.lstrip()
 
-    def __init__(self, parent_inode, inodes, api, num_retries):
+    def __init__(self, parent_inode, inodes, api, num_retries, by_pdh=False):
         super(MagicDirectory, self).__init__(parent_inode, inodes)
         self.api = api
         self.num_retries = num_retries
+        self.by_pdh = by_pdh
 
     def __setattr__(self, name, value):
         super(MagicDirectory, self).__setattr__(name, value)
@@ -517,6 +518,9 @@ will appear if it exists.
         if k in self._entries:
             return True
 
+        if self.by_pdh and uuid_pattern.match(k):
+            raise llfuse.FUSEError(errno.ENOENT)
+
         if not portable_data_hash_pattern.match(k) and not uuid_pattern.match(k):
             return False
 
diff --git a/services/fuse/bin/arv-mount b/services/fuse/bin/arv-mount
index 7f9c916..e2df1c8 100755
--- a/services/fuse/bin/arv-mount
+++ b/services/fuse/bin/arv-mount
@@ -32,13 +32,15 @@ with "--".
 
     mount_mode = parser.add_mutually_exclusive_group()
 
-    mount_mode.add_argument('--all', action='store_true', help="""Mount a subdirectory for each mode: home, shared, by_tag, by_id (default).""")
+    mount_mode.add_argument('--all', action='store_true', help="""Mount a subdirectory for each mode: home, shared, by_tag, by_pdh, by_id (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-id', action='store_true',
                             help="""Mount subdirectories listed by portable data hash or uuid.""")
+    mount_mode.add_argument('--by-pdh', action='store_true',
+                            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.""")
 
@@ -103,7 +105,7 @@ with "--".
         now = time.time()
         dir_class = None
         dir_args = [llfuse.ROOT_INODE, operations.inodes, api, args.retries]
-        if args.by_id:
+        if args.by_id or args.by_pdh:
             # Set up the request handler with the 'magic directory' at the root
             dir_class = MagicDirectory
         elif args.by_tag:
@@ -130,7 +132,8 @@ with "--".
             e = operations.inodes.add_entry(Directory(llfuse.ROOT_INODE, operations.inodes))
             dir_args[0] = e.inode
 
-            e._entries['by_id'] = operations.inodes.add_entry(MagicDirectory(*dir_args))
+            e._entries['by_id'] = operations.inodes.add_entry(MagicDirectory(*dir_args, by_pdh=True if args.by_pdh else False))
+
             e._entries['by_tag'] = operations.inodes.add_entry(TagsDirectory(*dir_args))
 
             dir_args.append(usr)
@@ -170,7 +173,8 @@ From here, the following directories are available:
         llfuse.init(operations, args.mountpoint, opts)
 
         # Subscribe to change events from API server
-        operations.listen_for_events(api)
+        if not args.by_pdh:
+            operations.listen_for_events(api)
 
         t = threading.Thread(None, lambda: llfuse.main())
         t.start()

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list