nuest/mro-docker

Install packages from github

trafficonese opened this issue · 1 comments

I am trying to install some packages from github directly but I am stuck and getting this error:

> devtools::install_github('r-dbi/RPostgres')

> Error in curl::curl_fetch_memory(url, handle = h) :
>   error setting certificate verify locations:
>   CAfile: microsoft-r-cacert.pem
>   CApath: none
> Calls: <Anonymous> ... remote_package_name.github_remote -> github_DESCRIPTION -> <Anonymous>
> Execution halted
> The command '/bin/sh -c R -e "devtools::install_github('r-dbi/RPostgres')"' returned a non-zero code: 1

I tried installing remotes just before that line and now it came up with another error:
> devtools::install_github('r-dbi/RPostgres')

> Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
>   namespace ‘remotes’ 1.1.1 is being loaded, but >= 2.0.2 is required
> Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
> Execution halted
> The command '/bin/sh -c R -e "devtools::install_github('r-dbi/RPostgres')"' returned a non-zero code: 1

Why is it downloading remotes 1.1.1?

I also tried setting the repo to a certain snapshot but got error number 1 again.

RUN R -e "options(repos = list(CRAN = 'https://mran.revolutionanalytics.com/snapshot/2019-04-26/')); \
          install.packages('remotes')"

This microsoft-r-open error might be related, but I wasn't able to apply their solutions although this one looked interesting.

So I tried setting CURL_CA_BUNDLE with the following path but still without success.
Sys.setenv(CURL_CA_BUNDLE='/opt/microsoft/ropen/3.5.0/lib64/R/lib/microsoft-r-cacert.pem')

nuest commented

The image does not access the latest packages from CRAN but uses MRAN snapshots, so installing a package from GitHub that uses a current version of remotes does not work, see https://mran.microsoft.com/documents/rro/reproducibility

The current 3.5.3 version of MRO is pinned to MRAN snapshot at April 15 2019 and I've just added a new Dockerfile for that version and the image is on Docker Hub - please give it a try.

However, installation of RPostgres is not so simple because it relies on Rcpp, which requires make, so I've added that to the Dockerfile with some required system dependencies.

Just installing RPostgres from GitHub does not work, because it will install the GitHub version of tidyverse, which requires vctrs newer than the available 0.1.0. And since installing the Tidyverse takes ages, I've added an image variant akin to rocker/verse (still being built on Docker Hub...):

docker run --rm -it nuest/mro:3.5.3-verse

# in R, IF YOU REALLY NEED THE GITHUB VERSION of RPostgres
remotes::install_github("r-lib/rlang")
remotes::install_github("r-lib/vctrs")
remotes::install_github('r-dbi/RPostgres')

# [...]
* DONE (RPostgres)

Note that installing all these packages from GitHub is a bit counteracting the efforts by MRO/MRAN for reproducibility.

Feel free to re-open or start a new issue if you have any further problems.