I'm trying to set up Fix Suggester Bot on Toolforge (for some background, see T209149: Have linters/tests results show up as comments in files on gerrit).
It functions in a similar way to the newcomer welcome suggestion bot, in that it's subscribing to gerrit stream events and then posting comments on Gerrit patchsets.
High level setup:
- bin/console fix-suggester-bot:subscribe:gerrit connects via SSH to Gerrit using the fixsuggesterbot user and subscribes to patchset-created events. These events are placed into a Redis queue.
- bin/console messenger:consume gerrit_async consumes the messages, and invokes the various commands that end up posting a comment in Gerrit
I'm trying to get things working on the default php version after running become fixsuggesterbot. I've created an SSH key and added it to ssh-agent so I'm able to connect to gerrit via SSH when I do bin/console fix-suggester-bot:subscribe:gerrit. But now I'm stuck at this step:
bin/console messenger:setup-transports
The redis transport requires php-redis 4.3.0
{"message":"Error thrown while running command \"messenger:setup-transports\". Message: \"The redis transport requires php-redis 4.3.0 or higher.\"","context":{"exception":{"class":"Symfony\\Component\\Messenger\\Exception\\LogicException","message":"The redis transport requires php-redis 4.3.0 or higher.","code":0,"file":"/mnt/nfs/labstore-secondary-tools-project/fixsuggesterbot/fix-suggester-bot/vendor/symfony/redis-messenger/Transport/Connection.php:67"},"command":"messenger:setup-transports","message":"The redis transport requires php-redis 4.3.0 or higher."},"level":500,"level_name":"CRITICAL","channel":"console","datetime":"2021-08-27T09:03:31.823390+00:00","extra":{}}
Based on that, my first question is if we could update the php-redis library used with the default PHP 7.2 setup on Toolforge.
My second question is if I should be using the Kubernetes backend (probably I should be). If I use the web service start command with php7.4 (creating an unnecessary public_html directory in the root of the tool; there's no web interface/API for this tool), then I see that php-redis is a new enough version in the php7.4 setup. But, then I'm stuck because it looks like ssh and ssh-agent don't exist.
Overall, I could use some advice on which direction to go in next:
- I should probably be using Kubernetes; should I add ssh/ssh-agent to the image?
- Symfony Messenger says I should use something like Supervisor to ensure that bin/console messenger:consume gerrit_async is always running (well, not running forever, but that a new process is started when the old one finishes), and I probably also need something similar to use so that bin/console fix-suggester-bot:subscribe:gerrit starts up again in the event of an SSH disconnect. Are these both things that could/should be managed with Kubernetes config?