My HPC runs CentOS while the container is running Ubuntu Focal. This means that when packages link a system dependency, that system dependency might be in different places. So, I can't use the same built binaries for some packages because they'll break when a system dependency they need isn't where it is expected (this happens when a package is built in one OS but loaded in the other).
To fix this I need to keep the CentOS and Ubuntu libraries separate from each other. This is simple enough when not using renv
, but I'm looking for reproducibility, so I need an renv
compatible way to keep the libraries separate.
To do this I define an Renviron.site
file that will be used by the container that sets an environmental variables for a prefix for the renv
cache and the project library. Then I bind mount the Renviron.site
file in the container and renv
picks up the environmental variable and keeps things separate.