-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the RepositoryBackend
interface for Swift
#335
Comments
See also #404 (closed as duplicate) |
In converting |
Yes, I agree the sandbox should be local, and ok to have a different configuration entry for its location/path. |
For people who already want to play around with this (before the implementation of the AiiDA swift interface), just pointing out that swift containers can be mounted locally using the swift virtual file system. We've tested this with swift@CSCS and it seemed to work fine (as long as you don't add tens of thousands of files at once). Procedure on Ubuntu 16.04# install svfs
wget https://github.com/ovh/svfs/releases/download/v0.9.1/svfs_0.9.1_amd64.deb
sudo dpkg -i svfs_0.9.1_amd64.deb
sudo apt-get install -f
# set OS environment variables (depends on OS provider)
pip install --upgrade python-openstackclient lxml oauthlib
source os_env_vars.env
# mounting
mkdir /home/ubuntu/osmount
# mount container 'archive' (for read-only use: -o allow_other=0,ro=1)
mount.svfs osdev /home/ubuntu/osmount -o container=archive,allow_other=0
# mount all containers in project with debug info
mount.svfs osdev /home/ubuntu/osmount -o debug=1,allow_other=0
# unmount
fusermount -u /home/ubuntu/osmount
# To understand: how to make the mount persistent |
I think that before crystallising on an API and/or implementation, we should consider pyfilesystem2 [GitHub], [website], [blog post on why a version 2 has been written, with examples of the API] There is still some work to do on the AiiDA side, but this would make it easy to use different backends (e.g. it supports Tar and Zip if we want to pack files together, it has a TempFS and in-memory, it supports mounting, it has official support for S3). However it does not have support for swift yet (pyfilesystem1 doesn't and I can't find information either on a plugin for pyfs2). But looking at the amount of code in the S3FS repo it could be something not too complex to implement, considering that in any case we need to do some implementation. And that according to the blog post above and the docs, the essential methods to implement are only 7:
and all the rest is optional (you need to implement them mainly for optimising the code, so it might not be needed in a first implementation). I'm not saying that we must use this interface, but that when we will work on this issue/project, we should investigate it to decide if it's worth using it to simplify our life if we want to easily support more backends in the future, and/or see if our internal "folder" api can be cleaned up/simplified/replaced with this one. |
To add to this, supporting for instance an interface to |
Also note that |
This might be an old issue, now superseded - adding 2.0, but maybe (@sphuber ?) we can just closed it as we have a new repository and we don't plan to support the Swift interface anymore? |
@sphuber @giovannipizzi Sure, if no support for Swift is planned, please go ahead and close it. Having said that, I strongly believe a proper interface to some standard object store API should be added at some point. A standard S3 interface using one of the existing Python libraries would be sufficient to open up for more flexibility. Performance aside. When using object store (with exceptions), performance is never the key point anyway. Do we have a way to put this on the roadmap? |
This issue was not only to discuss adding support for Swift, but also to discuss the possibility to have a single database support using multiple file repositories. The current proposed implementation actually does not consider this and I don't think we should do this for v2.0, but it might still be an interesting feature to consider in the far future. So in that case I would keep this issue open. |
Maybe we should just close it and open specific issues related to an object store interface and multiple repos? Their work is maybe anyway a bit isolated? |
I think supporting multiple repositories for a single profile is not something for which is a need and would require a lot of work. So I don't think this will be happening soon. Providing a Swift backend for the new repository implementation in |
RepositoryBackend
interface for Swift
Since v2 the repository can now be replaced in a |
With the new file repository implementation of
aiida-core==2.0.0
it is now possible to implement theAbstractRepositoryBackend
interface for Swift since the repository no longer assumes a local file system solution,Below is the original description of this issue before it was redefined to only consider implementing the repository interface for Swift.
Ideally, a profile can specify multiple file storage repositories and custom selection rules for which files to store in which repository. Which files and in which repository they are stored, will also be stored in the database from now on.These changes will allow AiiDA to integrate with Swift, an object store, which will the choice of file storage system at CSCSWe should define a common API for all classes accessing files, common to directories and object store. Some methods will stay only for folders (e.g.abspath
), others (e.g.open
orget_file_content
) should be common. The AiiDA code should only use the common API.The text was updated successfully, but these errors were encountered: