zhaofengli / attic

Multi-tenant Nix Binary Cache

Home Page:https://docs.attic.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature request] GC roots (protect certain paths from garbage collections)

chekoopa opened this issue · comments

I'm looking at Attic as a nix-serve alternative to host some binary caches to deploy our inhouse Nix-based software. The server I get to use now is about 40 GB of available storage, which is enough to keep some stables, but needs proper garbage collection, which worries me as I'll have to re-push some important outputs again and again.

I know that with nix-serve I can use gcroots to protect some outputs from GC removal. Are there any features in Attic for that, or should I state this post as a feature request? I'm not that experienced in binary caches yet, so maybe it takes less action for that.

I think such a feature would make lots of sense.

Currently we have a big CI server where various projects do their CI on. We are using GC roots to prevent GC of packages required for the build and also for the build results.

This is very easy to understand: The results will be cached forever until the result itself changes.

I would prefer something like that over time based GC as either I would need to configure a short time and have to live with needing to rebuild packages in less active projects, or specify a long time and have lots of garbage in the cache from more active projects.

Maybe there could be a CLI option like attic gcroot <cache> <unique name of gcroot> <path>?

Is it correct that attic did not yet need to handle referrers from the .narinfo?

To implement GC roots efficiently the referres would probably need to be stored someplace else on upload, right?