From 9418e6e936005259a9779cec2746168105aad9da Mon Sep 17 00:00:00 2001 From: JulioV Date: Tue, 5 Jan 2021 18:36:19 -0500 Subject: [PATCH 1/4] Update docker and linux instructions to use RSPM binary repo for for faster installation --- Dockerfile | 3 +- docs/setup/installation.md | 62 +++++++++++++++++++++++++++++--------- 2 files changed, 50 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3bb4b72e..9ac108ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,7 @@ RUN apt update && apt install -y r-base RUN apt install -y pandoc RUN apt install -y git 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 ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 ENV PATH /opt/conda/bin:$PATH @@ -42,7 +43,7 @@ RUN conda update -n base -c defaults conda WORKDIR /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 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 RUN mv data/external/download data/external/rapids_example.sql.zip RUN unzip data/external/rapids_example.sql.zip diff --git a/docs/setup/installation.md b/docs/setup/installation.md index feccc2cc..a619d17e 100644 --- a/docs/setup/installation.md +++ b/docs/setup/installation.md @@ -1,6 +1,6 @@ # 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" @@ -8,7 +8,7 @@ You can install RAPIDS using Docker (the fastest), or native instructions for Ma 2. Pull our RAPIDS container ``` bash - docker pull moshiresearch/rapids:latest` + docker pull moshiresearch/rapids:latest ``` 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 - 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" We tested these instructions in Catalina @@ -108,7 +111,7 @@ You can install RAPIDS using Docker (the fastest), or native instructions for Ma === "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 @@ -133,15 +136,17 @@ You can install RAPIDS using Docker (the fastest), or native instructions for Ma 4. Add R's repository - 1. For 18.04 - ``` bash - sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/' - ``` + === "Ubuntu 18.04 Bionic" - 1. For 20.04 - ``` bash - sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' - ``` + ``` bash + sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-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 @@ -181,14 +186,35 @@ You can install RAPIDS using Docker (the fastest), or native instructions for Ma conda activate MY_ENV_NAME ``` - 7. Install R packages and virtual environment: + 7. Install the R virtual environment management package (renv) ``` bash 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 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 ./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. From f521d45b4206c5f0b07e0ca82d84c6c7eb72c64b Mon Sep 17 00:00:00 2001 From: JulioV Date: Tue, 5 Jan 2021 18:36:33 -0500 Subject: [PATCH 2/4] Update CI to create a release on a tagged push that passes the tests --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ca60883c..2c54cf33 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -72,7 +72,7 @@ jobs: id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + GITHUB_TOKEN: ${{ secrets.RAPIDS_RELEASES_TOKEN }} # This token is provided by Actions, you do not need to create your own token with: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} From f6e66a43f067f527d058239691dfe9c9a647be95 Mon Sep 17 00:00:00 2001 From: JulioV Date: Tue, 5 Jan 2021 18:36:55 -0500 Subject: [PATCH 3/4] Clarify in DB credential configuration that we only support MySQL --- docs/setup/configuration.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/setup/configuration.md b/docs/setup/configuration.md index e997854f..5f3126b9 100644 --- a/docs/setup/configuration.md +++ b/docs/setup/configuration.md @@ -37,9 +37,10 @@ When you are done with this configuration, go to [executing RAPIDS](../execution MY_GROUP ``` !!! hint - If you are using RAPIDS' docker container and Docker-for-mac or Docker-for-Windows 18.03+, connect to your MySQL database using the host `host.docker.internal` instead of `127.0.0.1` + If you are using RAPIDS' docker container and Docker-for-mac or Docker-for-Windows 18.03+, you can connect to a MySQL database in your host machine using the `host.docker.internal` instead of `127.0.0.1` or `localhost` !!! note - You can ignore this step if you are only processing Fitbit data in CSV files. + - You can ignore this step if you are only processing Fitbit data in CSV files. + - RAPIDS only supports MySQL/MariaDB databases. If you would like to add support for a different database engine get in touch and we can discuss how to implement it. --- ## Timezone of your study From aaa9ad22a21cdb8c9fa036d1c79a615ca2912874 Mon Sep 17 00:00:00 2001 From: JulioV Date: Tue, 5 Jan 2021 18:37:21 -0500 Subject: [PATCH 4/4] Update changelog --- docs/change-log.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/change-log.md b/docs/change-log.md index ef7e79bb..54619c71 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -1,5 +1,10 @@ # Change Log +## Next version v0.3.2 +- Update docker and linux instructions to use RSPM binary repo for for faster installation +- Update CI to create a release on a tagged push that passes the tests +- Clarify in DB credential configuration that we only support MySQL +- Add Windows installation instructions ## v0.3.1 - Update installation docs for RAPIDS' docker container - Fix example analysis use of accelerometer data in a plot