ocis icon indicating copy to clipboard operation
ocis copied to clipboard

"Normal" storage backend/driver

Open cyl3x opened this issue 1 year ago • 16 comments

Is your feature request related to a problem? Please describe.

OCIS does not preserve the user's file structure like ownCloud or Nextcloud does. Sure, there's a directory with symlinks reassembling the actual file structure, but this comes with tradeoffs. I'm running a home lab, currently using Nextcloud as my cloud for me and my family, providing NFS and CIFS shares for them and mounting subdirectories of mine and their personal spaces in e.g. Jellyfin. With OCIS, this wouldn't be any longer possible. I can't provide a nice NFS or CIFS share (WebDAV is significantly slower) nor can I use symlinks in most other applications, like Jellyfin. I know the advantages of decomposed FS, but I would rather take the disadvantages and lower performance.

I don't know if this would even fit in with the OCIS vision/direction and if it would have a use case outside a home lab.

Describe the solution you'd like

Have a storage backend that preserves the actual file structure like ownCloud and Nextcloud does.

Describe alternatives you've considered

Not to use OCIS and stay with the alternatives.

cyl3x avatar Aug 26 '23 12:08 cyl3x

@tbsbdr FYI

micbar avatar Aug 28 '23 07:08 micbar

This is essentially what is preventing me from using Owncloud OCIS as well.

Another use case: If I want to migrate my data from Owncloud to another storage solution, I don't want to have to do an expensive and time consuming migration to get the raw files. I understand the industry is moving towards S3-style object storage for performance reasons, but this is not really user-friendly.

I believe this issue is related https://github.com/owncloud/ocis/issues/5358 and it seems like this is not on the OCIS roadmap.. but I would suggest this would be a fantastic way to gain adoption.

springroll12 avatar Aug 29 '23 14:08 springroll12

@springroll12 @cyl3x

The topic is well understood.

let me explain why we focused on the decomposedFS:

  1. We wanted to get rid of the database! (Yes, we did 😊)
  2. All Metadata and share information is stored in the filesystem
  3. We have the option to store the file blobs in S3. (S3NG driver)
  4. We need to have an efficient lookup by id. Every file needs a logical unique ID. This is possible in the decomposedFS via the reverse indexing using symlinks.
  5. the decomposedFS can be scaled via NFS

normal FS

this would introduce the dependency to a database again. I agree that it makes sense. But what you really need is a „collaborative“ storage, which can be used directly bypassing the ocis APIs. This is possible via EOS and in the future maybe via SMB or Ceph.

micbar avatar Aug 29 '23 15:08 micbar

If this is currently possible through EOS driver, is there some guidance somewhere on how to achieve this? I'm sure many folks currently stuck in other storage solutions would like to try exploring it (or even developing different storage backends).

At the moment EOS seems very nebulous and I'm not sure how it fits into the equation.

springroll12 avatar Sep 01 '23 12:09 springroll12

@springroll12 Correct. EOS is a large storage Cluster invented by CERN.

GitHUB https://github.com/cern-eos/eos

Basically it is a POSIX filesystem with direct system ACL integration to work as a "collaborative" storage. You can work on the storage directly or in oCIS and have the same data and permissions.

micbar avatar Sep 01 '23 12:09 micbar

Maybe there is an easier way to go.

Let me assume the following:

  1. You are hosting ocis by yourself on a linux machine or VM
  2. You want to have some basic access to the files on the disk directly using rsync or another app which "just needs to read and write from the storage" (No high Performance use case, no high IOPS requirements)

Possible Solution

We could create a FUSE layer which mounts the decomposedFS as a normal POSIX tree. We could start something based on https://github.com/bazil/fuse . From my POV, this could be a really low hanging fruit. We could use the existing go implementations of the DecomposedFS from the ocis codebase directly.

Just thinking loud...

@butonic @dragotin @dragonchaser @hodyroff What do you think?

micbar avatar Sep 01 '23 15:09 micbar

I'd love to have a FUSE layer so that I have full controll via cli (had a similar request a year ago on central )

tbsbdr avatar Sep 04 '23 13:09 tbsbdr

Yes, FUSE is nice, but only as a very very last resort. Building it means maintaining another component which is error prone and also complex to use for users.

I wonder if there is a way to build a "simplified" decomposed FS that still has a "natural" and user accessible file tree, but also uses an index directory, that links file IDs to to paths or files.

If we accept to use a file notify framework (ie. https://pkg.go.dev/github.com/rjeczalik/notify ) for that it could be possible to maintain the index links during normal access to the file tree.

In reference to what @micbar mentioned in https://github.com/owncloud/ocis/issues/7126#issuecomment-1697655374, I think this simplified driver should have smaller requirements for now, ie.

  • not for the "big data" usecase
  • no S3 support for blobs
  • limited to one local filesystem (no nfs)

Important to note and one of the hard challenges: The File ID that needs to be de-referenced quickly must not change if a file is renamed, ie. the renamed file must still have the exact same ID.

dragotin avatar Sep 05 '23 16:09 dragotin

Yes, FUSE is nice, but only as a very very last resort. Building it means maintaining another component which is error prone and also complex to use for users.

Good point. I took a look into the Go Fuse libraries and how we could implement it. For me, it seems way less effort than building a new storage driver. Our storage interface has grown very much.

A full ocis storage driver needs to implement:

  • Spaces listing
  • Spaces structure
  • Sharing
  • Async uploads
  • Versions
  • Trashbin
  • Events for postprocessing, antivirus, search
  • Locking
  • ...

That feels like so much more work than to use the existing go code in the decomposedFS to implement a FUSE driver.

micbar avatar Sep 05 '23 19:09 micbar

@dragotin this is exactly what I was hoping was possible. It does seem like a lot more work, but would support most of the simpler use cases.

My understanding of the "no NFS, no S3 support" is that it would support ONLY serving/managing files from a local directory? Would this include NFS / SMB / Ceph volumes that have been mounted independent of OCIS? I think a lot of folks would use a mounted volume of some kind as their primary NAS storage, and if OCIS could not use this transparently (ie. if something about the mounted volume does not jive with the indexed FS), then I'm not sure this solution would cover the use case. To be clear in no way should OCIS speaking NFS/SMB be required in these scenarios.

springroll12 avatar Sep 06 '23 14:09 springroll12

Would this include NFS / SMB / Ceph volumes that have been mounted independent of OCIS?

AFAIK the usual change notification mechanisms in linux (inotify/fanotify) don't work for remote filesystem like nfs/cephfs/cifs. So this is a tricky one. (For cifs this might be solvable via libsmbclient).

rhafer avatar Sep 06 '23 14:09 rhafer

We could create a FUSE layer which mounts the decomposedFS as a normal POSIX tree. We could start something based on https://github.com/bazil/fuse . From my POV, this could be a really low hanging fruit. We could use the existing go implementations of the DecomposedFS from the ocis codebase directly.

This looks promising, I'd love to see this

dragonchaser avatar Sep 14 '23 11:09 dragonchaser

@micbar

Would the FUSE mechanism support filesystems mounted through NFS externally? Or does it suffer from the same challenges @rhafer mentioned?

springroll12 avatar Sep 19 '23 19:09 springroll12

@springroll12 if we have the fuse layer, we would not have to use the inotify layer @rhafer was talking about.

Now the question still is if the fuse layer works on a file system that is mounted via NFS.

I tried that with a share mounted like this: 192.168.178.83:/musik on /mnt type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.178.111,local_lock=none,addr=192.168.178.83) and starting the fuse layer from https://github.com/dragotin/openvfs which should at least be technically similar to what we need.

That (completely un-representative) test was successful, the fuse layer worked as expected on the NFS share.

dragotin avatar Oct 17 '23 08:10 dragotin

Seems like the fuse mechanism might work. I also see a similar feature request here: https://central.owncloud.org/t/is-something-like-external-storage-in-the-long-term-roadmap-for-ocis/42166/7

Any news on if this can be actioned in a future release?

springroll12 avatar Jan 11 '24 17:01 springroll12

Any chance this has made it onto a roadmap? If not could you provide guidance on how to implement the fuse layer with a community plugin?

springroll12 avatar Apr 16 '24 16:04 springroll12

We have great news!

We are currently working actively on a pure POSIX storage driver.

https://github.com/cs3org/reva/pull/4494 https://github.com/cs3org/reva/pull/4562 https://github.com/cs3org/reva/pull/4708

Branch with ongoing work on technical documentation: https://github.com/owncloud/ocis/tree/doc-posixfs

micbar avatar Jun 04 '24 13:06 micbar

@micbar do you have a roadmap, or a list of features which you guys plan to implement?

Would be very interested to be keep up-to-date on this topic. Thanks!

the-hotmann avatar Jun 09 '24 15:06 the-hotmann

Check this out please. https://github.com/owncloud/ocis/pull/9317

micbar avatar Jun 09 '24 19:06 micbar

Thanks, will have a look at.

the-hotmann avatar Jun 09 '24 23:06 the-hotmann

This is awesome! It looks like considerable progress has been made already!

springroll12 avatar Jun 12 '24 16:06 springroll12

The rolling release 6.1.0 from yesterday has the new storage driver inlcluded.

Please check it out and report back any isssues.

micbar avatar Jul 09 '24 07:07 micbar

@micbar any info about, when this will be integrated in the official docker image? I use the :latest tag and currently run on 5.1.0-prealpha+42e1d39da. So far from 6.1.0.

Thanks in advance!

the-hotmann avatar Jul 21 '24 17:07 the-hotmann

Please note:

owncloud/ocis ist the production release.

If you want to get hands on the rolling release, please check out owncloud/ocis-rolling.

micbar avatar Jul 21 '24 18:07 micbar

More details about the release channels: https://owncloud.dev/ocis/release_roadmap/

micbar avatar Jul 21 '24 18:07 micbar

Will there be an option to tranfer existing data inside a decomposed fs to the new storage driver?

7ritn avatar Sep 27 '24 14:09 7ritn

Not in the product.

But it is possible via rclone.

micbar avatar Sep 27 '24 14:09 micbar