I am using a combination of ‘runtime.txt’ and ‘install.R’ to set up my configuration. It used to work just fine until a couple of days ago. Now, the binder runs but the packages (e.g., “tidyverse”) specified in ‘install.R’ fail to load. Examining the build logs suggests that the problem occurs because MRAN is down. E.g., the following URL:
We recently added a new way to install R packages and RStudio to repo2docker (the tool doing the image building). It uses conda-forge instead of MRAN. Might be worth trying out while MRAN is unavailable.
An example on how to do this is in https://github.com/betatim/r-conda. The basic pattern is to take the R package name and add a r- to the beginning, then add it to environment.yml.
This should speed up building your repository on mybinder.org because the conda packages don’t need compiling. Right now installing tidyverse from MRAN takes an hour or so because we have to compile lots of things.
Another side benefit could be that the conda package mirror has better uptime than MRAN.
A downside of this approach could be that not all the packages you need are available on conda-forge. For this we need more people using this approach to get some feeling for how good/bad the coverage is.
It would be great if you have a moment to try this out and send feedback/an experience report
Thanks you @betatim for the suggestion to use conda-forge instead of MRAN. MRAN is back for now. But I will give your suggestion a try and report back my experience.
It seems that MRAN is still down. I tried your suggestion and it works.
Now, why MRAN still seems to be an option if it is constantly down, should we just stick to conda-forge?
I tried the conda-forge approach and it works like a charm! Thanks @betatim!
The only (small) issue was that the package dslabs was not found. On CRAN, it appeared on 13 December 2019. So it is a very new package. I had no problems whatsoever with older, stable packages.
Not every R package is on conda-forge yet. However it should not be super difficult to add a new one and everyone can do it (no special permission needed), even if you aren’t the package author (https://conda-forge.org/#add_recipe).