Obsolete:Grrrit-wm: Difference between revisions

From Wikitech
Content deleted Content added
No edit summary
Line 35: Line 35:
local$ ssh yourusername@tools-login.wmflabs.org
local$ ssh yourusername@tools-login.wmflabs.org
yourusername@tools-login:~$ become lolrrit-wm
yourusername@tools-login:~$ become lolrrit-wm
local-lolrrit-wm@tools-login:~$ qmod -rj lolrrit-wm
Pushed rescheduling of job 8191014 on host tools-exec-13.eqiad.wmflabs

# if you get an error instead, re-start the job using
local-lolrrit-wm@tools-login:~$ ./lolrrit-wm/src/kick.bash
local-lolrrit-wm@tools-login:~$ ./lolrrit-wm/src/kick.bash
local-lolrrit-wm has registered the job XXXXXX for deletion
Your job XXXXXX ("lolrrit-wm") has been submitted
Your job XXXXXX ("lolrrit-wm") has been submitted

# if you get
# local-lolrrit-wm has registered the job XXXXXX for deletion
# instead, wait until `qstat` doesn't show lolrrit-wm anymore, then run kick.bash again
</pre>
</pre>



Revision as of 10:52, 17 February 2015

grrrit-wm is an IRC bot that listens to events from Gerrit and reports them on various IRC channels; it replaces gerrit-wm.

Which repo changes report to which channels can be configured in config.yaml [1]; it defaults to #wikimedia-dev, see mw:MediaWiki on IRC.

It is built to run on Tool Labs, and is dependent on a Redis queue populated by the stream receiver script that is part of SuchABot.

Running it

This is designed to run on the Grid Engine available on Tool Labs as a continuous task. There is a convenience script kick.bash to start the task on the Grid Engine.

Config changes

To add more repo -> channel mappings, edit config.yaml. The repo names can be matched using regexen. The tool needs to be restarted on SGE for the changes to take effect - see the deploying and restarting sections for more.

Deploying

Get your changes into master (i.e. merge them) through Gerrit.

local$ ssh yourusername@tools-login.wmflabs.org
yourusername@tools-login$ become lolrrit-wm
local-lolrrit-wm@tools-login:~$ cd lolrrit-wm/
local-lolrrit-wm@tools-login:~$ git fetch --all
local-lolrrit-wm@tools-login:~$ git reset --hard gerrit/master
local-lolrrit-wm@tools-login:~$ git cherry-pick auth
local-lolrrit-wm@tools-login:~$ git log # make sure your changes made it in and that the password commit is on top of it

Then the bot needs to be restarted. (see below)

Restarting the bot

Grrrit-wm is managed by Bigbrother, so manual restarts should not be necessary
local$ ssh yourusername@tools-login.wmflabs.org
yourusername@tools-login:~$ become lolrrit-wm
local-lolrrit-wm@tools-login:~$ qmod -rj lolrrit-wm
Pushed rescheduling of job 8191014 on host tools-exec-13.eqiad.wmflabs

# if you get an error instead, re-start the job using
local-lolrrit-wm@tools-login:~$ ./lolrrit-wm/src/kick.bash 
Your job XXXXXX ("lolrrit-wm") has been submitted

# if you get
#   local-lolrrit-wm has registered the job XXXXXX for deletion
# instead, wait until `qstat` doesn't show lolrrit-wm anymore, then run kick.bash again

Redis died?

Run `gerrit-to-redis/src/clients_from_mysql.py` to re-create the clients list in redis.

Logs

There are somewhat comprehensive logs in the `~/logs` folder on toollabs.

Code

The code is hosted on Gerrit, under labs/tools/grrrit-wm [2].

Debugging stuck stream

Template:Info If the bot stops reporting events, and restarting it doesn't help, run ssh <yourname>@gerrit.wikimedia.org -p 29418 gerrit stream-events and perform some activity on Gerrit like rebasing a patch. Did it appear in the stream? If so, the malfunction is probably located in the piece of middleware that streams Gerrit events into Redis. (This is the stream that feeds grrrit-wm.) Here's how to restart it:

ori@tools-login:~$ become gerrit-to-redis
local-gerrit-to-redis@tools-login:~$ jstop gerrit-to-redis
local-gerrit-to-redis has registered the job 1084879 for deletion
local-gerrit-to-redis@tools-login:~$ jsub  -once -continuous -N gerrit-to-redis ~/gerrit-to-redis/src/stream-receiver.bash
Your job 1444002 ("gerrit-to-redis") has been submitted

Access

The project under Toollabs is called lolrrit-wm. As of now the following people have access:

  1. YuviPanda
  2. ^demon
  3. AzaToth
  4. Ryan Lane
  5. ori-l
  6. MZMcBride
  7. RoanKattouw
  8. MarkTraceur
  9. legoktm
  10. aude
  11. PiRSquared17
  12. MatmaRex
  13. Krenair
  14. James_F

Any of these people can restart the service if need be.

See also