This repository has been archived by the owner. It is now read-only.
Listen to pulse messages and take actions from them
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.heroku/vendor/lib
configs
data
pulse_actions
.gitignore
.travis.yml
LICENSE
MANIFEST.in
Procfile
README.rst
hello_world.md
requirements.txt
setup.py
tox.ini

README.rst

End of life

Further development of this project has ended. Thanks for all your contributions!

See https://bugzilla.mozilla.org/show_bug.cgi?id=1379172 for details.


Travis-CI Build Status Requirements Status

Pulse Actions

This project is a Pulse listener that connects different parts of Mozilla with Mozilla CI Tools. See the wiki for more details.

How it works

  • worker.py reads exchange and topic from run_time_config.json. It then uses HANDLERS_BY_EXCHANGE, a dictionary defined in config.py to decide what function it will use to handle incoming messages.
  • The functions to deal with every case are defined in the handlers module.
  • When multiple topics are passed, we use the route_functions.py to decide which function to call

Existing modes

  • manual_backfill: listens to exchange/treeherder/v1/job-actions with topic buildbot.#.backfill. It calls mozci's manual_backfill with the appropriate input.
  • backfilling: listens to exchange/build/normalized with topic unittest.mozilla-inbound.#. It automatically backfills failed jobs. Progress in being tracked on bug 1180732
  • resulset_actions: listens to exchange/treeherder/v1/resultset-actions. It calls mozci's trigger_missing_jobs or trigger_all_talos_jobs depending on the message.

Installing

From GitHub:

git clone https://github.com/mozilla/pulse_actions.git
cd pulse_actions
python setup.py develop

From Pypi:

pip install pulse-actions

Replaying sample data

You can have re-process sample data from real requests to re-test any new changes:

python pulse_actions/worker.py --replay-file data/sample_queue.json

Running

First you'll have to create a pulse user in https://pulseguardian.mozilla.org . After that, you should set the PULSE_USER and PULSE_PW environment variables accordingly.

If you installed with Pypi:

If you installed inside a virtualenv (called venv in this example):

venv/bin/run-pulse-actions

If you installed globally (not recommended):

run-pulse-actions

If you cloned the repo:

From the base folder of repository, run:

python pulse_actions/worker.py --topic-base MODE

Where MODE is a comma-separated list of the modes you in which you wish to run. You can see some commands in Procfile.

Adding more functionality

Pulse Actions can be expanded to add more functionality. Here is a step-by-step guide for creating a "Hello World" client with pulse_actions.