Feature #12320

Updated by Peter Amstutz almost 2 years ago

One can access collections either by their portable data hash or UUID from the "by_id" directory in the keep mount. Trying to do the same for an Arvados project will fail with a "no such file or directory".

It would be nice to be able to access Arvados projects by their UUID under the keep "by_id" directory.

Implementation details:

# The code is in arvados/services/fuse
# The mount point configuration is initialized in arvados_fuse/command.py
# The "by_id" directory is implemented by the MagicDirectory class in arvados_fuse/fusedir.py
# The MagicDirectory is special, subdirectories only appear in the listing after they are first accessed
# The MagicDirectory.__contains__ method is called to determine if a subdirectory exists (named by portable data hash or uuid) and creates on demand it if necessary
# Currently it creates CollectionDirectory object for collections.
# The goal of this task is to add support to MagicDirectory for accessing projects (ProjectDirectory) by uuid.

Tests are in arvados/services/fuse/tests

The simplest way to run them is using "arvbox":https://dev.arvados.org/projects/arvados/wiki/Arvbox on Linux (note, won't work on Windows/MacOS so in that case you will need to use a VM).

<pre>
$ arvbox start test --only services/fuse
</pre>

Alternately you can set up your workstation or a VM following these instructions: https://dev.arvados.org/projects/arvados/wiki/Hacking_prerequisites (but personally I use arvbox for all my development).

The test framework starts up the API server in testing mode with a known database, so some tests rely on the API server returning known values. These test values are defined in arvados/services/api/test/fixtures. You can probably use an existing record, such as "aproject" (uuid zzzzz-j7d0g-v955i6s2oi1cbso) defined groups.yml.

As a starting point, try looking at FuseMagicTest in arvados/services/fuse/tests/test_mount.py

To run a single test:

<pre>
$ arvbox start test --only services/fuse services/fuse_test=--test-suite=tests.test_mount.FuseMagicTest
</pre>

Back