Installation¶
You can install RAPIDS using Docker (the fastest), or native instructions for MacOS and Linux (Ubuntu). Windows is supported through Docker or WSL.
-
Install Docker
-
Pull our RAPIDS container
docker pull moshiresearch/rapids:latest
-
Run RAPIDS' container (after this step is done you should see a prompt in the main RAPIDS folder with its python environment active)
docker run -it moshiresearch/rapids:latest
-
Pull the latest version of RAPIDS
git pull
-
Make RAPIDS script executable
chmod +x rapids
-
Check that RAPIDS is working
./rapids -j1
-
Optional. You can edit RAPIDS files with
vim
but we recommend usingVisual Studio Code
and itsRemote Containers
extensionHow to configure Remote Containers extension
- Make sure RAPIDS container is running
- Install the Remote - Containers extension
- Go to the
Remote Explorer
panel on the left hand sidebar - On the top right dropdown menu choose
Containers
- Double click on the
moshiresearch/rapids
container in theCONTAINERS
tree - A new VS Code session should open on RAPIDS main folder inside the container.
- Make sure RAPIDS container is running
We tested these instructions in Catalina and Big Sur
M1 Macs
RAPIDS can run on M1 Macs, the only changes as of Feb 21, 2021 are:
- R needs to be installed via brew under Rosetta (x86 arch) due to incompatibility issues with some R libraries. To do this, run your terminal via Rosetta, then proceed with the usual brew installation command. Use x86 brew to install R and restore RAPIDS’ packages (
snakemake -j1 renv_install & snakemake -j1 renv_restore
). - There is a bug related to timezone codes. We set the correct
TZ_DIR
inrenv/activate.R
(line #19)Sys.setenv("TZDIR" = file.path(R.home(), "share", "zoneinfo"))
(RAPIDS does this automatically).
-
Install brew
-
Install MySQL
brew install mysql brew services start mysql
-
Install R 4.0, pandoc and rmarkdown. If you have other instances of R, we recommend uninstalling them
brew install r brew install pandoc Rscript --vanilla -e 'install.packages("rmarkdown", repos="http://cran.us.r-project.org")'
-
Install miniconda (restart your terminal afterwards)
brew cask install miniconda conda init zsh # (or conda init bash)
-
Clone our repo
git clone https://github.com/carissalow/rapids
-
Create a python virtual environment
cd rapids conda env create -f environment.yml -n rapids conda activate rapids
-
Install R packages and virtual environment:
snakemake -j1 renv_install snakemake -j1 renv_restore
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.
-
Make RAPIDS script executable
chmod +x rapids
-
Check that RAPIDS is working
./rapids -j1
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.
-
Install dependencies
sudo apt install libcurl4-openssl-dev sudo apt install libssl-dev sudo apt install libxml2-dev sudo apt install libglpk40
-
Install MySQL
sudo apt install libmysqlclient-dev sudo apt install mysql-server
-
Add key for R’s repository.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
-
Add R’s repository
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/'
-
Install R 4.0. If you have other instances of R, we recommend uninstalling them
sudo apt update sudo apt install r-base
-
Install Pandoc and rmarkdown
sudo apt install pandoc Rscript --vanilla -e 'install.packages("rmarkdown", repos="http://cran.us.r-project.org")'
-
Install git
sudo apt install git
-
Install miniconda
-
Restart your current shell
-
Clone our repo:
git clone https://github.com/carissalow/rapids
-
Create a python virtual environment:
cd rapids conda env create -f environment.yml -n MY_ENV_NAME conda activate MY_ENV_NAME
-
Install the R virtual environment management package (renv)
snakemake -j1 renv_install
-
Restore the R virtual environment
Run the following command to restore the R virtual environment using RSPM binaries
R -e 'renv::restore(repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/bionic/latest"))'
Run the following command to restore the R virtual environment using RSPM binaries
R -e 'renv::restore(repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/focal/latest"))'
If the fast installation command failed for some reason, you can restore the R virtual environment from source:
R -e 'renv::restore()'
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.
-
Make RAPIDS script executable
chmod +x rapids
-
Check that RAPIDS is working
./rapids -j1
There are several options varying in complexity:
- You can use our Docker instructions (tested)
- You can use our Ubuntu 20.04 instructions on WSL2 (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 if you would like to discuss this with the team.