Scratchpad for simplifying writing/deploying bots #1

Closed
opened 4 years ago by decentral1se · 1 comments
Owner

Current problem:

  • It is hard to write the bots (a lot of library boilerplate)
  • It is hard to deploy the bots (sysadmin hell)

A bunch of Varia people are working with this stuff and its really fun and interesting. So, I think some tooling could be good to work on to make this process simpler. I had some ideas about how to make this easier.

writing

Simply write a wrapper around certain types of bots like "PersonalBot" which is a wrapper around a bot which can be privately messaged. In the wrapper you would just write code to respond to direct messages not have to manage all the other stuff. Another one might be "GroupBot" which can join group chats and respond to them. These bots should be composable. So if you want PersonalBot + GroupBot, you can just do class MyBot(PersonalBot, GroupBot): ... and you're on the move. The wrapper shouldn't be too smart or do too much, just make it simpler to work with.

deployment

Once you have your bot, how the heck do you run it? Currently, we do some sort of weird ad-hoc deployment from a hook which does a pip install, supervisor restart and all sorts of stuff. I was thinking that something like Dokku could resolve a lot of the issues we'd have here: http://dokku.viewdocs.io/dokku/. Too long to explain how but basically, with Dokku, it would be possible to write a bot.py and then just git push and your bot would come up or fall down but the process would be automatic and you'd see the deployment on your terminal.

I think work on a small library + dokku deployment might be quite nice! Not sure if I will have time to do this but I wanted to just brain dump some thoughts since things are fresh.

Current problem: - It is hard to write the bots (a lot of library boilerplate) - It is hard to deploy the bots (sysadmin hell) A bunch of Varia people are working with this stuff and its really fun and interesting. So, I think some tooling could be good to work on to make this process simpler. I had some ideas about how to make this easier. ## writing Simply write a wrapper around certain types of bots like "PersonalBot" which is a wrapper around a bot which can be privately messaged. In the wrapper you would just write code to respond to direct messages not have to manage all the other stuff. Another one might be "GroupBot" which can join group chats and respond to them. These bots should be composable. So if you want PersonalBot + GroupBot, you can just do `class MyBot(PersonalBot, GroupBot): ...` and you're on the move. The wrapper shouldn't be too smart or do too much, just make it simpler to work with. ## deployment Once you have your bot, how the heck do you run it? Currently, we do some sort of weird ad-hoc deployment from a hook which does a pip install, supervisor restart and all sorts of stuff. I was thinking that something like Dokku could resolve a lot of the issues we'd have here: http://dokku.viewdocs.io/dokku/. Too long to explain how but basically, with Dokku, it would be possible to write a `bot.py` and then just `git push` and your bot would come up or fall down but the process would be automatic and you'd see the deployment on your terminal. I think work on a small library + dokku deployment might be quite nice! Not sure if I will have time to do this but I wanted to just brain dump some thoughts since things are fresh.
Poster
Owner

I've got something workable for this over at https://git.autonomic.zone/decentral1se/xbotlib. Gonna close this off and keep efforts focused on that other issue tracker.

I've got something workable for this over at https://git.autonomic.zone/decentral1se/xbotlib. Gonna close this off and keep efforts focused on that other issue tracker.
decentral1se closed this issue 3 years ago
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.