Skip to content

theharshest/alert_manager

 
 

Repository files navigation

alert_manager

Manage Mozilla performance alerts generated by talos.

Installation

The production alert_manager server is running on Ubuntu, so this is probably the easiest environment in which to get things running, but other distributions of linux should be fine as well. We use Apache on the production server, but alert_manager will run standalone for testing as well.

Virtual environment (Optional):

It's generally a good idea to create new virtual environment for each project that you work on to not mess up with dependencies. You can install virtualenv with pip. Virtualenvwrapper provides nice commandline interface over virtualenv.

For instance, you can create new virtual environment with virtualenvwrapper like this:

mkvirtualenv alert_manager

Installing dependencies (Required):

The easiest way to install all required dependencies is to use pip.

If you don't have pip installed, fix this by issuing following command:

sudo easy_install pip

Now, when you got pip, run this command to get packages:

pip install -r requirements.txt

If you don't want to use pip, you can check list of project dependencies in requirements.txt file and install them in your preferred way.

Pre-commit hook (Optional):

To enforce Python code style and avoid silly errors in your Python code, you can set up git pre-commit hook, that will run checks on Python code you want to commit.

ln -s ../../pre-commit.sh .git/hooks/pre-commit

In case you won't deal with found errors, you still can commit by issuing:

git commit --no-verify

Settings (For parse_news.py):

Alert manager supports environment-based settings. To enable your own development settings you need to:

  1. create local_settings/development.py file (just rename template file)

  2. populate it with your settings

  3. export TARGET_ENVIRONMENT=development

Creating an config.ini file

The alert_manager uses a config.ini file to store identification and options. You can create a default config.ini file by running:

python config.py

Change the username and password for the database as required.

You will also either need a subscription to the mozilla.dev.tree-management newsgroup, or make use of the sample data packaged in the sample folder.

Database configuration:

Database setup and configuration scripts can all be found in tests/resources/scripts. There are scripts for scrubbing and extracting the production database, plus scripts for making a test database.

To create a test database for your dev machine

python tests/resources/scripts/create_db.py

it uses your config.ini file to find AND REPLACE the schema with test data.

The database is populated by an instance of (datazilla-alerts)[https://github.com/klahnakoski/datazilla-alerts], which is a whole other project.

Start the app

Start the application:

python server.py

You should see alert_manager running at http://localhost:8159/alerts.html.

About

manage mozilla performance alerts generated by talos

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published