You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org

Obsolete:Grrrit-wm: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Quiddity
m (fix markup (every time I don't preview, I make a mistake >.<))
 
imported>BryanDavis
(hatnote tweaks)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
:''[[IRC_bots#wikibugs|wikibugs]] has taken over this function''
{{See|[[mw:Wikibugs|wikibugs]] and [[Gerrit/Phabricator integration]] have taken over this function.}}
{{lowercase}}
{{Historical}}
 
'''grrrit-wm''' is an IRC bot that listens to events from [[Gerrit]] and reports them on various IRC channels; it replaces gerrit-wm.  
'''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 <code>config.yaml</code> [https://phabricator.wikimedia.org/diffusion/TGRT/browse/master/config.yaml]; it defaults to #wikimedia-dev, see [[mw:MediaWiki on IRC]].
Which repo changes report to which channels can be configured in <code>config.yaml</code> [https://phabricator.wikimedia.org/diffusion/TGRT/browse/master/config.yaml;1882bdfc5aa44ee4ad4abdb8b7ac162f5858f62f? config.yaml]; it defaults to #wikimedia-dev, see [[mw:MediaWiki on IRC]].


== Running it ==
== Running it ==
Line 92: Line 93:
* [[Gerrit Notification Bot]]
* [[Gerrit Notification Bot]]
* {{IRC|Wikimedia-bot-gerrit}}, testing channel
* {{IRC|Wikimedia-bot-gerrit}}, testing channel
[[Category:Services]]
 
[[Category:IRC]]
{{lowercase}}
[[Category:Gerrit]]
[[Category:Decommissioned services]]

Latest revision as of 20:11, 1 September 2022

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 config.yaml; it defaults to #wikimedia-dev, see mw:MediaWiki on IRC.

Running it

It runs in a Docker container in our new Kubernetes cluster under the tools project in labs. It uses one of the base containers that tool labs provides (docker-registry.tools.wmflabs.org/toollabs-nodejs-base:latest). You can see the YAML file used as the kubernetes deployment definition in kubernetes-deployment.yaml in the repository. If you want to start the bot entirely from scratch, then just doing kubectl apply -f kubernetes-deployment.yaml should work.

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 for the changes to take effect - see the deploying and restarting sections for more.

Building/Deploying

Log files

ssh tools-login.wmflabs.org
become lolrrit-wm
kubectl get pods
kubectl logs grrrit-otnlc   # use actual pod name from previous command
Deploying or restarting
$ ssh tools-login.wmflabs.org
$ become lolrrit-wm
# cd into lolrrit-wm and change repository to deploy (e.g. git pull)
$ kubectl get pods
NAME                          READY     STATUS    RESTARTS   AGE
grrrit-wm-230500525-qk7fl     1/1       Running   0          2m
lolrrit-wm-3433923449-x40eu   1/1       Running   0          4d
$ kubectl delete pod grrrit-wm-230500525-qk7fl # use actual pod name from previous command

Temporarily Stopping You can just the deployment to run 0 instances.

$ kubectl scale --replicas=0 deployment/grrrit-wm
deployment "grrrit-wm" scaled

Restarting after stopping

Just scale it back to 1 instance.

$ kubectl scale --replicas=1 deployment/grrrit-wm
deployment "grrrit-wm" scaled

Code

The code is hosted on Gerrit, under labs/tools/grrrit [1].

Historical

  • It first used to run on the gridengine, and received gerrit changes via redis stream
  • Then it ran on gridengine, but didn't use redis at all
  • It was the first tool to be moved to kubernetes, using a custom docker image
  • Now it just runs on the kubernetes cluster, without any custom docker images.

npm 2 upgrade changes

cd ~/lol*

edit

.profile

add

source ~/.bashrc

at bottom of file.


Then edit

.npmrc

and add

prefix = /data/project/lolrrit-wm/.npm-packages

Then run

/usr/share/npm/bin/npm-cli.js install -g npm@2 // Change the 2 to the version you want.

See also