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 fromrun_time_config.json
. It then usesHANDLERS_BY_EXCHANGE
, a dictionary defined inconfig.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 topicbuildbot.#.backfill
. It calls mozci'smanual_backfill
with the appropriate input. - backfilling: listens to
exchange/build/normalized
with topicunittest.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'strigger_missing_jobs
ortrigger_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.