Bug 1565223

Summary: [INFRA] ChatOps bot infra
Product: [Community] RDO Reporter: Jakub Ruzicka <jruzicka>
Component: InfrastructureAssignee: Javier Peña <jpena>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: apevec, jpena, nhicher
Target Milestone: ---   
Target Release: trunk   
Hardware: Unspecified   
OS: Unspecified   
URL: https://www.youtube.com/watch?v=DLzxrzFCyOs
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-04 11:42:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jakub Ruzicka 2018-04-09 16:24:51 UTC
Description of problem:
I would like to introduce advanced karma bot to #rdo, #softwarefactory and other interested channels on freenode and other networks and provide detailed community statistics as well as a nice way to explicitly express gratitude for others' work.

Please don't underestimate the impact of such tool just because default implementations are basic and limited in usefulness. Let me demonstrate the possibilities, I just need a machine :)

Especially, I require persistant database storage because I intend to properly analyze the data over time so losing them periodically defeats the purpose.

In other words I need:

a) persistant backed up machine where I will run the bot and the database myself

or

b) a replacable VM and a backed up database storage somewhere

Thanks in advance for you help.

Comment 1 Alan Pevec 2018-04-09 22:02:13 UTC
I wonder if we could reuse influxdb included in Software Factory for this, since it's "data over time".
This could be also expanded to feed a general "badges" system like https://badges.fedoraproject.org/about

Comment 2 Javier Peña 2018-04-10 17:03:14 UTC
So, my biggest doubt is where to place this service. I'm not sure we should dedicate a full VM to this, maybe we can reuse some existing machine?

The rdobot is running on the Sensu server, maybe we could centralize the new bot there. wdyt?

Comment 3 Jakub Ruzicka 2018-04-11 12:13:17 UTC
Influxdb describes itself as "scalable datastore for metrics, events, and real-time analytics" which sounds exactly like what I need - I'm happy to try that.

And yes, I'm also wondering where to place this service for a long time, yet anywhere is fine, really. As long as I have sufficient access to the machine to maintain the bot without bothering anyone else, I don't care which machine in particular.

Comment 4 Nicolas Hicher 2018-04-11 13:10:41 UTC
It is easy to create a dedicated db in influx with a specific user and credential  for your bot (to avoid to use the same db than sf metrics). I can create a short doc if needed. The db and user creation are describe in sf-config ansible role for influxdb

repo: https://softwarefactory-project.io/r/software-factory/sf-config
file: ansible/roles/sf-influxdb/tasks/influxdb_configuration.yml

Comment 5 Jakub Ruzicka 2018-04-12 19:42:37 UTC
I was looking at InfluxDB and related tools and it indeed looks like the right tool for the job.

Once the data are in InfluxDB there are many ways to visualize/aggregate them.

So having found the DB, I can ansiblize the whole thing and not care where it runs at all ;)

Running along rdobot sounds good to me, so what about the Sensu server Javier mentioned?

I need to know the system it's going to run on and available libraries to proceed further.

Comment 6 Alan Pevec 2018-04-12 22:41:31 UTC
> maybe we could centralize the new bot there

It's just new plugin, we should reuse the same bot vs adding new one, but for development and testing, new staging bot environment would be good.
Feels like we need a containers management solution (hint: starts with O, ends with T) to run all those apps!

Comment 7 Alan Pevec 2018-04-12 22:46:11 UTC
Related, IRC Bot Consolidation in openstack-infra
https://storyboard.openstack.org/#!/story/2001736

Comment 8 Jakub Ruzicka 2018-04-16 14:49:02 UTC
So upstream is likely to use limnoria, the supybot descendant which makes sense given it's compatible with currently used supybot plugins.

Certain top secret bot instance I'd like to integrate with also uses limnoria.

Finally, rdobot uses errbot but there is no explicit reason binding it to that framework.

Without too deep research (I wrote a simple plugin) I found errbot to be a better implementation, but limnoria seems not horrible so I think proper solution would be to align with upstream.

I could add my karma plugin to rdobot which is ansiblized and already runs somewhere, but that's errbot. Maybe we should port it to limnoria to achieve unity instead.

Also, there seems to be no active driver for the upstream IRC Bot Consolidation effort so if we had a strong case for errbot we could discuss using that instead, but that doesn't seem like a path of least resistance to me.

So at this point I still don't know which bot or which machine to use :-/

Comment 9 Javier Peña 2018-04-16 16:40:39 UTC
Let's see David's opinion. If I were to implement this, I'd go for an errbot extension and run it on the same server as rdobot.

Comment 10 Alan Pevec 2018-09-07 15:22:58 UTC
Karma in the description is just one use-case,
should we consider more general ChatOps approach?

BTW for community activity tracking might be worth integrating with badges.fedoraproject.org

Comment 11 Javier Peña 2020-03-04 11:42:06 UTC
We have not had any activity in the bug for a long time, closing. Feel free to reopen if you think this is needed in the RDO infrastructure.