Skip to content
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

Filesystem Backend #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

danielBCN
Copy link
Member

@danielBCN danielBCN commented Oct 21, 2024

Initial implementation to use dataplug directly atop the file system. Bucket is a base directory, and all keys are relative to that directory.

Just

from dataplug.fileobject import CloudObject

instead of

from dataplug import CloudObject

And use

co = CloudObject.from_bucket_key(format, bucket, key)

@danielBCN danielBCN marked this pull request as ready for review October 21, 2024 15:13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea here was to diferentiate object storage and file system depending on the path prefix. This way we can keep all the logic of CloudObject. For instance, s3://mybucket/myobject for S3 and fs://mybucket/myobject for file system. Then in the class setup we can choose the correct backend. To solve the root path for the FS backend, we can use the storage_config parameter, for example:

co = CloudObject("fs://mybucket/myfile", VCF, storage_config={"fs_root": "/tmp"})

would read myfile from /tmp/mybucket/myfile from the file system mounted on /tmp or /...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants