Code Monkey home page Code Monkey logo

mro-docker's Introduction

A Docker image for Microsoft R Open

Docker Automated build Actions Status

Microsoft R Open, formerly known as Revolution R Open, is an "enhanced R distribution". You can use this Docker container to give MRO a quick try, i.e. without any impact on your local system, or to run MRO in an online Docker infrastructure.

Homepage: https://mran.microsoft.com/open

For plain R Docker images see Rocker. The Rocker images were a great help in creating the MRO images.

MRO focusses on speed and reproducibility.

By default, packages are not installed from main CRAN, but from a CRAN repository snapshot. For more information see https://mran.microsoft.com/documents/rro/reproducibility. MRO promises better speed by using special multi-threaded math libraries, replacing default R's BLAS/LAPACK libraries.

Important: By running this container you accept the MKL and MRO licenses.

Image metadata can be explored at Microbadger: https://microbadger.com/images/nuest/mro

Run container

docker run --user docker nuest/mro

This downloads the latest build of the image from Docker Hub. In the container, R is automatically started. When you exit R, the container is automatically stopped.

Optionally you can use tags for specific versions of MRO and execute a demo script:

docker run -it --rm nuest/mro:4.0.2

# in R
> source("demo.R")

Alternatively, you can start regular bash (you can skip the --user docker if root rights are needed in the container):

docker run -it --user docker mro /bin/bash

To work with your own data, simply mount a directory on the host computer to the container, see the Docker documentation on volumes.

You can install packages etc. in the R session as usual, though for reproducibility it is strongly recommended to do this only in the Dockerfile.

By default, the licenses and terms of use will printed when you start a container, because you had no chance to acknowledge them before downloading the image. If you want to disable the license printing, you can override the default R command and use one of these options, which will disable the license output (in addition to the options main effect): -q, --silent, --quiet, --slave.

$ docker run -it --rm mro:3.5.3 R --quiet
>

RStudio with R 4.0.2

Based on 4.0.2-verse image below, this variant provides RStudio.

docker build --tag mro:4.0.2-rstudio ./4.0.2-rstudio
docker run -p 8787:8787 -e PASSWORD=mro mro:4.0.2-rstudio

Go to http://localhost:8787 and enter username/password rstudio/mro.

4.0.2-verse

A copycat of the rocker/verse image, installing tidyverse and other often used packages, and adding R Markdown authoring tools (LaTeX etc.); based on the 4.0.2 image below.

docker build -t mro:4.0.2-verse 4.0.2-verse

4.0.2

Microsoft R Open 4.0.2 is based on R-4.0.2. The default CRAN mirror has been updated to point to the fixed CRAN repository snapshot from Jul 16, 2020. release notes

The base image is Ubuntu 18.04. See also MRO 4.0.2 documentation.

docker build -t mro:4.0.2 ./4.0.2

3.5.3

Microsoft R Open 3.5.3 is based on R-3.5.3. The default CRAN mirror has been updated to point to the fixed CRAN repository snapshot from Apr 15, 2019. release notes

The base image is Ubuntu 18.04. This is also the first MRO image with Rcpp preinstalled. See also MRO 3.5.3 documentation.

cd 3.5.3
docker build -t mro:3.5.3 .

3.5.3-verse

A copycat of the rocker/verse image, installing tidyverse and other often used packages, and adding R Markdown authoring tools (LaTeX etc.).

# if using only local builds:
#docker tag mro:3.5.3 nuest/mro:3.5.3

cd 3.5.3-verse
docker build -t mro:3.5.3-verse .

3.5.0

Microsoft R Open 3.5.0 is based on R-3.5.0. The default CRAN mirror has been updated to point to the fixed CRAN repository snapshot from June 01, 2018. release notes

The base image is Ubuntu 16.04. See also MRO 3.5.0 documentation.

cd 3.5.0
docker build -t mro:3.5.0 .

3.4.4

The CRAN repository points to a snapshot from May 1, 2017. This means that every user of Microsoft R Open has access to the same set of CRAN package versions. source

The base image is Ubuntu 16.04. See also MRO 3.4.4 documentation.

Build the image:

cd 3.4.4
docker build -t mro:3.4.4 .

3.2.5

See installation instructions: https://mran.microsoft.com/archives/install-doc/mro-3.2.5/ The base image is Ubuntu 14.04. The interactive installation script of the MKL download package was adapted in the file RevoMath_noninteractive-install.sh to not require any user input. See also MRO 3.2.5 documentation (archived).

Build the image:

cd 3.2.5
docker build -t mro:3.2.5 .

Automatic builds

The automatic builds are configured to run on the master branch and each Dockerfile, e.g. /3.4.0/Dockerfile is tagged with the full release version, e.g. 3.4.0. Other semantic version tags are added automatically by build hooks based on the directory names, e.g. latest, 3, and 3.4 for our example.

Contribute

You're welcome to contribute to this repository! Please be aware of the Code of Conduct.

Please open an issue before you start considerable work and do check out existing (closed) issues for possible tasks or previously answered problems. Feel free to ping the maintainer via Email if you don't get a response within a few weeks.

Thanks

  • Imre Gera @Hanziness contributed improved printing of EULAs/licenses (#12)
  • Roland Seidel @luechtdiode contributed 4.0.2 image files

License

MRO and MKL licenses

The following license applies to the code files in this repository:

Copyright (C) 2020 Daniel Nüst

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

mro-docker's People

Contributors

hanziness avatar luechtdiode avatar nuest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mro-docker's Issues

Fix build on Docker Hub

While the image builds on my machine, it does not build on Docker Hub:

https://hub.docker.com/r/nuest/docker-mro/builds/bu8svmql9vir2wz7fhva3az/

[91mdirname: �[0m�[91mmissing operand�[0m�[91m
�[0m�[91mTry 'dirname --help' for more information.
�[0m�[91mdirname: �[0m�[91mmissing operand�[0m�[91m
�[0m�[91mTry 'dirname --help' for more information.
�[0m�[91m/usr//lib64/MRO-3.2.3/R-3.2.3/lib/R/bin/R: line 215: /etc/ldpaths: No such file or directory
�[0m�[91mERROR: R_HOME ('') not found
�[0mError: Microsoft R Open was detected; however, it is not the correct version.
This utility is for version 3.2.3 only.  Exiting now.........

Removing intermediate container 1dfc69e0cca8
The command '/bin/sh -c ./RevoMath_noninteractive-install.sh    && echo "\n*** RevoMath Installation log ***\n"     && cat mkl_log.txt  && echo ""' returned a non-zero code: 1

Unable to install `dbmss` package

From ismailsunni/dockeRs#33

To reproduce:

install.packages("dmbss")

It will give this error:

* installing *source* package ‘dbmss’ ...
** package ‘dbmss’ successfully unpacked and MD5 sums checked
** libs
g++ -std=gnu++11 -I/opt/microsoft/ropen/3.5.3/lib64/R/include -DNDEBUG  -I"/opt/microsoft/ropen/3.5.3/lib64/R/library/Rcpp/include" -I"/opt/microsoft/ropen/3.5.3/lib64/R/library/RcppParallel/include" -DU_STATIC_IMPLEMENTATION   -fpic  -DU_STATIC_IMPLEMENTATION -g -O2 -c CountNbd.cpp -o CountNbd.o
g++ -std=gnu++11 -I/opt/microsoft/ropen/3.5.3/lib64/R/include -DNDEBUG  -I"/opt/microsoft/ropen/3.5.3/lib64/R/library/Rcpp/include" -I"/opt/microsoft/ropen/3.5.3/lib64/R/library/RcppParallel/include" -DU_STATIC_IMPLEMENTATION   -fpic  -DU_STATIC_IMPLEMENTATION -g -O2 -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -shared -L/opt/microsoft/ropen/3.5.3/lib64/R/lib -o dbmss.so CountNbd.o RcppExports.o Microsoft R Services MKL End User License Agreement These license terms are an agreement between Microsoft Corporation ("Microsoft" or "us") and you ("User" or "you"). Please read them. By selecting the "I ACCEPT" box, accessing, or otherwise using the R Services MKL software or documentation, you agree to all the terms of this agreement. If you do not agree with all of these terms, do not select the "I ACCEPT" box, access, or otherwise use the R Services MKL software or documentation. User does not become a licensed user of, and is not authorized to use, the R Services MKL software or documentation unless and until it has agreed to be bound by all of these terms. R Services MKL is a software package provided for use with Microsoft R Server, Microsoft R Open, and any successors or other software applications released by us ("Licensed Products") that can be used with the Intel® Math Kernel Libraries ("MKL")(for more information, see https://software.intel.com/en-us/intel-mkl). This software package is referred to herein as the "R Services MKL." Intel Corporation is referred to as "Intel." 1. License. The R Services MKL is licensed for exclusive use with the Licensed Products. Subject to all of the terms and conditions of this Agreement, Microsoft grants User a non-exclusive, non-transferable, non-sublicensable right to use R Services MKL. R Services MKL must be used as a single integrated software application and may not be separated into its constituent parts. 2. Restrictions. User shall not, directly or indirectly: (i) sublicense, resell, rent, lease, distribute, market, commer

The EULA printing breaks the compilation command. Silencing them fix the problem

Document what "quick try" implies

You can use this Docker container to give it a quick try.

I wonder whether this container is production ready or not. "quick try" doesn't sound very trustworthy.

Install packages from github

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')

MKL does not seem to install correctly

I ran the docker.
It does not seems to install the MKL library correctly.
If I install from within the docker it seems to work ok.

docker run -it nuest/docker-mro /bin/bash
root@ff955b433352:/home/docker# R

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
...

Microsoft R Open 3.2.3
Default CRAN mirror snapshot taken on 2016-01-01
The enhanced R distribution from Microsoft
Visit http://go.microsoft.com/fwlink/?LinkID=722555 for information
about additional features.

No performance acceleration libraries were detected. To take advantage of
the available processing power, also install MKL for MRO 3.2.3. Visit
http://go.microsoft.com/fwlink/?LinkID=698301 for more details.

  1. root@cadf33f01229:/home/docker# curl -LO -# https://mran.revolutionanalytics.com/install/mro/$MRO_VERSION/RevoMath-$MRO_VERSION.tar.gz
################################################################## 100.0%

root@cadf33f01229:/home/docker# tar -xzf RevoMath-3.2.3.tar.gz
root@cadf33f01229:/home/docker# cd RevoMath
root@cadf33f01229:/home/docker/RevoMath# ./RevoMath.sh


  • Which action do you want to perform?
    
    ...

root@cadf33f01229:/home/docker/RevoMath# R
...
Microsoft R Open 3.2.3
Default CRAN mirror snapshot taken on 2016-01-01
The enhanced R distribution from Microsoft
Visit http://go.microsoft.com/fwlink/?LinkID=722555 for information
about additional features.

Multithreaded BLAS/LAPACK libraries detected. Using 6 cores for math algorithms.
...

Use arguments/variables for base images

FROM ubuntu
ENV MRO_VERSION=1.2.3

Next in layer:

ARG IMAGE=nuest/mro
FROM $IMAGE:$MRO_VERSION

Does that work? Would allow to overwrite base image for local builds... this could also make the tests independent from the images on Docker Hub.

R command error

Hi,

After a build or pull I got the error below when I'm running R command inside the container.
I know originally you solved RevolutionAnalytics/RRO#265 but it seems I have the same problem.

My docker version is 1.9.1 and I'm on Ubuntu 14.04.

dirname: missing operand
Try 'dirname --help' for more information.
dirname: missing operand
Try 'dirname --help' for more information.
/usr/bin/R: line 215: /etc/ldpaths: No such file or directory
ERROR: R_HOME ('') not found

install2.R

Include something similar than the install2.R or littler script so that packages can be installed easily in the Dockerfiles.

libpangocairo-1.0.so.0: cannot open shared object file: No such file or directory

Just tried the vanilla cmd: docker run -it --rm nuest/mro:4.0.2

with the following warning:

Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
  unable to load shared object '/opt/microsoft/ropen/4.0.2/lib64/R/modules//R_X11.so':
  **libpangocairo-1.0.so.0**: cannot open shared object file: No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.