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

Replace custom plugin management implementation by Plugin Installation Manager #248

Open
gluehbirnenkopf opened this issue Feb 14, 2020 · 10 comments · May be fixed by #324
Open

Replace custom plugin management implementation by Plugin Installation Manager #248

gluehbirnenkopf opened this issue Feb 14, 2020 · 10 comments · May be fixed by #324
Assignees
Labels
enhancement New feature or request roadmap This issue represents a major topic on the Jenkinsfile Runner roadmap
Milestone

Comments

@gluehbirnenkopf
Copy link

gluehbirnenkopf commented Feb 14, 2020

The custom implementation of Jenkinsfile Runner plugin management should be replaced by https://github.com/jenkinsci/plugin-installation-manager-tool/ so that there is no duplication and unexpected behavior

Depends on:

Original request

Hi,

im trying to insert plugins via plugin.txt into the pre-built image as stated out in readme.md of this project. Unfortunately it always fails. I guess its because it cant determine the version of the .war file and therefore loads incorrect dependencies.

I guess it is trying to download the latest dependencies but as the image from this repos master branch is 2.176.2, it fails.

FROM jenkins4eval/jenkinsfile-runner
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN cd /app/jenkins && jar -cvf jenkins.war *
RUN java -jar /app/bin/jenkins-plugin-manager.jar --war /app/jenkins/jenkins.war --plugin-file /usr/share/jenkins/ref/plugins.txt && rm /app/jenkins/jenkins.war

See here the line "Unable to get version from war file."

Reading in plugins from /usr/share/jenkins/ref/plugins.txt

No directory to download plugins entered. Will use default of /usr/share/jenkins/ref/plugins
Using update center https://updates.jenkins.io from JENKINS_UC environment variable
No CLI option or environment variable set for experimental update center, using default of https://updates.jenkins.io/experimental
No CLI option or environment variable set for incrementals mirror, using default of https://repo.jenkins-ci.org/incrementals
Will use war file: /app/jenkins/jenkins.war
Unable to get version from war file

Downloading plugin ace-editor from url: https://updates.jenkins.io/download/plugins/ace-editor/1.0.1/ace-editor.hpi

The plugin download works of course but when i start my jenkins docker image I end up in dependency and unsupported version errors:

Leon$ docker run --rm -v $(pwd)/Jenkinsfile:/workspace/Jenkinsfile -v $(pwd)/config/jenkins.yaml:/usr/share/jenkins/ref/casc/jenkins.yaml 530bb9b3e3a2
2020-02-14 05:41:23.301+0000 [id=24]	SEVERE	jenkins.InitReactorRunner$1#onTaskFailed: Failed Loading plugin Pipeline Utility Steps v2.5.0 (pipeline-utility-steps)
java.io.IOException: Pipeline Utility Steps version 2.5.0 failed to load.
 - Pipeline: Groovy version 2.56 is older than required. To fix, install version 2.58 or later.
	at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:868)
	at hudson.PluginManager$2$1$1.run(PluginManager.java:544)
	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1095)
	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
2020-02-14 05:41:23.307+0000 [id=23]	SEVERE	jenkins.InitReactorRunner$1#onTaskFailed: Failed Loading plugin Credentials Plugin v2.3.1 (credentials)
java.io.IOException: Credentials Plugin version 2.3.1 failed to load.
 - Configuration as Code Plugin version 1.32 is older than required. To fix, install version 1.35 or later.
	at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:868)
	at hudson.PluginManager$2$1$1.run(PluginManager.java:544)
	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1095)
	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
...

What im doing wrong?

Thanks for your help!

@gluehbirnenkopf gluehbirnenkopf changed the title Plugin Dependencies dont work Plugin dependency mechanism does not work as expected. Feb 14, 2020
@oleg-nenashev
Copy link
Member

Could you please provide your plugins.txt file?

@gluehbirnenkopf
Copy link
Author

gluehbirnenkopf commented Feb 14, 2020

I have setup jenkins 2.176.2 locally to get the "right" plugin versions from the plugin manager:

The versions i have tried were:

kubernetes:1.19.3
workflow-job:2.36
workflow-aggregator:2.6
credentials:2.3.1
credentials-binding:1.20
git:4.1.1
github-oauth:0.33
slack:2.36
http_request:1.8.24
pipeline-utility-steps:2.5.0
jira-steps:1.5.3
testInProgress:1.4
timestamper:1.10

Furthermore i have tried the same plugins.txt without explicit version tag to let jenkins decide what to pick. But none of both works.

@oleg-nenashev
Copy link
Member

Yes, your plugins.txt does not list all plugins on your instance. workflow-aggregator & Co include many transitive dependencies, and the current plugin manager implementation will pull latest versions of them. It should be addressed by https://github.com/jenkinsci/plugin-installation-manager-tool which is already included into the Docker bundle

@gluehbirnenkopf
Copy link
Author

gluehbirnenkopf commented Feb 18, 2020

Okay, understood. Appeciate your support in this awesome jenkins community.
If its included already, why is it still failing?

@oleg-nenashev
Copy link
Member

It is included into the Docker image as a standalone CLI tool, but it is not used in the Jenkinsfile Runner binary at the moment. It has it's own plugin download implementation. It needs to be replaced, but I am not able to do it due to some non-technical reasons

@mezpahlan
Copy link
Contributor

Hi @oleg-nenashev thanks for the work here. It's really promising. I want to ask what we should do in the interim?

I'm playing around with customising the runner and at the moment my plugins.txt simply looks like this as per the current documentation:

// plugins.txt
slack

Should I be doing something different whilst the plugin installation manager tool is not used by the Jenkinsfile-runner binary?

@oleg-nenashev
Copy link
Member

oleg-nenashev commented Jun 13, 2020 via email

@oleg-nenashev
Copy link
Member

FTR jenkinsci/plugin-installation-manager-tool#105 is a foundation PR for it. Will need a release

@oleg-nenashev
Copy link
Member

I started #324 , but it is not ready for review/testing at the moment. I will update this ticket once it is ready

@oleg-nenashev oleg-nenashev added this to the jfr-1.0 milestone Jul 19, 2020
@oleg-nenashev oleg-nenashev added enhancement New feature or request roadmap This issue represents a major topic on the Jenkinsfile Runner roadmap labels Oct 19, 2021
@oleg-nenashev oleg-nenashev changed the title Plugin dependency mechanism does not work as expected. Replace custom plugin management implementation by Plugin Installation Manager Oct 19, 2021
@oleg-nenashev oleg-nenashev self-assigned this Oct 19, 2021
@oleg-nenashev
Copy link
Member

Once jenkinsci/plugin-installation-manager-tool#237 is completed, we will be able to replace the custom implementation alltogether

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request roadmap This issue represents a major topic on the Jenkinsfile Runner roadmap
Projects
Status: 🔖 Ready
Status: In progress / Preview
3 participants