grrrit-wm

From Wikitech

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.

Running it

It runs in a Docker container in our new Kubernetes cluster.

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.

Building/Deploying

Building

(requires ~1GB of drive space and takes ~20 mins for the first time)

  • install docker!
  • sudo docker login
  • git clone the repo
  • sudo docker build -t yuvipanda/grrrit .
  • sudo docker push yuvipanda/grrrit
Deploying
  • ssh tools-k8s-master-01.tools.eqiad.wmflabs
  • sudo su yuvipanda
  • kubectl --user=lolrrit-wm --namespace=lolrrit-wm get pods
  • kubectl --user=lolrrit-wm --namespace=lolrrit-wm delete pods/grrrit-fhlw7
  • hopefully that works?

Stopping

Stopping the pod is not enough -- the replicationcontroller will start a new one.

$ kubectl --user=lolrrit-wm --namespace=lolrrit-wm get replicationcontrollers
CONTROLLER   CONTAINER(S)   IMAGE(S)                  SELECTOR      REPLICAS   AGE
grrrit       grrrit         yuvipanda/grrrit:latest   tool=grrrit   1          34d

$ kubectl --user=lolrrit-wm --namespace=lolrrit-wm stop replicationcontroller grrrit
replicationcontroller "grrrit" deleted

$ kubectl --user=lolrrit-wm --namespace=lolrrit-wm get pods
NAME           READY     STATUS        RESTARTS   AGE
grrrit-u0w8r   1/1       Terminating   0          2m

Code

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

Tool Labs era

It was built to run on Tool Labs

Logs

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

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