Obsolete:Bingle
Due to Wikimedia's move to Phabricator this page is outdated and only kept for historical reasons. |
Bingle and Bugello are tools for piping incoming bugs reported in Bugzilla to Mingle and Trello (respectively).
Source code for Bingle/Bugello
https://github.com/awjrichards/bingle
Bingle
Bingle is used by the mobile web team, analytics (Diedierik), Flow (spage), ...
To log in, ssh to tools-login.wmflabs.org and:
$ become bingle
Source code is in:
~/code
This is just a checkout from the above github repo.
Note that there's a third-party python library, feedparser, that's installed in ~/lib/python and there's a custom PYTHONPATH to make sure this works:
local-bingle@tools-login:~$ cat ~/.bashrc
export PYTHONPATH=/data/project/bingle/lib/python/
Here's the current crontab:
local-bingle@tools-login:~$ crontab -l
*/5 * * * * /usr/local/bin/jsub -once -N bingle /data/project/bingle/bin/bingle
jsub is a job submission script. -N bingle
names the job, and the executable it runs is ~/bin/bingle:
local-bingle@tools-login:~$ cat bin/bingle
export PYTHONPATH=/data/project/bingle/lib/python/
python /data/project/bingle/code/bingle/bingle.py \
--config=/data/project/bingle/var/bingle/bingle.ini \
>> /data/project/bingle/var/bingle/bingle.log
2>> /data/project/bingle/var/bingle/bingle.err
As you can see from the script, it runs the bingle python script, directing it to use Bingle config and log files in ~/var/bingle
- bingle.ini has configuration directives
- bingle.log is a runtime log (debug is enabled, so it should be quite verbose)
- bingle.err is an error log (it currently has a lot of errors about timeouts from Mingle - this is kinda normal and not a big deal)
If things start going weird (e.g. bingle starts adding the same bug over and over again to Mingle), just disable the cronjob - and if you're feeling up for it, use the above info to debug.
Adding jobs
Analytics and Flow have added cron jobs that run ~/bin/bingle-anotherProject bash scripts which point at different directories in ~/var containing their own .ini and log files.
Bugello
Bugello is set up *very* similarly to Bingle. Dan Foy and Tomasz Finc are the product owners for the projects using Bugello. If something happens, be sure to contact them.
To log in, ssh to tools labs and:
$ become bugello
Source code is in:
~/code
This is just a checkout from the above github repo.
Note that there's a third party python library, feedparser, that's installed in ~/lib/python and there's a custom PYTHONPATH to make sure this works:
local-bugello@tools-login:~$ cat ~/.bashrc
export PYTHONPATH=/data/project/bugello/lib/python/
There's are two executables in ~/bin - one for the apps-specific instance, and one for the partners-specific instance:
local-bugello@tools-login:~$ ls bin
bugello_apps bugello_partners
Each executable is basically the same, but each points to different configs and log files:
local-bugello@tools-login:~$ cat ~/bin/bugello_apps
export PYTHONPATH=/data/project/bugello/lib/python/
python /data/project/bugello/code/bingle/bugello.py --config=/data/project/bugello/var/bingle/bugello_apps.ini >> /data/project/bugello/var/bingle/bugello_apps.log 2>> /data/project/bugello/var/bingle/bugello_apps.err
Partners is the same - just s/apps/partners/g
Here's the crontab:
local-bugello@tools-login:~$ crontab -l
- /5 * * * * /usr/local/bin/jsub -once -N bugello /data/project/bugello/bin/bugello_apps
- /5 * * * * /usr/local/bin/jsub -once -N bugello /data/project/bugello/bin/bugello_partners
Bugello config and logs can be found in ~/var/bingle:
local-bugello@tools-login:~$ ls var/bingle/ | grep -v pickle
bugello_apps.err
bugello_apps.ini
bugello_apps.log
bugello_partners.err
bugello_partners.ini
bugello_partners.log
Note the .pickle files are for locally storing data about the last time Bugello ran.
If things start going weird (eg Bugello starts adding the same bug over and over again to Trello), just disable the cronjob - and if you're feeling up for it, use the above info to debug.