claircore
claircore copied to clipboard
smarter disk allocation
In our current implementation, we assume that disk space is not a problem.
In highly-tuned or tightly packed containerized deployments, using the container's ephemeral disk may result in evictions.
We should have some limit to disk usage that is reasonable by default, tunes down automatically, and can be manually increased.
A call to syscall.Statfs could help determine sizing, and then something like a golang.org/x/sync/semaphore.Weighted could be used to control requests.
There's probably a heuristic around detecting a volume dedicated for our use and just having the ephemeral root.
Note for future us: there's talk in the distribution spec about handling uncompressed layers -- this would be very helpful for calculating what we need.