Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renv and approved packages #5

Open
bpffjl opened this issue Jun 15, 2023 · 7 comments
Open

renv and approved packages #5

bpffjl opened this issue Jun 15, 2023 · 7 comments

Comments

@bpffjl
Copy link

bpffjl commented Jun 15, 2023

@jwbowers, do you have any thoughts on the interaction between renv and the approved package pool from GSA? I've started a new project from this template. I used a .rmd from another project as a starting point. When I open the file, I get the message that 42 packages need to be installed. I assume that this is because it's using the package environment from renv and not the already installed packages from GSA. My guess is that have I install the packages, I'll be able to call renv::snapshot(), then in the future, I won't need to install all these packages.

Is that right? What do you think?

@bpffjl
Copy link
Author

bpffjl commented Jun 15, 2023

@jwbowers It ended up taking 2 and a half hours to install the packages.

Do you think we should set up renv with a set of packages in the template? Would that help?

@jwbowers
Copy link
Collaborator

Correct that once you do renv::restore() it does an initial install and doesn't need to do it again unless someone changes a package (like updates it, stops using it --- i.e. removes library(blah) from any file in the repo, or adds a new one).

I hate how long it takes on Windows and Linux to install many packages. I don't understand why Window should be slow because they are binaries. (Linux can be slow because it wants to compile them all).

The best workaround is that our R Server image has a ton ton ton of packages installed at the outset. Then renv will just copy or symlink to the already installed global packages. So, upon initial image creation there might be need to be a 2 hour window of package installing, but that should only happen once for the whole image --- any other project done using that image should not need to reinstall them.

@bpffjl
Copy link
Author

bpffjl commented Jun 15, 2023

Great. Glad I wasn't crazy. At least on this point.

If we were to do that with the template, would we still have the two hour package installation when we start a new project from the template?

@jwbowers
Copy link
Collaborator

jwbowers commented Jun 15, 2023 via email

@jwbowers
Copy link
Collaborator

The discussion of Caching here suggests that we should see big speed ups if we can just have all the packages be installed in the image (the VDI, the AWS image, etc..)

@jwbowers
Copy link
Collaborator

Sadly, I can't get this to work on my machine right now:

  • Install packages globally
  • Clone new repo
  • Start R in workspace of new repo
  • Type renv::restore()
  • Hope to not see downloading...

@jwbowers
Copy link
Collaborator

I'm leaving this open for now. Basically full use of renv and this template is blocked until we know more about our analysis environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants