R remotes包无法在慢速带宽上安装_github公共github包



在使用rocker/TidyVerse基本映像构建docker映像期间,我很难安装一个公共R包(140MB(。

我可以在快速互联网连接(200Mbps(上构建图像,但在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

我尝试过增加超时,指定下载方法(libcurl(,先安装有问题的包(ProSpect(,但都没有用。有人见过类似的东西吗?或者有什么建议吗?这是远程(和开发工具(从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")'

更新我已经把它缩小到遥控器的问题:在慢速连接(4Mbps下载(上安装_github。我看不出如何配置以绕过此。。。(如果我在40Mbps以上运行相同的安装,它安装没有问题,但我不能一直访问该带宽(。

> 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

如果不是使用install_github,而是将repo克隆为la:

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

然后使用

devtools::install()

另一个选项是为download.file设置超时选项,如:

options(timeout=1000)

我想你也必须安装httr,试试这个:我认为remotes使用httr,但无论出于何种原因,都没有在依赖项中安装它。

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("httr")'
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")'

最新更新