-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Uninstalling a plugin #1531 #1538
base: master
Are you sure you want to change the base?
Conversation
Merry Christmas too, thanks a lot for your contribution. 🙏 |
Are we ready to merge or is there any more changes @gounthar @dduportal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The install-plugins.sh script is no longer a useful script. The plugins.txt file defines the plugins to be installed, not the plugins to be removed (at least as far as I've used it).
From experiments with the jenkins/jenkins:2.375.1 container, I can remove a plugin from the installation by removing the entry from the Dockerfile that I used was:
However, that simple use case does not cover the cases where the user is preserving their configuration in a separate data volume. In that case, then I believe that additional steps will be required in order to remove the files from |
… of creating a new plugin.txt
Added a new commit- b0b6bcf Let me know, if there are any suggestions. |
Any update on this |
Sorry for the delay. It will likely be a few more days before I can review. |
Same for me, sorry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your contribution, we do appreciate it. 🙏
Please have a look at my comments and let me know if you agree.
If you don't (which is fine), let's discuss it further.
Once more, thanks.
@MarkEWaite can you help me with the new updates that I need to add or remove from this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this is general documentation that applies to all Jenkinses. Why is it added to the documentation of the Docker images?
Because it's needed here until a "general documentation with clear examples for Docker" is provided. There are multiple specific elements for Docker image that are required, which does NOT apply to packaged distribution of Jenkins (the fact that plugins should be pre-installed in the image in |
Hey @dduportal, can you help me with this PR. Its been one month without any update from other maintainers. |
Sorry for the delay @ritikbanger . I'll do my best to help with a review within the next 7 days. @dduportal probably won't be able to help due to other priorities that he needs to handle. |
I fall in this category! I can live without CI/CD for couple of days(!). But some times I'm impatience and I wanna make it work NOW. (LoL). I'll try to delay upgrading plugins few days, so any big breakage would be catched. But as you mentioned, I don't believe that will be a frequent scenario. (Unless I use a random plugin that's just started development)
Yea that's my goals! Just I need a lot of cathcing up to do! As I'm only used to use CI/CDs like GH Actions.
Thanks! And thanks for taking the time to answer! |
No problem ! You can see what we are doing for the Jenkins infrastructure itself in github.com/jenkins-infra where we got these kind of pattern. We follow the principle of "update often (once or twice a week) to have smaller scopes" so when it goes wrong, then we have less changes to cover and it's faster to diagnose and fix. It's not free the first steps, but once you get used to it, it's worth the investment: you are in the right direction! |
Hi @ritikbanger , there are still some comment on this PR, are you ok to address them? |
@dduportal Could you list out all the points? |
If you go to the to the tab "Files Changed", you'll see all the suggestions and threads (without the other comments) |
@dduportal I have gone through the comments and addressed them. Could you please give me a review on that if you think anything need changes? |
I think you forgot to push your changes: I don't see @gounthar 's comment taken in account in the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ritikbanger thanks for this proposal and sorry for the delay in review but:
-
It does not seem you did the uninstallation process by yourself. I stronlgy suggest you to try it on a local container, otherwise there is no point in documenting something you have no idea how it works. You should record the video of your attempt as a support for getting help from the SIG platform meeting members
-
I'm not sure if you are using a ChatGPT tool or anything, but the structure of the text looks really weird, along with inexact assertions and "generic" phrasings. If you did, please avoid this as it only makes you waste your time.
If you did not and wrote all of this PR by yourself, then it means we should go back to the issue and have you follow at least one uninstallation of a plugin in a Jenkins container to draft a structure of "what uninstallation method" should we cover.
As a maintainer and a user, I cannot accept the content as it today: it adds way more confusion that it helps.
I don't mind helping in the direction, but I need you to do it yourself one time first before continuing
Update: there has been a nice blog post in https://www.jenkins.io/blog/2023/06/20/remove-outdated-plugins-while-using-docker/. @ritikbanger are you ok to update this PR according to this blog post + take our feedbacks in account? |
I will be finishing this PR super soon. |
ed0e411
to
363bddd
Compare
@dduportal I have updated the PR with your feedback. Please have a look. |
@gounthar your review will be highly appreciated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this work. 🤗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this work. 🤗
@gounthar I think we are ready to merge this. |
Thank you very much for your contribution and the latest changes, @ritikbanger. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's going in a really good direction! I'm still not in agreement with some major elements.
The main point is that it feels like you want to write a step by step guide: the README is not the place for that. I would prefer having a page in jenkins.io's documentation (which requires asking the documentation SIG group to find the perfect place in the table of content).
I've provided feedback to continue this PR and land it by shrinking steps and being more generic (requiring Docker Compose is not acceptable for instance).
Thanks for this work!
## Prerequisites | ||
|
||
- Docker and Docker Compose are installed on your system. | ||
- Basic knowledge of Docker and Jenkins. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section does not make sense for me: this pull request is not expected to add a step by step guide that would only cover some use cases.
Do you mind replacing it by a summary of the main important steps instead?
additionnally, I do not expect this to be a guide using docker compose: not only docker-compose
is deprecated in favor of the docker compose
plugin (ref. https://docs.docker.com/compose/, also refered as "Docker Compose v2) but also the instructions in this README should be minimalistic to ensure they benefit non Docker users.
ant:1.11 | ||
``` | ||
|
||
3. **Rebuild the Jenkins Image**: In your terminal, navigate to the directory containing the Docker configuration files for your Jenkins instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. **Rebuild the Jenkins Image**: In your terminal, navigate to the directory containing the Docker configuration files for your Jenkins instance. | |
3. **Rebuild the Jenkins Container Image**: In your terminal, navigate to the directory containing the Jenkins Container Image definition. |
Rebuild the Jenkins image to apply the changes made in the plugins.txt file using the following command: | ||
|
||
```bash | ||
docker-compose build jenkins | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebuild the Jenkins image to apply the changes made in the plugins.txt file using the following command: | |
```bash | |
docker-compose build jenkins | |
``` | |
Rebuild the Jenkins image to apply the changes made in the plugins.txt file using the appropriate tool for your setup (`docker build <...>`, `docker compose build <...>`, etc.). |
- Remove Docker Compose
Use the following command: | ||
|
||
```bash | ||
docker-compose up -d --build --force-recreate jenkins | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the following command: | |
```bash | |
docker-compose up -d --build --force-recreate jenkins | |
``` |
Remove Docker Compose
5. Verify Plugin Removal: To verify if the deprecated plugins have been removed, enter the running Jenkins container by executing the following command: | ||
|
||
```bash | ||
docker-compose exec jenkins bash | ||
``` | ||
|
||
6. Once inside the container, navigate to the Jenkins plugin directory: | ||
|
||
```bash | ||
cd /usr/share/jenkins/ | ||
``` | ||
|
||
7. Check the `plugins.txt` file to ensure the references to the deprecated plugins are gone: | ||
|
||
```bash | ||
cat plugins.txt | grep <plugin-name> | ||
``` | ||
|
||
Replace `<plugin-name>` with the name of the deprecated plugin you want to uninstall. | ||
If no results are returned, it means the plugin references have been removed successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5. Verify Plugin Removal: To verify if the deprecated plugins have been removed, enter the running Jenkins container by executing the following command: | |
```bash | |
docker-compose exec jenkins bash | |
``` | |
6. Once inside the container, navigate to the Jenkins plugin directory: | |
```bash | |
cd /usr/share/jenkins/ | |
``` | |
7. Check the `plugins.txt` file to ensure the references to the deprecated plugins are gone: | |
```bash | |
cat plugins.txt | grep <plugin-name> | |
``` | |
Replace `<plugin-name>` with the name of the deprecated plugin you want to uninstall. | |
If no results are returned, it means the plugin references have been removed successfully. | |
5. Verify effective plugins removal from the image: To verify if the deprecated plugins have been removed from the image, check their absence from the `/usr/share/jenkins/plugins.txt` in the running Jenkins container. | |
For instance, if you use `docker`: | |
```bash | |
$ docker exec <Jenkins Container ID> grep -c "<plugin-name>" /usr/share/jenkins/plugins.txt | |
0 # Should be zero (e.g. the number of occurences of the string "<plugin-name>" in the file) | |
``` | |
Replace `<plugin-name>` with the name of the deprecated plugin you want to uninstall. |
Proposal:
- Squash steps into a single one
- No need to use interactive steps
- A bit of rephrasing
- Remove Docker Compose
8. Uninstall Plugins in the Jenkins UI: Access the Jenkins web interface by visiting [http://localhost:8080](http://localhost:8080) in your web browser. | ||
Log in with your admin credentials. | ||
|
||
9. Navigate to _Manage Jenkins_ and select _Manage Plugins_. | ||
|
||
10. In the _Installed_ tab, search for the name of the deprecated plugin you want to uninstall. | ||
|
||
11. If the plugin appears in the list, click the _Uninstall_ button (red cross) next to it. | ||
If the button is disabled then it means that the plugin has a dependency on another plugin. | ||
Just hover on the red cross to know the parent plugin. | ||
Search that plugin and remove it first by following the same procedure. | ||
|
||
12. Confirm the removal when prompted. | ||
|
||
13. Restart Jenkins: To complete the removal process, Jenkins needs to be restarted. | ||
Restart Jenkins by hitting the `/safeRestart` endpoint or using the Jenkins UI. | ||
|
||
14. Optional: Remove Plugin remnants from Docker Volume: If you want to remove any remnants of the deprecated plugins from the Docker volume, follow these steps: | ||
|
||
- Enter the running Jenkins container using the command mentioned in step 5. | ||
- Navigate to the plugin directory: | ||
|
||
`cd ~/plugins` | ||
|
||
- List the contents of the directory to identify the remnants of the deprecated plugins: | ||
|
||
`ls -artl *` | ||
|
||
- Remove the remnants of the deprecated plugins using the rm command. For example: | ||
|
||
`rm -fr <plugin-name>*` | ||
|
||
Replace `<plugin-name>` with the name of the deprecated plugin you want to remove. | ||
|
||
To deep dive into the removal, refer to this [guide](https://www.jenkins.io/blog/2023/06/20/remove-outdated-plugins-while-using-docker/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is confusing as it mixes different cases without explaining why and what.
Again, this should not be a step by step guide: if you feel like writing a step by step guide, than jenkins.io's documentation would be a better location to write so
WDYT about:
- Starting by explaining that the already installed plugins are living in a Docker volume which has a different lifecycle than the container image and the container image's entrypoint does NOT clean up automatically plugins
- Then describe a command line based scenario to remove plugins manually in the volume (which is roughly the step 14. in your writing here) so it would apply to everyone
- Mentions (using an adminition) that the UI could be used but it does not properly removes every files associated to
<plugin name>
installation
-Updates the instructions as you want user to remove/var/jenkins_home/plugins/<plugin name>*
so that the plugin folder AND all the*.jpi
,*.hpi
and any lock files are deleted for the given plugin<plugin name>
- Mentions (using an adminition) that the UI could be used but it does not properly removes every files associated to
Hi @ritikbanger , any news? This PR has been opened for quite some time and it would benefit from an update. |
I would be updating this PR shortly. |
Thanks. 🤗 |
Document removal of a plugin from container
This PR address the following issue: #1531 which is discussed in SIG December 16th Meeting
cc @dduportal @gounthar
Merry Christmas 🎅