serpent-os / moss

The safe, fast and sane package manager for Linux
https://serpentos.com
72 stars 10 forks source link

Mount user cache as overlay to system cache #86

Open ermo opened 7 months ago

ermo commented 7 months ago

Use Case

An sysop runs a powerful box running Serpent OS natively, that users alan, bea, charlie, doris, eric and freya have access to. They use it to create and test moss containers.

The sysop has a recurring job that runs (as root) sudo moss sync --onlyfetch every hour or so. The newly fetched stones aren't sync'd to the system specification unless they are known to be in a sane state; when they are sync'd, the sysop does a sudo moss sync --nofetch.

This functionality would ensure that any new userns containers using system-available .stones don't download those exact same stones to seven different $XDG_HOME_CACHE dirs; instead, most .stones from upstream repos are stored in system-managed moss download cache.

It is, however, unavoidable that users will use their own copies of the exploded assets (unless we have an actual de-duplicating FS underneath it all)

As a corollary to the above use case, we might need to figure out a way for user moss sync operations to wait on in-progress system sync operations? This could be via a moss-rs system daemon, where the daemon knows about the operations that are in progress in terms of the moss system store?

It might also be useful if all boulder instances could somehow share an asset (tar.gz/tar.zst) download cache via overlays?