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

[RFC 0133] Git hashing and Git-hashing-based remote stores #133

Merged
merged 27 commits into from
Jul 12, 2023

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Aug 28, 2022

Teach Nix Git hashing for store objects along-side flat and NAR hashing.
Also teach it to use remote stores that don't know about Nix concepts but do know about git hashing as substituters.

This follows the work done and described in https://github.com/obsidiansystems/ipfs-nix-guide/. The idea is that IPFS can act as one such store, but Nix need not know about IPFS per se, since they both "speak" Git hashing. Also, software heritage can act as another.

Rendered Merged

Tracking issue / Milestone

@Ericson2314 Ericson2314 changed the title Integrate Nix with IPFS [RFC 133] Integrate Nix with IPFS Aug 28, 2022
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/obsidian-systems-is-excited-to-bring-ipfs-support-to-nix/7375/43

@Ericson2314 Ericson2314 changed the title [RFC 133] Integrate Nix with IPFS [RFC 0133] Integrate Nix with IPFS Aug 28, 2022
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
Thanks!

Co-authored-by: Kevin Cox <kevincox@kevincox.ca>
@Ericson2314
Copy link
Member Author

Ericson2314 commented Aug 29, 2022

I would like to nominate @kevincox based on his feedback already (yay!) and his participation in the previous RFC #122 meetings.

I also suspect we'll need one or both of @edolstra and @thufschmitt for changes to Nix like this, so I nominate them both too.

I also suspect @fricklerhandwerk and @tomberek might be interested also, time permitting. I would not mind extra shepherds for this one!

@kevincox
Copy link
Contributor

I love the possibility of distributed content-addressed caches. I accept the nomination.

rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
@edolstra edolstra added status: new status: open for nominations Open for shepherding team nominations and removed status: new labels Sep 7, 2022
@edolstra
Copy link
Member

edolstra commented Sep 7, 2022

This RFC is open for shepherd nominations!

@fricklerhandwerk
Copy link
Contributor

@Ericson2314 Sorry, I can't commit any time to this. I like the idea a lot, but would have to go into more depth to be of any help, and this would be too much at the moment.

@Ericson2314
Copy link
Member Author

@fricklerhandwerk No problem at all :). I figured might be the case, but wanted to extend the nomination anyways based on our prior conversation.

rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
Thanks!

Co-authored-by: Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com>
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
rfcs/0133-ipfs.md Outdated Show resolved Hide resolved
@edolstra
Copy link
Member

edolstra commented Oct 5, 2022

I accept the shepherd nomination.

We need at least one more shepherd. Any takers?

rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Jun 25, 2023

On behalf of the shepherd committee, I declare this RFC to be in the Final Comment Period!

@kevincox kevincox added status: FCP in Final Comment Period and removed status: in discussion labels Jun 25, 2023
Ericson2314 and others added 3 commits June 26, 2023 09:48
Co-authored-by: Kevin Cox <kevincox@kevincox.ca>
They are now in an `ipfs-2` branch in this repo.
That can go in a separate blog post.
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rfc-0133-fcp-git-hashing-and-git-hashing-based-remote-stores/29749/1

rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
@sambacha
Copy link

different versions of IPFS have different default chunking parameters so ipfs add gives different CIDs.

you have two options:

  1. generate a .car file (archive of IPLD blocks) and send that to the pinning service.
  2. Send raw IPLD blocks through bitswap, for example with a tool like auspinner

guess what, There is defaults in the reference implementation of ipfs (balanced dag, 256KiB dag, protobuf wrapping) but pinning services don't follow them necessarily.

Additional info:
https://stackoverflow.com/questions/59183147/are-cid-different-for-the-same-file-but-uploaded-by-2-users-in-ipfs
https://discuss.ipfs.tech/t/cid-concept-is-broken/9733

Here is a google 'version' of IPFS, note the segmentation of the hash in the URI format:

https://github.com/google/ent

Thank you both!!

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Ryan Lahfa <masterancpp@gmail.com>
rfcs/0133-git-hashing.md Outdated Show resolved Hide resolved
The other stuff is already in flight, we don't need to talk about it so much here.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update-2/6808/5

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nixcon-governance-workshop/32705/9

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/community-calendar/18589/102

@Ericson2314
Copy link
Member Author

Excited to report we now have the first part implemented: the git-hashing experimental feature exists, and can use git hashing for adding objects to the store!

For how to use this, one can consult https://github.com/NixOS/nix/blob/master/tests/functional/git-hashing/simple.sh

In particular,

nix store add --mode git --hash-algo sha1 <file>

should work!

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/obsidian-systems-is-excited-to-bring-ipfs-support-to-nix/7375/65

KAction pushed a commit to KAction/rfcs that referenced this pull request Apr 13, 2024
* ipfs: Copy Template

* ipfs: Start drafting

* ipfs: Finish draft

* ipfs: Expand discussion of managing complexity

* ipfs: Fix typos

Thanks!

* ipfs: Fix more typos

Thanks!

* ipfs: FInish motivation on source distribution and archival

* ipfs: Rename now that we have number

* Apply suggestions from code review

Thanks!

Co-authored-by: Kevin Cox <kevincox@kevincox.ca>

* Fix typos

Thanks!

Co-authored-by: Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com>

* 133: Add shepherd team!

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>

* 133: Fix shepherds list

mjoseph -> amjoseph

* 133: Move non-`git` steps to future work

* 133: Move one more section out of future work

* 133: Move IPFS-specific motivation to future work too

* 133: Rename feature in light of changes

* 133: Rename RFC in light of changes

* 133: Discuss the downside of git's file system model being different

* Split future work, clean up Nix-agnostic stores section

* Fix numerious typos

Thanks, all of you!

Co-authored-by: Kevin Cox <kevincox@kevincox.ca>
Co-authored-by: Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com>
Co-authored-by: Linus Heckemann <git@sphalerite.org>

* Add RFC open PR date

* Be clearer about not supporting references to start

* Update rfcs/0133-git-hashing.md

Co-authored-by: Kevin Cox <kevincox@kevincox.ca>

* Rip out both RFC-scal Future Work sections

They are now in an `ipfs-2` branch in this repo.

* Remove "Build adoption through seamless interop"

That can go in a separate blog post.

* Apply suggestions from code review

Thank you both!!

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Ryan Lahfa <masterancpp@gmail.com>

* Slim down the layering section

The other stuff is already in flight, we don't need to talk about it so much here.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>

---------

Co-authored-by: Kevin Cox <kevincox@kevincox.ca>
Co-authored-by: Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com>
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
Co-authored-by: Linus Heckemann <git@sphalerite.org>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Ryan Lahfa <masterancpp@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.