3.6.2. Starting Open edX Analytics Devstack

This section describes how to start the Open edX Analytics developer stack (analytics devstack).

3.6.2.1. Starting the Open edX LMS

  1. Log in to analytics devstack.

    $ vagrant ssh
    
  2. Switch to the edxapp user.

    $ sudo su edxapp
    
  3. Start the LMS.

    $ paver devstack lms
    

3.6.2.2. Starting the Open edX Analytics Data API

  1. Log in to analytics devstack.

    $ vagrant ssh
    
  2. Switch to the analytics_api user.

    $ sudo su analytics_api
    
  3. Start the Data API.

    $ ~/venvs/analytics_api/bin/python ~/analytics_api/manage.py runserver 0.0.0.0:8100 --insecure
    

3.6.2.3. Starting Open edX Insights

  1. Log in to analytics devstack.

    $ vagrant ssh
    
  2. Switch to the insights user.

    $ sudo su insights
    
  3. Enable features that are disabled by default.

    $ ~/venvs/insights/bin/python ~/edx_analytics_dashboard/manage.py switch display_verified_enrollment on --create
    $ ~/venvs/insights/bin/python ~/edx_analytics_dashboard/manage.py switch enable_course_api on --create
    

    For a complete list of the waffle switches that are available, see Feature Gating.

  4. Start Insights.

    $ ~/venvs/insights/bin/python ~/edx_analytics_dashboard/manage.py runserver 0.0.0.0:8110 --insecure
    
  5. Open the URL http://127.0.0.1:8110 in a browser on the host.

    Important

    Be sure to use the IP address 127.0.0.1 instead of localhost. Using localhost will prevent you from logging in.

3.6.2.4. Starting the Open edX Analytics Pipeline

  1. In the Devstack LMS, register a new user and enroll in the demo course.

  2. Navigate to the course body and submit answers to a few problems.

  3. Navigate to the location where edx-analytics-pipeline project was cloned on the host.

    $ cd edx-analytics-pipeline
    
  4. Run the enrollment task.

    $ export WHEEL_URL=http://edx-wheelhouse.s3-website-us-east-1.amazonaws.com/Ubuntu/precise
    # On Mac OS X replace the date command below with $(date -v+1d +%Y-%m-%d)
    $ remote-task --vagrant-path <path to `analyticstack`> --remote-name devstack --override-config ${PWD}/config/devstack.cfg --wheel-url $WHEEL_URL --wait \
       ImportEnrollmentsIntoMysql --local-scheduler --interval-end $(date +%Y-%m-%d -d "tomorrow") --n-reduce-tasks 1
    
  5. Run the answer distribution task.

    $ export WHEEL_URL=http://edx-wheelhouse.s3-website-us-east-1.amazonaws.com/Ubuntu/precise
    $ export UNIQUE_NAME=$(date +%Y-%m-%dT%H_%M_%SZ)
    $ remote-task --vagrant-path <path to `analyticstack`> --remote-name devstack --override-config ${PWD}/config/devstack.cfg --wheel-url $WHEEL_URL --wait \
        AnswerDistributionWorkflow --local-scheduler \
          --src hdfs://localhost:9000/data/ \
          --include '*tracking.log*' \
          --dest hdfs://localhost:9000/edx-analytics-pipeline/output/answer_distribution_raw/$UNIQUE_NAME/data \
          --name $UNIQUE_NAME \
          --output-root hdfs://localhost:9000/edx-analytics-pipeline/output/answer_distribution/ \
          --marker hdfs://localhost:9000/edx-analytics-pipeline/output/answer_distribution_raw/$UNIQUE_NAME/marker \
          --n-reduce-tasks 1