@xuanwo 对于你的《为什么你该试试 Sccache?》一文,我有了一个疑惑:#sccache 是以文件为单位的,那会不会遇到 #GithubActionCacheService 的 rate limit 呢?

Magic #Nix Cache 的文档里提到,超过 #GHA Cache limit 时会遇到429错误。你的博文里也提到,旧的 #rust cache 粒度更粗,不用担心 #Github action cache limit.

ref:
https://xuanwo.io/reports/2023-04/
https://github.com/DeterminateSystems/magic-nix-cache-action/

2023-04: 为什么你该试试 Sccache?

An infrastructure engineer, focused on distributed storage system

@zhenboli 会,没啥办法(

@xuanwo

感觉 cache 的粒度是个两难的选择。粒度粗了,把一个非常大的文件夹拖下来,包含了很多用不到的内容,会浪费不少时间。粒度太细,又会触及 rate limit。

脑洞一下,能不能在 Read 前,估算一下这个 object 消耗的时间;Write 前,查看一下编译这个object消耗的时间。只有成本超过了threshold,才会真正访问GHA Cache,从而降低访问数。

background: 我之前说想着利用 GHA Cache 给 Nix 做cache [1],但今天重看一下文档,发现 Magic Nix Cache 已经基本上把我想做的事情做过了。

1: https://fediscience.org/@zhenboli/111212183066700799

Zhenbo Li (@[email protected])

@[email protected] I have a question about your work #sccache and #OpenDAL. To determine if the file is cached in GitHub Action[1], the logic is implemented in sccache or opendal? My X Problem[2]: I want to cache #Nix within #GitHubAction. AFAIK, current solutions (https://github.com/nix-community/cache-nix-action) will consider `/nix` as a whole object, causing "Caches are isolated between branches". Besides, the cost of downloading a big cache is not negligible. [1]: https://xuanwo.io/reports/2023-04/sccache.png [2]: https://en.wikipedia.org/wiki/XY_problem

FediScience.org