-
Notifications
You must be signed in to change notification settings - Fork 151
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
Discussion: Leveraging IPFS #148
Comments
How does this play with Git? Or in other words, what would be gained by using IPFS? The linked issue seems to be mostly talking about centralized package managers. |
The idea is to store packages decentralized in IPFS Permanent storage for packages addressed by their content instead of names without relying on single server (GitHub) Also it will be much faster since the data will be fetched from the closest peers (super fast local network or Internet) also package content cannot be forged (packages are addressed by their content) So basically everyone's Emacs package folder becomes mini GitHub (exposed via IPFS) and in the case when package can't be find on the IPFS network - we can fallback on the centralized method (getting a package from GitHub) and then (if user has IPFS gate) announce that he has the files to IPFS peers. Example: https://github.com/whyrusleeping/gx#dependencies The tricky thing is discovery. You need to know the hash of the package that you want to download. @syl20bnr Projects like Spacemacs can provide a file (generated in CI like we do with http://develop.spacemacs.org files) that will contain mappings between package names (or GitHub URLs)/versions and hashes that can be used to fetch the package from IPFS. This way we'll be able to fast and reliably download packages over untrusted network. Theoretically it can be done without such file via IPFS announcements and package signing by the authors. (we still need a way to verify their identity) but I'm not so familiar with the topic 🤔 |
That sounds very fascinating. There are indeed infrastructural problems, like the fact that each user must keep track of the hashes of their packages (which will change on every update), but I can see it working. (Although I probably won't be the one to implement it.) |
@raxod502 This task probably requires more inside knowledge of Looks really promising and simple https://github.com/ipfs/examples/tree/master/examples/git Unfortunately the official demo gateway https://gateway.ipfs.io seems to be always overwhelmed |
From my perspective, this aspect of What types of inside knowledge would be useful to someone implementing this functionality? Or equivalently—I know I won't be able to get to this anytime soon, since the 1.0 release will come first, so is there anything I can do to make sure that lack of knowledge about |
@raxod502 So Actually it should be much faster to get last N revisions of a package with something like or a particular one unfortunately it will not have .git stuff. But a package can be downloaded "normally" i.e. cloned just before its user wants to do something else than just... use it. 🤔 |
I understand that many package managers operate by downloading a snapshot of the package's code, but that's not how Now, I'm not saying there shouldn't be an option for an alternative mode of operation where the revision history is not downloaded, but that is entirely unexplored territory. And this is why I am saying that the conceptual work here does not really concern the current implementation of |
@raxod502 This is what got me interested in the first place despite initial skepticism and though unrelated to this issue, I don't think I got the chance to say - I'm really enjoying it so far, well done! I hope |
From the context of a user installing In the context of Spacemacs 80% of the users won't contribute to any package. And for the 20% who do contribute then they will contribute to maybe 20% of all the packages installed by Spacemacs. The eager download strategy of the source code history is then a guaranteed way to waste both time and space. In the context of Spacemacs the eager download strategy should be replaced by a lazy strategy. For instance by prodividing an interactive function to prepare a package for contribution in one step. Then all users benefit from this approach, by default the PM don't waste precious bandwidth and space, but at any moment any user can turn a bare package installation into a full package installation with all the source code history and the feature branch already in place with upstream configured and so on. |
I'm not opposed to adding such a mode of operation. It wouldn't be enabled by default in
You'd be surprised how much network latency drowns out any difference between |
Another thing to consider is shallow clones (see #2). I have a hunch that if shallow cloning is enabled, then |
That would be perfect.
Also volume of data downloaded, depending on the scale it can make a big difference. I think both Spacemacs and |
💜 |
For me
Should be even faster if we can avoid doing ssl handshake each time. |
I was talking about small repositories, which is the majority of Emacs packages. Indeed, there is a big difference for big repositories. However, the gap is reduced to virtually zero if you take shallow cloning into account:
(this is on the repository you linked) Now, shallow cloning might not be feasible due to complications pointed out by @vyp at #2 (comment). So it may be necessary indeed to implement an alternate installation mechanism. |
Looks like I was indeed wrong about my predictions vis-à-vis
(this is for installing the packages from #128 (comment)) Also, the disk usage is 78 MB for Indeed, it will be necessary to support an alternate initial mode of installation if |
I think this discussion has run its course. Please open a new one for further inquiries. |
food for thought ipfs/notes#171
Can it be the future 🤔
The text was updated successfully, but these errors were encountered: