<commit_before>.. index:: install-src-dev

.. _install_from_source-chapter:

Installing from source
======================

Setting up environment
----------------------

You may need to run this as the *root* user depending on how node.js was 
installed
::
  which lessc
  # if you do not have this installed then run:
  npm install -g less


Socorro can install the dependencies into a virtualenv for you.
You only need to run this once
::
  export PATH=$PATH:/usr/pgsql-9.3/bin/
  make bootstrap

Before running any Socorro components, always make sure that the virtualenv 
is activated and the PYTHONPATH is set
::
  . socorro-virtualenv/bin/activate
  export PYTHONPATH=.

Or you can choose to manage the virtualenv yourself, perhaps using
virtualenwrapper.

Run unit/functional tests
-------------------------

From inside the Socorro checkout
::
  make test database_username=test database_password=<PASSWORD>


Install stackwalker
-------------------

This is the binary which processes breakpad crash dumps into stack traces.
You must build it with GCC 4.6 or above.

If you are using RHEL/CentOS and installed GCC from the devtoolset repo
(per the installation instructions), make sure to "activate" it:
::
  scl enable devtoolset-1.1 bash

Then compile breakpad and the stackwalker binary:
::
  make stackwalker

Populate PostgreSQL Database
----------------------------

Load Socorro schema plus test products:
::
  ./socorro/external/postgresql/setupdb_app.py --database_name=breakpad \
    --fakedata --dropdb

Create partitioned tables
-------------------------

Normally this is handled automatically by the cronjob scheduler
:ref:`crontabber-chapter` but can be run as a one-off:
::
  python socorro/cron/crontabber_app.py --job=weekly-reports-partitions --force
<commit_msg>Revert "Update documentation referencing breakpad target"<commit_after>.. index:: install-src-dev

.. _install_from_source-chapter:

Installing from source
======================

Setting up environment
----------------------

You may need to run this as the *root* user depending on how node.js was 
installed
::
  which lessc
  # if you do not have this installed then run:
  npm install -g less


Socorro can install the dependencies into a virtualenv for you.
You only need to run this once
::
  export PATH=$PATH:/usr/pgsql-9.3/bin/
  make bootstrap

Before running any Socorro components, always make sure that the virtualenv 
is activated and the PYTHONPATH is set
::
  . socorro-virtualenv/bin/activate
  export PYTHONPATH=.

Or you can choose to manage the virtualenv yourself, perhaps using
virtualenwrapper.

Run unit/functional tests
-------------------------

From inside the Socorro checkout
::
  make test database_username=test database_password=<PASSWORD>


Install stackwalker
-------------------

This is the binary which processes breakpad crash dumps into stack traces.
You must build it with GCC 4.6 or above.

If you are using RHEL/CentOS and installed GCC from the devtoolset repo
(per the installation instructions), make sure to "activate" it:
::
  scl enable devtoolset-1.1 bash

Then compile breakpad and the stackwalker binary:
::
  make breakpad stackwalker

Populate PostgreSQL Database
----------------------------

Load Socorro schema plus test products:
::
  ./socorro/external/postgresql/setupdb_app.py --database_name=breakpad \
    --fakedata --dropdb

Create partitioned tables
-------------------------

Normally this is handled automatically by the cronjob scheduler
:ref:`crontabber-chapter` but can be run as a one-off:
::
  python socorro/cron/crontabber_app.py --job=weekly-reports-partitions --force

{'fraction_non_alphanumeric': 0.1352763266428375, 'fraction_numerical': 0.003299422601044817, 'mean_word_length': 3.101465614430665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5884091', 'n_tokens_mistral': 1054, 'n_tokens_neox': 982, 'n_words': 408}