Skip to content

Plugin installation step #6875

Description

@mariusandra

Currently plugins are installed from Django. The main posthog app in plugin.py. The code there either 1) gets a github repo URL, parses it, fetches a .zip file with the plugin code, does basic validation (version check) and stores the archive in postgres, or 2) Opens a source editor and stores its contents in postgres.

In both cases, we won't know if the plugin actually works before we try it out for real.

Instead, I'd like there to be a separate "install plugin" step and "installing..."/"updating..." states. This might mean pushing some of the logic away from Python into NodeJS (e.g. downloading the archives?) and just dispatching tasks from the plugin server, and awaiting their responses.

Eventually we the plugin server would spin up a VM for the "to install" plugin, capture its capabilities, and if all loaded well, mark the plugin as installed and ready to use. I'd argue the VM should be spin up in a separate worker pool (with just one thread) for isolation. Either via piscina or some other system. This could be the basis for plugin testing as well https://github.com/PostHog/plugin-server/issues/165

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status
Done This Sprint

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions