errbotio / errbot

Errbot is a chatbot, a daemon that connects to your favorite chat service and bring your tools and some fun into the conversation.
http://errbot.io
GNU General Public License v3.0
3.12k stars 614 forks source link

CLI command for plugin installation #1453

Closed torgeirl closed 3 years ago

torgeirl commented 4 years ago

I am...

I am running...

Errbot version: master branch (git+https://github.com/errbotio/errbot.git@master#egg=errbot) OS version: Debian (python:3.7-slim container) Python version: 3.7 Using a virtual environment: no (using Docker instead) Backend: Slack

Issue description

Most of Errbot's documentation assumes direct user interaction with Errbot using either commands in a running prompt or direct chat dialog. This is problematic for a container environment, were everything should be highly re-producible and automated.

One example is the installation of an external Errbot plugin. Current options are limited:

It would have be nice with a command-line option too, something like:

  --install-plugin [PLUGIN_URI]
                        install an existing Errbot plugin from any Git URI

Since it should run as if an admin ran the !repos install it should be able to reuse much of the existing code.

sijis commented 4 years ago

In a kubernetes / container environment, if the plugin and data paths are stored in a persistent volume, there would be no need for this command.

From a technical standpoint, !repo install is essentially doing a git clone. A git clone could be executed within a Dockerfile or init container to setup your bot and it's plugins accordingly.

torgeirl commented 3 years ago

@sijis: this would be useful for creating container images with plugins preinstalled.

!repo install seems to trigger the over-writable activate() function, and default to a specific installation path (username/repo). That could easily be done by an user once the container is running, but being able to reproduce this at build is time-consuming without a CLI command.

nzlosh commented 3 years ago

@torgeirl I think what @sijis is saying is that you don't need a command line option to install plugins or backends. I've written a basic shell script to handle building an errbot container for the project I maintain. Perhaps you could adapt it to include the plugins you need for your errbot instance? https://github.com/nzlosh/err-stackstorm/blob/master/contrib/docker/Dockerfile

torgeirl commented 3 years ago

@nzlosh: thanks for the suggestion.

I ended up cloning the plugin's repo to my defined BOT_EXTRA_PLUGIN_DIR path, and it works for my use case so I'll leave it with that.

nzlosh commented 3 years ago

If you feel the documentation for this capability could be improved, a PR would be most welcome.