!CcTBuBritXGywOEGWJ:matrix.org

NixOS Binary Cache Self-Hosting

173 Members
About how to host a very large-scale binary cache and more60 Servers

Load older messages


SenderMessageTime
24 Aug 2023
@brian:bmcgee.ieBMGGonna capture what nix is doing to see if it's setting anything 15:25:52
@linus:schreibt.jetzt@linus:schreibt.jetztat the same time, I think it's fair enough to just not implement it15:25:55
@brian:bmcgee.ieBMGCan confirm, Nix isn't setting anything special on the request15:26:58
@brian:bmcgee.ieBMG A PATCH would technically be the 'correct' way to do this I guess 15:27:29
@brian:bmcgee.ieBMGOr it looks like ETag and If-Match is how you can prevent this https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag#avoiding_mid-air_collisions15:28:56
@brian:bmcgee.ieBMGNix client would refresh and try again 15:29:34
@linus:schreibt.jetzt@linus:schreibt.jetztI think generally something like attic is a better approach to a binary cache anyway15:29:51
@brian:bmcgee.ieBMGattic is using it's own client right?15:31:25
@brian:bmcgee.ieBMGinstead of the http interface15:31:30
@linus:schreibt.jetzt@linus:schreibt.jetztit can serve Nix's protocol read-only as well15:31:44
@brian:bmcgee.ieBMGMakes sense now why Domen did it aswell15:32:00
@brian:bmcgee.ieBMGthe http interface is fine for read15:32:11
@brian:bmcgee.ieBMGnot that great for the writes15:32:18
@brian:bmcgee.ieBMGFor context, I'm playing around with my own cache implementation which is why I'm interested 15:33:05
@linus:schreibt.jetzt@linus:schreibt.jetztone thing I'd like to have in Attic is the ability to have signatures from the client in addition to server-managed signing keys15:34:12
@brian:bmcgee.ieBMGHave it merge on upload?15:34:34
@linus:schreibt.jetzt@linus:schreibt.jetztwell currently attic just stores a single signature for each narinfo (which is a database table entry, not an actual file), and that signature is generated by the server at upload time15:36:02
@linus:schreibt.jetzt@linus:schreibt.jetztbut it means that you have to trust the server much more than if the client could provide its own signatures15:36:24
@brian:bmcgee.ieBMGmakes sense, also what happens with key rotation on the server 15:37:06
@linus:schreibt.jetzt@linus:schreibt.jetztkey rotation is generally a tricky topic with nix https://github.com/NixOS/rfcs/pull/14915:37:58
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @linus:schreibt.jetzt
well currently attic just stores a single signature for each narinfo (which is a database table entry, not an actual file), and that signature is generated by the server at upload time

The signature is generated at download time using the the per-cache private key managed by the server. It does store client-supplied signatures in the database but they aren't exposed at the moment. I wrote a bit more here: https://github.com/zhaofengli/attic/issues/80#issuecomment-1684347741

(oh right, forgot to respond)

15:40:33
@zhaofeng:zhaofeng.liZhaofeng Li So we can easily have client-managed signatures now by changing how narinfo is generated (need to fix serialization for multiple signatures), but I'd prefer to have a complete story UX-wise (the client should be able to automatically sign on upload) 15:42:27
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @brian:bmcgee.ie
makes sense, also what happens with key rotation on the server
You currently can rotate the server-managed key with attic cache configure --regenerate-keypair, but all clients who download need to reconfigure their trusted public keys
15:44:35
@zhaofeng:zhaofeng.liZhaofeng LiSo the resulting experience can be frustrating15:44:56
@linus:schreibt.jetzt@linus:schreibt.jetzt
In reply to @zhaofeng:zhaofeng.li

The signature is generated at download time using the the per-cache private key managed by the server. It does store client-supplied signatures in the database but they aren't exposed at the moment. I wrote a bit more here: https://github.com/zhaofengli/attic/issues/80#issuecomment-1684347741

(oh right, forgot to respond)

oops, sorry for talking nonsense 🙃
15:54:44
@brian:bmcgee.ieBMG Am I right in thinking, that with a custom client for pushing to the cache, that's where you're calculating the chunks / doing the heavy lifting for the de-duplication? Zhaofeng Li: 17:57:05
@brian:bmcgee.ieBMGOperating on the uncompressed store paths instead of having to decompress them on the server side 17:57:43
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @brian:bmcgee.ie
Am I right in thinking, that with a custom client for pushing to the cache, that's where you're calculating the chunks / doing the heavy lifting for the de-duplication? Zhaofeng Li:
Actually deduplication is handled server-side and is transparent to the client. As a result, the upload API is very simple and the client just streams the entire uncompressed NAR to the server
19:09:49
@brian:bmcgee.ieBMG
In reply to @zhaofeng:zhaofeng.li
Actually deduplication is handled server-side and is transparent to the client. As a result, the upload API is very simple and the client just streams the entire uncompressed NAR to the server
🤔
19:15:05
@brian:bmcgee.ieBMGSo you dedupe the nar archive not the uncompressed form?19:15:43

Show newer messages


Back to Room ListRoom Version: 10