-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
[Long Term Strategy and Priorities] Migration of S3 Bucket Payments to Foundation #86
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Maybe for 8 there is 8.1: delete some of the old non-fixed-output paths, technically irrecoverable, but rebuildable in a «close enough» manner if desired. |
8.2 I like the notion that if we had good bit-for-bit reproducibility (and we do in most packages I think), keeping the tiny |
Request for addition:
I suggested this as a short-term option in #82 (comment) but it is of course also a long-term possibility, and an alternative to Tahoe-LAFS or Minio. |
|
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/s3-update-and-recap-of-community-call/28942/1 |
I'm not sure if they belong here, in the short-term thread, or in a dedicated thread, but I imagine there's a category of things that might help reduce the egress charges (if we aren't moving somewhere that offers to cover them). Some of them overlap with items already mentioned for general cost reduction (like deduplication, deleting items), but I imagine there are more. (#82 (comment) in the short-term thread mentions two.) Maybe also:
If a new cache was in place early and the extra latency of using two backends at fastly (only hitting S3 for things that aren't already in the new store) was tolerable, I guess the above could also be paired with deleting the corresponding paths from S3 to reduce storage costs there? (I guess this would also make it progressively easier/cheaper to understand what's left, perform deduplication, etc.) |
Do we even have the tools for doing stuff like this? If we have, are they documented? How easy are they to use? |
Could we extend the binary cache concept to include a streamlined peer-to-peer service that any Nix machine could opt into ? Users could add Automatic peer discovery has to be taken into account:
(I apologise if I said a bunch of useless nonsense.) |
IMHO, this is a distribution question, not a storage question. And anyone is free to open a long term issue / exploration on better distribution layers for the Nix store :). |
Got it, though I guess if we were to go all in with community load sharing, storage could purge the binary caches (reproducible output, not "valuable" sources) and reduce costs on that front as a result. This avenue would make sense if there is a large amount of seeders able to mostly take over the existing hosting solution, or its benefits outweigh the costs of S3/Fastly. |
I think a lot of people would argue there's no real incentive for community to maintain a certain a QoS and then we are back to the centralized problem anyway, so I would not focus my own time there too quickly before we get a centralized system that is sustainable. |
Ideally, we'd store builds in large chunk stores after pre-processing them to move store paths out of the files (*). A frontend can pretend to be a NAR store. Then, we'd make nix-store aware of this format, and instead of requesting NARs it would fetch the needed chunks and combine them. This way, less data is transferred to the client, and the frontend is no longer needed. I believe this will reduce the amount of data stored and transferred by several-fold. (*) stripping store paths, here's how I see that happening: Given that rolling chunks for deduplication are still quite big, and I suspect that many files only change after building by their inclusion of nix store paths that changed, how about pre-processing all stored files as follows: The idea is to move the nix store paths (only up to the first part) into a separate list, and remove them from the file. So then you would replace a file This can be encoded in a streaming manner, and decoded in a streaming manner provided you have access to the tuples L.
This result should be way better at being chunked. I am hoping that many rebuilt files will have the same The |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixos-s3-short-term-resolution/29413/1 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixos-s3-short-term-resolution/29413/3 |
When clients fetch from multiple redundant sources in parallel, slow or unavailable sources have very little impact on performance; Bittorrent solved this problem twenty years ago. See also The Tail at Scale.
I think a distributed storage model like this is the best path to a long-term-sustainable, no-monetary-cost solution. There is so much good will in the general user community. If it's as simple as responding to an "uncomment this line to help support this community" note in the |
The only risk I see in participating is potentially leaking private/secret derivation data, is it not ? Currently, it looks like servers help clients know in advance if cached results exist by exposing a listing of store paths ( But in a peer-to-peer system, could leechers instead query on-demand paths they know about (i.e. public packages) to seeders to reduce attacks ? Attackers would have to bruteforce the private hash + derivation name & version, but I don't know how risky this still is. Additionally, the service implementation could rate limit too many failed queries, but only if they're not part of public store-paths from registered substituters since we don't want to rate limit legitimate queries. |
What I would suggest is to start a P2P Nix cache working group and discuss the implementation details there. The best way to do this is to announce it on Discourse and gather interested members. And then start implementing a prototype to demonstrate the feasibility. What's nice is that we have multiple concurrent efforts, and all of them are complementary AFAIK. And the exact shape of the new solution will mostly depend on your participation. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/peer-to-peer-binary-cache-rfc-working-group-poll/29568/1 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/peer-to-peer-binary-cache-rfc-working-group-poll/29568/5 |
The question is not so much about getting enough capacity, it is about having a good understanding of availability projections, and also of people having or not having time to perform active maintenance (like support software version updates) on their chunks of distributed storage. See also: OfBorg community-provided builders (where Graham complained about people having time to update the builder code not being too predictable — the updates were smooth BTW, and eventually it all ended up with a centrally-managed infrastructure) |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixos-s3-short-term-resolution/29413/14 |
Observation: one of the big challenges with moving off of AWS is the egress costs for the S3 bucket, whether via outbound bandwidth or Snow Family products. If we had a job somewhere that downloaded only items that were in the fastly cache, we'd be able to accumulate a subset of built derivations without incurring egress charges. This seems like it'd converge to a decent subset of the files currently in S3, and more importantly it will put an upper bound on the amount of "old stuff" we'd have to egress. |
I'm trying to keep track of this and dropping this here for others; last meeting was on 11-21-2023 https://pad.lassul.us/nixos-cache-gc# - let me know if this is the wrong place |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Listing out all options/possibilities that have been brought up or being explored for the long term improvements/resolutions/options below. Please add in anything that might be of interest to bring up/discuss/alternative options on the topic.
Discussion: https://discourse.nixos.org/t/the-nixos-foundations-call-to-action-s3-costs-require-community-support/28672
Thank you to joepie91 and raitobezarius for helping put this initial list together from the matrix/discourse discussions:
The text was updated successfully, but these errors were encountered: