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

Allow uninstalling Jenkins plugins #59

Open
fredg02 opened this issue Oct 10, 2019 · 4 comments
Open

Allow uninstalling Jenkins plugins #59

fredg02 opened this issue Oct 10, 2019 · 4 comments
Milestone

Comments

@fredg02
Copy link
Contributor

fredg02 commented Oct 10, 2019

Allow uninstalling Jenkins plugins and handle associated permissions (e.g. Gerrit) to avoid JCasC startup errors.

This might become easier with the new Jenkins Plugins Installation Manager CLI Tool/Library: https://jenkins.io/projects/gsoc/2019/plugin-installation-manager-tool-cli/

@mbarbero
Copy link
Member

Currently, here is how plugins are installed/managed between the container images and the running instances:

In order to be able to remove a plugin, we need to be able to remove it from $JENKINS_HOME/plugins folder in the persistent volume. I see 3 options:

  1. We add a directive to the instance's config.jsonnet with the list of plugins to be removed (this list could be copied to some specific file in the /usr/share/jenkins/ref/ folder) and we add another responsibility to jenkins.sh to actually remove the plugins from this file. I'm not a huge fan as the list of plugins to be removed is not something "stable". There is no reason to keep a plugin in this list once it has been removed... It's also quite complicated as we would have to check if the plugins we want to remove are not a dependencies for some other plugins.
  2. We removed all plugins from $JENKINS_HOME/plugins at each startup, so that the re-conciliation between /usr/share/jenkins/ref/plugins and $JENKINS_HOME/plugins is fairly simple: it's just a copy. Of course, it means that we don't support persistent installation of plugins via the UI. We can still test new plugin and install them from the UI, but once the instance is restarted, the plugin is gone if not added to the image. I like that as it's very close to how we handle configuration via JCasC: all manual edits are overridden at restart. Finally, it's much safer as we don't risk removing a plugin that would end up being a dependency of another.
  3. We do it manually: we first remove the desired plugin either from the jiro-master's list or from the instance's list, then we re-deploy the instance. Once restarted, we go to the plugin management UI and remove the plugin from there and re-restart the instance again. The plugin should be gone. It's manageable for the removal of a plugin in 1 or 2 instances, but it does not scale very well (e.g. removal of a deprecated plugin from all instances).

@fredg02, WDYT?

@heurtematte
Copy link
Contributor

I agree on second proposition.

@fredg02
Copy link
Contributor Author

fredg02 commented Aug 10, 2023

I'd like to propose another option:

  1. Manual approach, assisted by scripts to allow (mass) plugin uninstallations
    We don't run the Jenkins instances completely stateless, since JCasC is not perfect yet. I'd also rather have the option to install/update a plugin from the UI manually, then an automatic reset/override after a restart. We have (Groovy) scripts that can mass uninstall plugins if required. Those scripts could also be leveraged to uninstall plugins on a single instance if someone does not like to click in the WebUI. In any case, this will need to be documented better.

@heurtematte
Copy link
Contributor

Maybe we should learn from this issue: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/3650
Keeping an old version of "maven-plugin" on the jenkins home plugins directory failed jenkins to start.
Cleaning directory plugins was the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants