From 0a2fa5804ae2109e93b02646313c6c58b5d2a379 Mon Sep 17 00:00:00 2001 From: kaguillera Date: Fri, 5 Jun 2020 16:09:21 -0400 Subject: [PATCH] Updated the install instructions for Ubuntu 18.04 --- .gitignore | 1 + docs/features/extracted.rst | 2 +- docs/usage/faq.rst | 93 +++++++++++++++++++++++++++++++++++++ docs/usage/installation.rst | 44 +++++++++++++----- docs/usage/quick_rule.rst | 1 + tests/.gitignore | 0 6 files changed, 128 insertions(+), 13 deletions(-) create mode 100644 tests/.gitignore diff --git a/.gitignore b/.gitignore index 30beeb9f..23992747 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,4 @@ reports/ .Rhistory sn_profile_*/ settings.dcf +tests/fakedata_generation/ \ No newline at end of file diff --git a/docs/features/extracted.rst b/docs/features/extracted.rst index 0ba4b2f4..1d29625a 100644 --- a/docs/features/extracted.rst +++ b/docs/features/extracted.rst @@ -749,7 +749,7 @@ The differences between both API versions are: - Unified level of sleep. For intraday data, we unify sleep levels of each sleep record with a column named "unified_level". Based on `this Fitbit forum post`_ , we merge levels into two categories: - For the "classic" type: unified_level is one of {0, 1} where 0 means awake and groups "awake" + "restless", while 1 means asleep and groups "asleep". - For the "stages" type, unified_level is one of {0, 1} where 0 means awake and groups "wake" while 1 means asleep and groups "deep" + "light" + "rem". - - Short Data. In `v1.2`, records of type "stages" contain "shortData_" in addition to "data". We merge "data" part and "shortData" part to extract intraday data. + - Short Data. In `v1.2`, records of type "stages" contain "shortData" in addition to "data". We merge "data" part and "shortData" part to extract intraday data. - The "data" grouping displays the sleep stages and any wake periods > 3 minutes (180 seconds). - The "shortData" grouping displays the short wake periods representing physiological awakenings that are <= 3 minutes (180 seconds). - The following columns of Summary data are not computed by RAPIDS but taken directly from columns with a similar name provided by the API: `efficiency`, `minutes_after_wakeup`, `minutes_asleep`, `minutes_awake`, `minutes_to_fall_asleep`, `minutes_in_bed`, `is_main_sleep` and `type` diff --git a/docs/usage/faq.rst b/docs/usage/faq.rst index 590e1717..826fb26f 100644 --- a/docs/usage/faq.rst +++ b/docs/usage/faq.rst @@ -26,16 +26,20 @@ Frequently Asked Questions Please make sure the ``MY_GROUP`` in ``config.yaml`` and ``.env`` match. + + 2. Cannot start mysql in linux via ``brew services start mysql`` """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" use the following command instead: ``mysql.server start`` + 3. Every time I run ``snakemake -R download_dataset`` all rules are executed """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This is expected behavior. The advantage of using ``snakemake`` under the hood is that every time a file containing data is modified every rule that depends on that file will be re-executed to update their results. In this case, since ``download_dataset`` updates all the raw data, and you are forcing the rule with the flag ``-R`` every single rule that depends on those raw files will be executed. + 4. Got an error ``Table XXX doesn't exist`` while running the download_dataset rule. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" :: @@ -47,3 +51,92 @@ This is expected behavior. The advantage of using ``snakemake`` under the hood i **Solution:** Please make sure the sensors listed in SENSORS in ``config.yaml`` match your database tables. + + + +5. How do I install on Ubuntu 16.04 +"""""""""""""""""""""""""""""""""""" + +#. Install dependencies (Homebrew - if not installed): + + - ``sudo apt-get install libmariadb-client-lgpl-dev libxml2-dev libssl-dev`` + - Install brew_ for linux and add the following line to ~/.bashrc: ``export PATH=$HOME/.linuxbrew/bin:$PATH`` + - ``source ~/.bashrc`` + +#. Install MySQL + + - ``brew install mysql`` + - ``brew services start mysql`` + +#. Install R, pandoc and rmarkdown: + + - ``brew install r`` + - ``brew install gcc@6`` (needed due to this bug_) + - ``HOMEBREW_CC=gcc-6 brew install pandoc`` + +#. Install miniconda using these instructions_ + +#. 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 R packages and virtual environment: + + - ``snakemake renv_install`` + - ``snakemake renv_init`` + - ``snakemake renv_restore`` + - This step could take several minutes to complete. Please be patient and let it run until completion. + +#. See :ref:`Usage section `. + + + +6. Configuration failed for package ``RMySQL`` +"""""""""""""""""""""""""""""""""""""""""""""""" +:: + + --------------------------[ ERROR MESSAGE ]---------------------------- + :1:10: fatal error: mysql.h: No such file or directory + compilation terminated. + ----------------------------------------------------------------------- + ERROR: configuration failed for package 'RMySQL' + +sudo apt install libmariadbclient-dev + + + +7. No package ``libcurl`` found +""""""""""""""""""""""""""""""""" + +The ``libcurl`` needs to installed using the following command + +``sudo apt install libcurl4-openssl-dev`` + + + +8. Configuration failed because ``openssl`` was not found. +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Install the ``openssl`` library using the following command + +``sudo apt install libssl-dev`` + + +9. Configuration failed because ``libxml-2.0`` was not found +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Install the ``xml`` library using the following command + +``sudo apt install libxml2-dev`` + +.. ------------------------ Links --------------------------- .. + +.. _bug: https://github.com/Homebrew/linuxbrew-core/issues/17812 +.. _instructions: https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html +.. _brew: https://docs.brew.sh/Homebrew-on-Linux diff --git a/docs/usage/installation.rst b/docs/usage/installation.rst index 0c543975..d0b93947 100644 --- a/docs/usage/installation.rst +++ b/docs/usage/installation.rst @@ -48,27 +48,46 @@ macOS (tested on Catalina 10.15) #. See Usage section below. -Linux (tested on Ubuntu 16.04) +Linux (tested on Ubuntu 18.04) ------------------------------ -#. Install dependencies (Homebrew - if not installed): +#. Install dependencies : - - ``sudo apt-get install libmariadb-client-lgpl-dev libxml2-dev libssl-dev`` - - Install brew_ for linux and add the following line to ~/.bashrc: ``export PATH=$HOME/.linuxbrew/bin:$PATH`` + - ``sudo apt install libcurl4-openssl-dev`` + - ``sudo apt install libssl-dev`` + - ``sudo apt install libxml2-dev`` + + (Homebrew - if not installed) + + - Install brew_ for linux + - add the following line to ~/.bashrc: ``export PATH=$HOME/.linuxbrew/bin:$PATH`` - ``source ~/.bashrc`` #. Install MySQL - - ``brew install mysql`` - - ``brew services start mysql`` + - ``sudo apt install-mysql`` + - ``sudo apt install libmariadbclient-dev`` + - (OPTIONAL) ``sudo apt install mysql-server`` -#. Install R, pandoc and rmarkdown: - - ``brew install r`` - - ``brew install gcc@6`` (needed due to this bug_) - - ``HOMEBREW_CC=gcc-6 brew install pandoc`` +#. Install R -#. Install miniconda using these instructions_ + - ``sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9`` + - ``sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'`` + - ``sudo apt update`` + - ``sudo apt install r-base`` + +#. Install PANDOC + + - ``sudo apt install pandoc`` + +#. Install GIT + + - ``sudo apt install git`` + +#. Install miniconda using these instructions_ + +#. Restart your current shell #. Clone our repo: @@ -83,13 +102,14 @@ Linux (tested on Ubuntu 16.04) #. Install R packages and virtual environment: - ``snakemake renv_install`` - - ``snakemake renv_init`` - ``snakemake renv_restore`` - This step could take several minutes to complete. Please be patient and let it run until completion. #. See Usage section below. +.. _usage-section: + Usage ====== Once RAPIDS is installed, follow these steps to start processing mobile data. diff --git a/docs/usage/quick_rule.rst b/docs/usage/quick_rule.rst index 67dcb436..67063890 100644 --- a/docs/usage/quick_rule.rst +++ b/docs/usage/quick_rule.rst @@ -1,4 +1,5 @@ .. _minimal-working-example: + Minimal Working Example ======================= diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 00000000..e69de29b