-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
IPFS mount write support #5504
Comments
@renne maybe you can try |
@overbool It doesn't solve the additional manual operation when e.g. sharing the directory via Samba. It is not possible to run |
I am working on an implementation of mount that should be more flexible. |
I'm using Linux. So this should be platform independent. |
We've decided to target cgo-fuse which currently covers macOS, FreeBSD, NetBSD, OpenBSD, Linux, and Windows. |
I always prefer OS-independent implementations. A drawback I see with cgo-fuse is the lack of go-toolchains for embedded devices (e.g. OpenWRT). |
Was it progressed since then in any way? |
@bam80 There were some coordination issues which stalled things for a while, and then the requirements being requested kept/keep changing, which is pushing us farther from this rather than closer. Breaking out of I shared a status update via IRC and plan to have a repo up for this eventually where progress can be more easily tracked, but am currently in the middle of a mental breakdown so I'm not sure when I'll be able to get to it. (;´∀`) Anyway, here's the other longwinded status update: https://pastebin.com/2W3RpViA If I make progress on this, I'll try to ping you back here if you'd like.
In addition to Fuse this implementation aims to be agnostic in a lot of ways. It's not tied to go-ipfs specifically, nor is it tied to cgofuse either. The existing implementation allows you to mount an ipfs node (remotley) via bazil Fuse, cgofuse, and expose 9P listening servers. Other file system libraries could be swaped in for this if they're needed. |
@djdv Thank you. |
I don't quite understand - we have IPNS already writable, isn't it? (sorry I may be missing things since I am new to all this) |
It does in fact work, but it doesn't work reliably yet. Good enough to demo, but not good enough to use. Deeper technical portion (ignorable): Those implementations were just experiments though. There's also issues with coordination with things like There are other ideas around this but it's not been fully thought out yet as some of the other things need to be taken care of first. For MFS this doesn't matter at all, but for the FileAPI (the node's own/specific MFS root) we could do either the same thing, or sidestep this entirely by relaying all the operations/data to the node itself. As if you were just doing IIRC the current implementations are just "last writer wins", so whoever saves last will be reflected on the node's key or Files root. But I haven't looked at it in a while. |
I mean, plain go-ipfs seems has IPNS mount writable. Not sure how useful it is, and how it compares with your work. |
Short answer is that these are 2 different implementations which use 2 different underlying libraries. Long answer: One of the libraries I'm targeting is cgo-fuse, which supports more platforms, one of which includes Windows. And could potentially be extended in the future to support even more platforms. The Bazil Fuse implementations of IPFS and IPNS are very old, and while I don't have any metrics for this, many users have been complaining that they're not practical for use. Using a lot of system resources even when idle, and even more when in use. Grinding the system to a halt unless they're artificially constrained by the OS (which only sidesteps the underlying problem). So the existing implementations are likely more correct, but not performant enough for actual use as far as I can tell. Rambling on more differences: Furthermore, there are other issues around the old implementations, such as the fact that it uses more layers of indirection than is necessary. The IPNS implementation utilizes the MFS library, and indirectly (sym)links into the IPFS mountpoint rather than just doing IPNS operations directly. I'm sure this contributes a lot of overheard, specifically all the locking that takes place within MFS, and jumping between process and kernel space via the host FS. The cgo-fuse implementations I have stands alone, and just uses IPNS and IPFS methods of the CoreAPI directly, rather than linking into an external mountpoint and indirecting through the filesystem multiple times. Most important but hardest to express is how these implementations are managed and used at an API level by the host program. The existing implementation's interfaces are somewhat rigid and have heavy connections to the IPFS node with some preconceived expectations. I highlighted some of these things in a video , but it's not super interesting. |
Thank you for the introspection. |
How about this - create a small service that converts NFS server commands to an MFS path by sending the requests to the go-ipfs daemon? NFS is basically supported on all platforms, even as boot mediums. :) |
(I hope nobody minds my gigantic walls of text, let me know if I'm being too too verbose)
I think it could probably be adapted from the legacy IPNS implementation but as far as I know there's no legacy implementation which mounts MFS. This seemed to be the intention of the FilesAPI, I'm not sure. @RubenKelevra To give an overview of how the system I have is intended to work, we have this file system interface: And that interface is used to implement host file system API interfaces like Fuse and 9P So the idea would be that we rework the MFS logic (to now work remotely with the FilesAPI on the remote IPFS node), which implements the first interface, and could then implement an NFS wrapper with the rest of them, giving us the ability to expose MFS as well as the other existing file systems abstractions I have here (IPFS, IPNS, PinFS, KeyFS, et al.): Not sure if that all makes sense, I need to write proper documentation when I'm not out of my mind. Because I'd really like other developers to be able to swap these components out and extend it without needing to make gigantic changes. To rephrase that, I wrote the Fuse version and then to add 9P support I literally just had to write this: If anyone wants clarification on anything just let me know. |
I'm attempting to try out your fsmanager fork branch, at first got a bit confused about the command-line options on ipfs itself: Anyway it sounds like it will be a good way forward. Now I have to find out more about 9p: I never used plan9 and didn't realize 9p is so alive with so many ports and rewrites: http://9p.cat-v.org/implementations Eventually I'd like to see IPFS working on NAS devices like the gnubee, but so far it takes too much memory (I can run ipfs on mine, but adding files makes it run out of memory); so in case we never get there, at least maybe 9p would provide a way to mount it remotely. Is this work something that Protocol Labs is supporting, so that we can expect it to be merged eventually? It sounds promising. |
@ec1oud
That's my mistake. I forgot to remove it, but just pushed a commit that does so, along with a backport for a path issue on non-Windows platforms. > go build ./cmd/fs
> ipfs daemon & #(any IPFS instance should work with `fs`)
> ./fs mount fuse pinfs /mnt/ipfs
> ls /mnt/ipfs
I'll be putting a repository up soon-ish which will contain refined versions of the code in that branch. But with that done, I want to start stabilizing the existing code from that branch. Getting to a stable set of read-only systems, with the write portions being reworked after.
Understandable. At the moment, command line arguments to While all that info is necessary, those values are really verbose.
Still interested in better alternatives to this, but for now it seems to work. In the future, I'd like to see the invocation mostly be bare.
Yeah it's really cool, and provides a lot via a simple interface. Has been interesting to read about, along with the rest of the Plan 9 papers.
No affiliation. As it was told to me, the feature is something the project would like to have, but my work in particular is not something that adds any value. |
Aha, makes sense. Unfortunately that didn't succeed:
But pinfs is OK.
Well mine has entries like this, when I run go-ipfs 0.8.0 with the --mount option:
and I don't understand why there's only "local" when that is not the name of my "self" key. Nor do I understand why on the ipns fuse filesystem it's in base58btc whereas It would be very nice if writing to the ipns key directory would actually remap the new hash to that ipns key. Then we'd finally have a real filesystem, to write files locally and share them at the same time. (And maybe version control could be done by policy: the config file could say how many old versions to keep, or for how long, so those previous hashes just stay pinned for a while longer. But that's gravy.)
Bummer. I'm really tired of waiting for ipfs to actually be a filesystem. But if your fork ends up working that well, maybe I can just use it for the forseeable future. And 9p might be a way to map extra storage from a NAS into ipfs... that's what I was thinking. Theoretically maybe I could help you with this code too. But I have barely written any go at all (I spend most of my time in C++ unfortunately, not that I particularly like it), and don't know my way around this codebase either. Anyway I look forward to your next push. Thanks for taking this on. |
FWIW progress was made on refactoring the prototype into something more stable. I put a repo up for the standalone @ec1oud |
Version information:
go-ipfs version: 0.4.17-
Repo version: 7
System version: amd64/linux
Golang version: go1.10.3
Type:
Enhancement
Description:
Using the
ipfs add -r
andipfs name publish
commands and copy and paste hashes around is quite inconvenient.So I suggest to make IPFS mounts writable by allowing to directly create directories and files and update them in
/ipns/<hash-id>/
.The text was updated successfully, but these errors were encountered: