Open Avsecz opened 5 years ago
Good idea, this would be great!
Can you explain how to implement something like this? E.g. where to put the class, how to name it, which methods to implement and what are the potential caveats?
Some thoughts:
1) I would probably keep the interface of the remote.RemoteStorage
class unchanged.
2) I would create a new class remote.SnakeMakeRemoteStorage
that inherits remote.RemoteStorage
and takes at least two parameters: a snakemake backend name + any other necessary parameters (e.g. the access keys). I probably wouldn't want to reimplement the S3 and other existing backends.
3) In remote.RemoteStorage.get_from_url()
and remote.RemoteStorage.get_from_config()
make sure the remote storage backend is correctly parsed from the lazydata.yml
config file and the correct child class SnakeMakeRemoteStorage
instantiated.
4) In cli.commands.config
I would allow for configuration of any necessary additional access keys
5) In cli.commands.add_remote
I would allow for any of the snakemake backends to be specified.
And that should be it. Some unit tests would be welcome as well :)
Would it be possible to wrap the classes implementing
snakemake.remote.AbstractRemoteObject
(snakemake.remote, AbstractRemoteObject) intolazydata.remote.RemoteStorage
class?This would allow to implement the following remote storage providers in one go (https://snakemake.readthedocs.io/en/stable/snakefiles/remote_files.html):
snakemake.remote.S3
snakemake.remote.GS
snakemake.remote.SFTP
snakemake.remote.HTTP
snakemake.remote.FTP
snakemake.remote.dropbox
snakemake.remote.XRootD
snakemake.remote.NCBI
snakemake.remote.webdav
snakemake.remote.gfal
snakemake.remote.gridftp
snakemake.remote.iRODS
snakemake.remote.EGA
Pyfilesystem2
Another alternative would be to write a wrapper around pyfilesystem2:
https://github.com/PyFilesystem/pyfilesystem2
. It supports the following filesystems: https://www.pyfilesystem.org/page/index-of-filesystems/Builtin
Official
Filesystems in the PyFilesystem organisation on GitHub.
Third Party