Skip to content

manage mozilla performance alerts generated by talos

License

Notifications You must be signed in to change notification settings

tb123/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:

Create the MySQL database using the schema.sql script as follows, where the specified username matches the one in config.ini:

mysql --user <username> --password < schema.sql

This will create a database called alerts, with a single table, also called alerts. You can use the parse_news.py script to populate the database if you wish, but sample data is also included in the sample folder. To use it:

cd sample
bunzip2 july_alerts.sql.bz2
mysql --user <username> --password --database alerts < july_alerts.sql

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

Languages

  • JavaScript 81.3%
  • Python 13.3%
  • CSS 5.2%
  • Shell 0.2%