Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a declarative way to manage plugins #70219

Closed
jasontedor opened this issue Mar 10, 2021 · 3 comments · Fixed by #77544
Closed

Provide a declarative way to manage plugins #70219

jasontedor opened this issue Mar 10, 2021 · 3 comments · Fixed by #77544
Assignees
Labels
:Core/Infra/Plugins Plugin API and infrastructure :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Core/Infra Meta label for core/infra team Team:Delivery Meta label for Delivery team

Comments

@jasontedor
Copy link
Member

jasontedor commented Mar 10, 2021

Today management of plugins is done through a CLI tool that exposes list, install, and remove commands. End-users and orchestration systems must use these tools to manage the installation and removal of the appropriate plugins, including addressing our existing limitation that plugins are version-locked to a patch version of Elasticsearch. These requirements lead to a poor end-user experience, and complexity for orchestration systems.

A simpler approach would be to enable plugins to be managed through a configuration.

For example, one way to do this would be via a declarative list. You could imagine a user-managed elasticsearch-plugins.yml that lists the plugin that an end-user or orchestration system wants installed (this list could be our usual syntax today, a name of an official plugin, Maven coördinates, or a URL). In the Elasticsearch startup script, we could diff this list with the installed plugins, remove those that are not listed, and install those that are. This declarative configuration file could include options like batch: true to install without inspecting permissions, and various other options for controlling how plugins are installed (for example, perhaps we need to enable setting proxy system properties here).

There are, of course, several details to work out (e.g., how do we efficiently obtain the name of non-official plugins for comparing to the list of installed plugins) but the purpose of this issue is to encourage us to investigate ways to install plugins declaratively.

@jasontedor jasontedor added :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts :Core/Infra/Plugins Plugin API and infrastructure needs:triage Requires assignment of a team area label labels Mar 10, 2021
@elasticmachine elasticmachine added Team:Delivery Meta label for Delivery team Team:Core/Infra Meta label for core/infra team labels Mar 10, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@mark-vieira mark-vieira removed the needs:triage Requires assignment of a team area label label Mar 10, 2021
@anyasabo
Copy link

We discussed a narrower way of achieving a similar end a bit ago in #61385

@pugnascotia pugnascotia self-assigned this Jun 8, 2021
pugnascotia added a commit that referenced this issue Jul 28, 2021
Part of #70219.

Split the install and remove plugin CLI commands into `Command` and
`Action` classes, so that the main implementations can be reused
in a later PR to create a `Sync` command.
pugnascotia added a commit that referenced this issue Jul 28, 2021
Part of #70219.

Split the install and remove plugin CLI commands into `Command` and
`Action` classes, so that the main implementations can be reused
in a later PR to create a `Sync` command.
ywangd pushed a commit to ywangd/elasticsearch that referenced this issue Jul 30, 2021
Part of elastic#70219.

Split the install and remove plugin CLI commands into `Command` and
`Action` classes, so that the main implementations can be reused
in a later PR to create a `Sync` command.
pugnascotia added a commit to pugnascotia/elasticsearch that referenced this issue Sep 28, 2021
Part of elastic#70219.

In order to share the plugin install and remove actions with the
Elasticsearch server, introduce a `PluginLogger` interface for the
action classes to use instead of referencing `Terminal` directly.
pugnascotia added a commit to pugnascotia/elasticsearch that referenced this issue Sep 30, 2021
Part of elastic#70219.

In order to share the plugin install and remove actions with the
Elasticsearch server, introduce a `PluginLogger` interface for the
action classes to use instead of referencing `Terminal` directly.
pugnascotia added a commit that referenced this issue Nov 15, 2021
Closes #70219.

Introduce a declarative way for the Elasticsearch server to manage plugins,
which reads the `elasticsearch-plugins.yml` file and works which out
plugins need to be added and / or removed to match the configuration. Also
make it possible to configure a proxy in the config file, instead of
through the environment.

Most of the work of adding and removing is still done in the
`InstallPluginAction` and `RemovePluginAction` classes, so the
behaviour should be the same as with the `install` and `remove`
commands. However, these commands will now abort if the above config
file exists. The intent is to make it harder for the configuration
to drift.

This new method only applies to `docker` distribution types at the
moment.

Since this syncing mechanism declarative, rather than imperative,
the Cloud-specific plugin wrapper script is no longer required.
Instead, an environment variable informs `InstallPluginAction` to
install plugins from an archive directory instead of downloading
them, where possible.
pugnascotia added a commit to pugnascotia/elasticsearch that referenced this issue Nov 15, 2021
Closes elastic#70219.

Introduce a declarative way for the Elasticsearch server to manage plugins,
which reads the `elasticsearch-plugins.yml` file and works which out
plugins need to be added and / or removed to match the configuration. Also
make it possible to configure a proxy in the config file, instead of
through the environment.

Most of the work of adding and removing is still done in the
`InstallPluginAction` and `RemovePluginAction` classes, so the
behaviour should be the same as with the `install` and `remove`
commands. However, these commands will now abort if the above config
file exists. The intent is to make it harder for the configuration
to drift.

This new method only applies to `docker` distribution types at the
moment.

Since this syncing mechanism declarative, rather than imperative,
the Cloud-specific plugin wrapper script is no longer required.
Instead, an environment variable informs `InstallPluginAction` to
install plugins from an archive directory instead of downloading
them, where possible.
elasticsearchmachine pushed a commit that referenced this issue Nov 15, 2021
Closes #70219.

Introduce a declarative way for the Elasticsearch server to manage plugins,
which reads the `elasticsearch-plugins.yml` file and works which out
plugins need to be added and / or removed to match the configuration. Also
make it possible to configure a proxy in the config file, instead of
through the environment.

Most of the work of adding and removing is still done in the
`InstallPluginAction` and `RemovePluginAction` classes, so the
behaviour should be the same as with the `install` and `remove`
commands. However, these commands will now abort if the above config
file exists. The intent is to make it harder for the configuration
to drift.

This new method only applies to `docker` distribution types at the
moment.

Since this syncing mechanism declarative, rather than imperative,
the Cloud-specific plugin wrapper script is no longer required.
Instead, an environment variable informs `InstallPluginAction` to
install plugins from an archive directory instead of downloading
them, where possible.
pugnascotia added a commit that referenced this issue Nov 16, 2021
Closes #70219.

Introduce a declarative way for the Elasticsearch server to manage plugins,
which reads the `elasticsearch-plugins.yml` file and works which out
plugins need to be added and / or removed to match the configuration. Also
make it possible to configure a proxy in the config file, instead of
through the environment.

Most of the work of adding and removing is still done in the
`InstallPluginAction` and `RemovePluginAction` classes, so the
behaviour should be the same as with the `install` and `remove`
commands. However, these commands will now abort if the above config
file exists. The intent is to make it harder for the configuration
to drift.

This new method only applies to `docker` distribution types at the
moment.

Since this syncing mechanism declarative, rather than imperative,
the Cloud-specific plugin wrapper script is no longer required.
Instead, an environment variable informs `InstallPluginAction` to
install plugins from an archive directory instead of downloading
them, where possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Plugins Plugin API and infrastructure :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Core/Infra Meta label for core/infra team Team:Delivery Meta label for Delivery team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants