R remotes package cannot install_github public github package on slow bandwidth

Viewed 219

I am struggling to install a public R package (140MB) during the docker image build with a rocker/TidyVerse base image.

I'm able to build the image on a fast internet connection (200Mbps) but struggling on 4Mbps

#11 687.2 The downloaded source packages are in
#11 687.2       ‘/tmp/Rtmpol4fiC/downloaded_packages’
#11 688.9 Downloading GitHub repo asgr/ProSpect@master
#11 748.8 Error in utils::download.file(url, path, method = method, quiet = quiet,  : 
#11 748.8   download from 'https://api.github.com/repos/asgr/ProSpect/tarball/master' failed
#11 749.1 Skipping install of 'Rfits' from a github remote, the SHA1 (7050c11a) has not changed since last install.
#11 749.1   Use `force = TRUE` to force installation
#11 749.4 Skipping install of 'ProFit' from a github remote, the SHA1 (3ad5fa18) has not changed since last install.
#11 749.4   Use `force = TRUE` to force installation
#11 749.7 * checking for file ‘/tmp/Rtmpol4fiC/remotes6494ed363/kateharborne-SimSpin-857278e/DESCRIPTION’ ... OK
#11 749.8 * preparing ‘SimSpin’:
#11 749.8 * checking DESCRIPTION meta-information ... OK
#11 749.8 * cleaning src
#11 749.9 * installing the package to process help pages
#11 750.3       -----------------------------------
#11 750.3 ERROR: dependency ‘ProSpect’ is not available for package ‘SimSpin’
#11 750.3 * removing ‘/tmp/RtmpUvUFDh/Rinsta8b47db6258/SimSpin’
#11 750.3       -----------------------------------
#11 750.3 ERROR: package installation failed
#11 750.5 Error: Failed to install 'SimSpin' from GitHub:
#11 750.5   System command 'R' failed, exit status: 1, stdout & stderr were printed
#11 750.5 Execution halted

I've tried increasing the timeout, specifying the download method (libcurl), installing the offending package (ProSpect) first, but to no avail. Has anyone seen anything similar or have any suggestions? This is a consistent issue with remotes (and devtools) downloading on slower bandwidth from github.

# Dockerfile for R-based software (SimSpin)
#FROM rocker/r-ver:4.1.2
FROM rocker/tidyverse:4.0.2

RUN apt-get -y update && apt-get install -y xml2 openssl libhdf5-dev libfftw3-dev curl

RUN R -e 'install.packages("remotes")'
RUN R -e 'options(timeout=9999999)'
RUN R -e 'options(download.file.method = "libcurl")'
RUN R -e 'Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS="true")'
RUN R -e 'remotes::install_github("asgr/ProSpect", ref="master")'
RUN R -e 'remotes::install_github("kateharborne/SimSpin", ref="master")'

UPDATE I've narrowed it down to a problem with remotes:install_github on a slow connection (4Mbps download). I can't see how to configure to bypass this... (if i run the same install on 40Mbps+ it installs no problem, however I don't have access to that bandwidth all the time).

> remotes::install_github("kateharborne/SimSpin", ref="master")
Downloading GitHub repo kateharborne/SimSpin@master
Error in utils::download.file(url, path, method = method, quiet = quiet,  : 
  download from 'https://api.github.com/repos/kateharborne/SimSpin/tarball/master' failed
1 Answers

What if instead of using install_github you cloned the repo a la:

git clone https://github.com/kateharborne/SimSpin
cd SimSpin

then used

devtools::install()

another option is to set the timeout option for download.file like:

options(timeout=1000)
Related