Page MenuHomePhabricator

Migrate wm-bot to libera.chat
Closed, ResolvedPublic

Description

Wikimedia IRC channels are migrating from Freenode to libera.chat. [1] Most channel names are the same.

  • Create new bot instance for libera network
  • Create systemd unit files for new bot instance
  • Create new channel logs interface on wmcloud.org
  • Create new bot info interface on wmcloud.org (for now https://wm-bot.wmflabs.org/libera_dump/)
  • Document all changes to setup on wikitech
  • Migrate GitHub notification service
    • Relay messages to both instances
    • Migrate SQL configuration (MySQL instance) of github webhooks to new instance DB
    • Reconfigure github hook (/var/www/html/github) to work with new instance DB (done under wmcloud.org)
  • Migrate RecentChanges notifications for selected channels (please add your channel if you want that)
    • huggle
    • wm-bot
    • wikimedia-commons
    • wikimedia-commons-admin
    • wikipedia-gu
    • ##CptViraj
    • wikipedia-bn
  • Migrate infobot for channels
  • Give it a cloak

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

I think ACLs will need to be rebuilt since the cloaks are different on Libera.

Yeah, ACLs are just going to be a mess for a bit until we get WM cloak infrastructure up.

I emailed Petrb last night about doing this, haven't gotten a response yet.

It looks like https://openstack-browser.toolforge.org/project/wm-bot Andrew, David (WMCS staff) are the only other people with access besides Petrb. We need to add more maintainers to keep wm-bot sustainable.

Others of us have root access on the irc side of things

It looks like https://openstack-browser.toolforge.org/project/wm-bot Andrew, David (WMCS staff) are the only other people with access besides Petrb. We need to add more maintainers to keep wm-bot sustainable.

I used to have access to do the simple things. @Petrb set it up years ago <shrug> oh well

Hello guys, sorry didn't notice this at all, I have no problems sharing the maintainer access to wm-bot with anyone, lots of people already asked in the past and I gave access to all of them (at least the trusted ones).

I have to admit this is first time I hear about this migration, what's wrong with freenode? I noticed that all wikimedia channels on freenode are still active, so perhaps we could keep wm-bot on both networks? The question is if we want to run two separate instances each dedicated to 1 network, or extend the codebase to allow it to operate on multiple networks in parallel, it already has multi-session support, but right now within one network only.

Hello guys, sorry didn't notice this at all, I have no problems sharing the maintainer access to wm-bot with anyone, lots of people already asked in the past and I gave access to all of them (at least the trusted ones).

Thanks! Could you add me? I can help with the migration but can't commit to long-term maintenance.

I have to admit this is first time I hear about this migration, what's wrong with freenode? I noticed that all wikimedia channels on freenode are still active, so perhaps we could keep wm-bot on both networks? The question is if we want to run two separate instances each dedicated to 1 network, or extend the codebase to allow it to operate on multiple networks in parallel, it already has multi-session support, but right now within one network only.

See https://kline.sh/ and https://www.vice.com/en/article/m7ev8y/freenode-open-source-korea-crown-prince-takeover and https://meta.wikimedia.org/wiki/Wikimedia_Forum#Decision_from_GCs :-)

Channels are active on Freenode because we're still in process of migrating over. I think once wm-bot is running on Libera so we have a log bot we can start closing some of the freenode ones. If you want to keep an instance running on freenode that's fine but we mostly need something for Libera, hopefully with config all copied over.

It's worth noting that we don't have project cloaks yet, so freenode access control lists likely won't work. The inbobot db and other channel configuration should mostly be able to be copied over.

Since the bot is in over 400 channels, it would make sense to keep it running on Freenode at least for a bit longer

ok well, that's really sad news to me, I liked the old freenode. I am definitely going to support this new network that old staffers moved to. I already registered my nickname petan there.

But still, I am not sure if we want to just operate 2 independent installations of wm-bot, or try to merge them somehow. If the long-term plan is to abandon freenode permanently, then it probably isn't worth coding such an overhaul of bot core.

probably 2 separate instances is good, and just copy over the database since most things should be the exact same

ok, I am wondering if we keep them both on same VM, or just create a new one for libera, perhaps we could name it wm-bot-libera? From what I remember we also had dedicated postgre instance, but maybe postgre is now available as a service in cloud environment? that would be even better I think.

postgres isn't available as a service yet, just mysql AFAIK.

If the existing VM has enough resources then we could use the same one otherwise let's create a new one? if it's not already on debian buster would be a good time to upgrade.

they are on "debian-10.0-buster (deprecated 2020-10-16) ", I don't mind installing them again, despite I am going to lose that nice hostname

Preferrably the hostname for the relay would not change

ok perhaps what would help me with deciding is knowing how urgent is this issue - do we need to fix it ASAP? if yes, I would just run another instance on same infrastructure, then we can migrate it later.

If it's not urgent, then we can just build new VMs and then start it from there, but that will probably take a bit

Channel logging won’t work yet, but it is online.

just few updates:

I created a new instance of bot on old infrastructure, there is a new user wm-bot-lib and everything is located under /opt/wm-bot-lib logging to both TXT and SQL is operational, but only TXT is accessible now at https://wm-bot.wmflabs.org/libera_logs/

The SQL has small problem - logs are physically in table "logs" which has column "ID" that is a postgres SEQUENCE and UNIQUE index. Since I created this table newly for new bot instance, this sequence started from 1 and therefore items in this table are having conflicting ids as items in database of other instance (which is actually still alive on freenode and writing to its own database). While merging TXT logs is somewhat trivial, merging SQL logs will require some reinserting to handle the conflicting IDs, I could probably write a script for that later, but it's not going to be possible to merge SQL logs right now.

I think we should come up with some migration strategy, first of all I don't know if we want to keep the old bot on freenode, or discontinue it as soon as possible. I don't know how is the situation with freenode going to unfold, but I guess that decision was already made to move to the new network. On other hand there is still quite a number of active wikimedia channels on freenode, and it will probably take some time for our project members to acknowledge this change and move to new network, so I think we should keep the bot up on both networks for now, with 2 logging endpoints.

also regarding "lack of maintainers" - I was never opposing having more maintainers of wm-bot (we actually have quite a team for such a small service) - if anyone can be trusted, has the necessary skills (knows GNU/Linux and IRC) and wants to help to maintain the bot, I am happy to give you access. Technical documentation is here: https://wikitech.wikimedia.org/wiki/Wm-bot I try to keep everything documented, and bot itself is fully open sourced: github.com/benapetr/wikimedia-bot

Petrb updated the task description. (Show Details)

I copied the old infobot DB's for all channels, including channels that bot is not in right now, that means when you @join the bot to these channels, their DB will prefill with freenode values.

I didn't recover seen database and channel statistics (messages per user) as these are linked to freenode cloaks anyway. I also didn't recover the individual channel configurations, they contain old freenode access lists, not sure if we want to recover them or not.

Change 693579 had a related patch set uploaded (by Legoktm; author: Legoktm):

[operations/puppet@production] wmcs: Point dologmsg at wm-bot's Libera Chat relay

https://gerrit.wikimedia.org/r/693579

Change 693579 merged by Legoktm:

[operations/puppet@production] wmcs: Point dologmsg at wm-bot's Libera Chat relay

https://gerrit.wikimedia.org/r/693579

Linkie doesn’t seem to be working.

Linkie doesn’t seem to be working.

I copied over configuration/linkie from the freenode instance and it works now!

The only other thing that doesn’t seem to work is the GitHub relay

The only other thing that doesn’t seem to work is the GitHub relay

Yeah, it's unchecked in the description and the plugin is disabled in the configuration (only one left). I didn't look into what it would take to re-enable it yet.

also regarding "lack of maintainers" - I was never opposing having more maintainers of wm-bot (we actually have quite a team for such a small service) - if anyone can be trusted, has the necessary skills (knows GNU/Linux and IRC) and wants to help to maintain the bot, I am happy to give you access. Technical documentation is here: https://wikitech.wikimedia.org/wiki/Wm-bot I try to keep everything documented, and bot itself is fully open sourced: github.com/benapetr/wikimedia-bot

Thanks, I think many of us had the impression that you were the only person who could do stuff and it doesn't seem that's the case. I annotated https://wikitech.wikimedia.org/wiki/Wm-bot#All_stars_team with who has server access (and added myself). I think we should find at least one or two more people to give server access to.

Could you also document who has access to the GitHub repository? Should all people with server access have access to that as well?

everyone has read access and everyone can submit pull requests, people who can merge pull requests:

  • me
  • addshore
  • johnduhart
  • reedy
  • Technical-13

I can add more people if necessary, nobody else requested this kind of access as far as I know

I made a hack that will forward github messages via netcat to both instances of bot, but its still working with MySQL DB of freenode instance, so that's where the configuration of webhooks take place.

It's necessary to do @relay-on in every channel that was using github module on freenode

Petrb triaged this task as Medium priority.May 23 2021, 10:43 AM
Petrb updated the task description. (Show Details)

I created a new plugin that allows bridging freenode and libera - basically if you are admin in both channels, you can just run @bridge-on and bot will mirror messages in channel to second network. It's possible to create one way bridge as well (just don't run @bridge-on on other network). This works only if bot is present in same channel on both networks and if channel names are same.

@Petrb while it would've been nice to have bridges working, I think at this point the actions of new freenode staff have made it clear that we should not stay on their network (c.f. https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/N2S532RNJQUCVHITDUVV2HA5BY5HEQOL/). I would suggest we shutdown the freenode side of wm-bot and focus on getting all the Libera stuff migrated/ready to go.

Might not be a bad idea for me to have access as well - I tend to be around most of the time - and I could also work on getting the web ui working for Libera - I know Apache fairly well.

@Petrb while it would've been nice to have bridges working, I think at this point the actions of new freenode staff have made it clear that we should not stay on their network (c.f. https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/N2S532RNJQUCVHITDUVV2HA5BY5HEQOL/). I would suggest we shutdown the freenode side of wm-bot and focus on getting all the Libera stuff migrated/ready to go.

I agree with this but the bot is also used in a fair number of non-wikimedia channels as well, so we might to wait a bit longer.

I appreciate your swiftness but I am not sure if everyone else does ;) it took me few days to notice what is going on with freenode, and I am fairly active in IRC world, I assume it will take months to realize this for others. Also running wm-bot on freenode costs us nothing, so unless new freenode staff starts causing us some serious issues with bot operation, I'd keep it.

As of now the status is that on freenode, which used to have ~80k online users, there is ~60k online users and on libera ~20k, so I think we can assume that about 1/4th of old Freenode has migrated to new network, that is much less than half of all users. It's also visible in our channels, in some channels there is more people on freenode than libera. This migration will take a lot of time, but I would consider wm-bot to be only semi-supported on freenode as of now.

Petrb updated the task description. (Show Details)
Petrb updated the task description. (Show Details)

recent changes notifications were all migrated but you may need to run @recentchanges-on to get them enabled

web ui is setup - though the log browser doesn't show any channels - I believe this is due to the fact that the logs_meta table in the Postgres db is completely empty for libera whereas it isn't for freenode

web ui is setup - though the log browser doesn't show any channels - I believe this is due to the fact that the logs_meta table in the Postgres db is completely empty for libera whereas it isn't for freenode

I was able to fix it by running ALTER TABLE logs_meta ALTER COLUMN id SET DEFAULT nextval('logs_meta_id_seq'::regclass); - there are still no values other then for WM-Bot (where I was testing) - the table won't be populated unless you do @logoff and then @logon for each channel, though we could add them manually as well

web ui is setup - though the log browser doesn't show any channels - I believe this is due to the fact that the logs_meta table in the Postgres db is completely empty for libera whereas it isn't for freenode

I was able to fix it by running ALTER TABLE logs_meta ALTER COLUMN id SET DEFAULT nextval('logs_meta_id_seq'::regclass); - there are still no values other then for WM-Bot (where I was testing) - the table won't be populated unless you do @logoff and then @logon for each channel, though we could add them manually as well

I've now manually inserted rows for channels that currently have logging enabled - log browser is now fully working

GitHub is now fully setup and working - Be aware that you need to have the content type set to json in the webhook config in the repo settings.

Petrb claimed this task.

ok I think this is done