rstudio / renv

renv: Project environments for R.
https://rstudio.github.io/renv/
MIT License
1.02k stars 155 forks source link

Allow shared build cache package installation to avoid duplication #4

Closed colearendt closed 5 years ago

colearendt commented 5 years ago

In multi-tenant servers (i.e. RStudio pro products), it might be beneficial to have "build awareness" in relation to #3 (when using a shared cache).

I.e. 5 users request to build the same package version at the same time. It would be nice to see if it's possible for renv to have hooks or some type of awareness into that build pipeline so that redundancy can be reduced.

Honestly, part of this may be just awareness / extensibility and potential dependence on an arbitrary package installation client (which might provide this build awareness). I just wanted to document the idea in case it affects the development process at all.

For instance - on Connect (packrat), if 5 users attempt to install the same package at the same time, they will all build from source concurrently. Each one, as it completes, will update the cache with its completed version. This (1) is redundant and (2) burns up the CPU. Binary packages could resolve much of the issue, but in any case where binaries are not available, some additional client awareness would be useful.

kevinushey commented 5 years ago

FWIW I think this is a relatively low priority issue as getting this right and being robust to failure will be far more difficult than the minor pain of having a package compiled multiple times on different machines.

kevinushey commented 5 years ago

I'm going to close this as out of scope -- I believe this will be too expensive to get right, and ultimately have only marginal benefit.