Update docker and linux instructions to use RSPM binary repo for for faster installation

pull/111/head
JulioV 2021-01-05 18:36:19 -05:00
parent 2b1f3f230c
commit 9418e6e936
2 changed files with 50 additions and 15 deletions

View File

@ -15,6 +15,7 @@ RUN apt update && apt install -y r-base
RUN apt install -y pandoc RUN apt install -y pandoc
RUN apt install -y git RUN apt install -y git
RUN apt-get update && apt-get install -y vim RUN apt-get update && apt-get install -y vim
RUN apt-get update && apt-get install -y nano
RUN apt update && apt install -y unzip RUN apt update && apt install -y unzip
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH ENV PATH /opt/conda/bin:$PATH
@ -42,7 +43,7 @@ RUN conda update -n base -c defaults conda
WORKDIR /rapids WORKDIR /rapids
RUN conda env create -f environment.yml -n rapids RUN conda env create -f environment.yml -n rapids
RUN Rscript --vanilla -e 'install.packages("rmarkdown", repos="http://cran.us.r-project.org")' RUN Rscript --vanilla -e 'install.packages("rmarkdown", repos="http://cran.us.r-project.org")'
RUN R -e 'renv::restore()' RUN R -e 'renv::restore(repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/focal/latest"))'
ADD https://osf.io/587wc/download data/external ADD https://osf.io/587wc/download data/external
RUN mv data/external/download data/external/rapids_example.sql.zip RUN mv data/external/download data/external/rapids_example.sql.zip
RUN unzip data/external/rapids_example.sql.zip RUN unzip data/external/rapids_example.sql.zip

View File

@ -1,6 +1,6 @@
# Installation # Installation
You can install RAPIDS using Docker (the fastest), or native instructions for MacOS and Ubuntu You can install RAPIDS using Docker (the fastest), or native instructions for MacOS and Linux (Ubuntu). Windows is supported through Docker or WSL.
=== "Docker" === "Docker"
@ -8,7 +8,7 @@ You can install RAPIDS using Docker (the fastest), or native instructions for Ma
2. Pull our RAPIDS container 2. Pull our RAPIDS container
``` bash ``` bash
docker pull moshiresearch/rapids:latest` docker pull moshiresearch/rapids:latest
``` ```
3. Run RAPIDS\' container (after this step is done you should see a 3. Run RAPIDS\' container (after this step is done you should see a
@ -44,6 +44,9 @@ You can install RAPIDS using Docker (the fastest), or native instructions for Ma
- Double click on the `moshiresearch/rapids` container in the`CONTAINERS` tree - Double click on the `moshiresearch/rapids` container in the`CONTAINERS` tree
- A new VS Code session should open on RAPIDS main folder inside the container. - A new VS Code session should open on RAPIDS main folder inside the container.
!!! warning
If you installed RAPIDS using Docker for Windows on Windows 10, the container will have [limits](https://stackoverflow.com/questions/43460770/docker-windows-container-memory-limit) on the amount of RAM it can use. If you find that RAPIDS crashes due to running out of memory, [increase](https://stackoverflow.com/a/56583203/6030343) this limit.
=== "MacOS" === "MacOS"
We tested these instructions in Catalina We tested these instructions in Catalina
@ -108,7 +111,7 @@ You can install RAPIDS using Docker (the fastest), or native instructions for Ma
=== "Ubuntu" === "Ubuntu"
We tested on Ubuntu 18.04 & 20.04 We tested RAPIDS on Ubuntu 18.04 & 20.04. Note that the necessary Python and R packages are available in other Linux distributions, so if you decide to give it a try, let us know and we can update these docs.
1. Install dependencies 1. Install dependencies
@ -133,15 +136,17 @@ You can install RAPIDS using Docker (the fastest), or native instructions for Ma
4. Add R's repository 4. Add R's repository
1. For 18.04 === "Ubuntu 18.04 Bionic"
``` bash
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'
```
1. For 20.04 ``` bash
``` bash sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' ```
```
=== "Ubuntu 20.04 Focal"
``` bash
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
```
5. Install R 4.0. If you have other instances of R, we recommend uninstalling them 5. Install R 4.0. If you have other instances of R, we recommend uninstalling them
@ -181,14 +186,35 @@ You can install RAPIDS using Docker (the fastest), or native instructions for Ma
conda activate MY_ENV_NAME conda activate MY_ENV_NAME
``` ```
7. Install R packages and virtual environment: 7. Install the R virtual environment management package (renv)
``` bash ``` bash
snakemake -j1 renv_install snakemake -j1 renv_install
snakemake -j1 renv_restore
``` ```
8. Restore the R virtual environment
=== "Ubuntu 18.04 Bionic (fast)"
Run the following command to restore the R virtual environment using [RSPM](https://packagemanager.rstudio.com/client/#/repos/1/overview) binaries
```bash
R -e 'renv::restore(repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/bionic/latest"))'
```
=== "Ubuntu 20.04 Focal (fast)"
Run the following command to restore the R virtual environment using [RSPM](https://packagemanager.rstudio.com/client/#/repos/1/overview) binaries
```bash
R -e 'renv::restore(repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/focal/latest"))'
```
=== "Ubuntu (slow)"
If the fast installation command failed for some reason, you can restore the R virtual environment from source:
```bash
R -e 'renv::restore()'
```
!!! note !!! note
This step could take several minutes to complete, especially if you have less than 3Gb of RAM or packages need to be compiled from source. Please be patient and let it run until completion. This step could take several minutes to complete, especially if you have less than 3Gb of RAM or packages need to be compiled from source. Please be patient and let it run until completion.
@ -201,3 +227,11 @@ You can install RAPIDS using Docker (the fastest), or native instructions for Ma
``` bash ``` bash
./rapids -j1 ./rapids -j1
``` ```
=== "Windows"
There are several options varying in complexity:
- You can use our Docker instructions (tested)
- You can use our Ubuntu 20.04 instructions on [WSL2](https://docs.microsoft.com/en-us/windows/wsl/install-win10) (not tested but it will likely work)
- Native installation (experimental). If you would like to contribute to RAPIDS you could try to install MySQL, miniconda, Python, and R 4.0+ in Windows and restore the Python and R virtual environments using steps 6 and 7 of the instructions for Mac. You can [get in touch](../../team) if you would like to discuss this with the team.