2

I am trying to add DMLC repos in my Dokerfile so that I can install mxnet package. I am doing this as follows:

RUN R -e "install.packages('drat', repos='https://cran.rstudio.com')"
RUN R -e "drat::addRepo('dmlc')"
RUN R -e "install.packages('mxnet', #repos='https://dmlc.github.io/drat',   dependencies=TRUE)"

This does not work. Surprisingly, I noticed that even though I am adding the dmlc repos, in fact it is not added when I print out the output of the following command:

RUN R -e "print(getOption('repos'))"

To resolve this, I specified the repos explicitly as follows:

#RUN R -e "install.packages('mxnet', #repos='https://dmlc.github.io/drat', dependencies=TRUE)"

Still this did not work. It throws an error saying:

this is screenshot of the error

Any help? All what I am trying to do is to install mxnet in my Dockerfile when I prepare my container.

owise
  • 1,055
  • 16
  • 28

1 Answers1

1

A few suggestions:

  1. Ensure that the R commands work successfully outside Dockerfile before you use them with Docker. For the error message you encountered, the file does not exist and hence the installation fails: http://dmlc.ml/drat/src/contrib/mxnet_0.7.tar.gz

  2. I tried the following steps on macOS X El Capitan and faced an error with dependent packages, rgexf and XML. However, could you check if the steps below work fine in your environment?

https://mxnet.incubator.apache.org/get_started/install.html

  cran <- getOption("repos")
  cran["dmlc"] <- "https://s3-us-west-2.amazonaws.com/apache-mxnet/R/CRAN/"
  options(repos = cran)
  install.packages("mxnet")

Errors encountered by me:

Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot download all files
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://s3-us-west-2.amazonaws.com/apache-mxnet/R/CRAN/src/contrib/mxnet_0.10.1.tar.gz': status was '404 Not Found'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘mxnet’ failed
...
...
...
ERROR: dependency ‘rgexf’ is not available for package ‘DiagrammeR’
* removing ‘/usr/local/lib/R/3.3/site-library/DiagrammeR’

The downloaded source packages are in
    ‘/private/var/folders/b2/d3rhxz3504q3q42dlx994wmnc9mg23/T/RtmpoUy7j7/downloaded_packages’
Warning messages:
1: In install.packages("mxnet") :
  installation of package ‘XML’ had non-zero exit status
2: In install.packages("mxnet") :
  installation of package ‘igraph’ had non-zero exit status
3: In install.packages("mxnet") :
  installation of package ‘rgexf’ had non-zero exit status
4: In install.packages("mxnet") :
  installation of package ‘DiagrammeR’ had non-zero exit status

Then, I tried:

cran <- getOption("repos")
cran["dmlc"] <- "https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/"
options(repos = cran)
install.packages("mxnet")

Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot download all files
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/src/contrib/mxnet_0.10.1.tar.gz': status was '404 Not Found'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘mxnet’ failed

NOTE: that this error does not halt the installation though until I hit this error:

** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/usr/local/lib/R/3.3/site-library/igraph/libs/igraph.so':
  dlopen(/usr/local/lib/R/3.3/site-library/igraph/libs/igraph.so, 6): Library not loaded: @rpath/libxml2.2.dylib
  Referenced from: /usr/local/lib/R/3.3/site-library/igraph/libs/igraph.so
  Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/3.3/site-library/igraph’
* restoring previous ‘/usr/local/lib/R/3.3/site-library/igraph’
ERROR: dependency ‘XML’ is not available for package ‘rgexf’
* removing ‘/usr/local/lib/R/3.3/site-library/rgexf’
ERROR: dependency ‘rgexf’ is not available for package ‘DiagrammeR’
* removing ‘/usr/local/lib/R/3.3/site-library/DiagrammeR’

It is possible that these steps may work on your OS and environment. So please try them and post your findings here.

Later, I found this issue on github. So, you can track this problem there:

https://github.com/apache/incubator-mxnet/issues/8926