• Plugin Management tooling

      Jenkins does offer a web UI to manage plugin installation from a live master instance, but in many deployments administrator would like to control installed plugins by version and by tooling, before jenkins master starts.

      • docker official image provides an install-plugins.sh script which evolved far beyond its initial "help script" scope.
      • configuration-as-code implemented plugin installation hack based on PluginSite.Plugin#deploy. (Removed as of v1.8 of JCasC plugin)
      • open-source update center does expose plugins-version.json on casc request so one can manage versions for all hosted plugins, not just latest
      • custom war packager does support plugin installation on his own
      • jenkins evergreen does manage plugin installation based on updates from metadata server, using his own logic implemented by nodejs evergreen client.
      • jenkinsfile-runner does manage plugin installation implemented in Go
      • coreOS provides a groovy script to handle required plugins
      • cloudbees DEV@Cloud uses a set of Chef Ruby recipes for the same purpose
      • etc

       

      Everybody is re-inventing the wheel, partially implementing the "details" of plugin management (signed metadata, artifacts checksums, plugins detached from core, ...). It becomes obvious Jenkins should provide adequate tooling for plugin installation outside a live Jenkins instance. 

          [JENKINS-53767] Offer plugin management tooling

          Nicolas De Loof created issue -

          Oleg Nenashev added a comment -

          Thanks for submitting it ndeloof! I totally agree we should streamline it at some point and offer a single solution

          Oleg Nenashev added a comment - Thanks for submitting it ndeloof ! I totally agree we should streamline it at some point and offer a single solution
          Baptiste Mathus made changes -
          Description Original: Jenkins do offer a web UI to manage plugin installation from a live master instance, but in many deployment administrator would like to control installed plugins by version and by tooling, before jenkins master starts.
           * docker official image provides an install-plugins.sh script which evolved far beyond it's initial "help script" scope.
           * configuration-as-code implemented plugin installation hack based on PluginSite.Plugin#deploy.
           * open-source update center do expose plugins-version.json on casc request so one can manage versions for all hosted plugins, not just latest
           * custom war packager do support plugin installation on his own
           * jenkins evergreen do manage plugin installation based on updates from metadata server, using his own logic implemented by nodejs evergreen client.
           * jenkinsfile-runner do manage plugin installation implemented in Go
           * coreOS provides a [groovy script|https://github.com/coreos/jenkins-os/blob/master/init.groovy] to handle required plugins
           * cloudbees DEV@Cloud uses a set of Chef Ruby recipes for the same purpose
           * etc

           

          Everybody is re-inventing the wheel, partially implementing the "details" of plugin management (signed metadata, artifacts checksums, plugins detached from core, ...). It becomes obvious Jenkins should provide adequate tooling for plugin installation _outside_ jenkins live instance. 
          New: Jenkins does offer a web UI to manage plugin installation from a live master instance, but in many deployments administrator would like to control installed plugins by version and by tooling, before jenkins master starts.
           * docker official image provides an install-plugins.sh script which evolved far beyond its initial "help script" scope.
           * configuration-as-code implemented plugin installation hack based on PluginSite.Plugin#deploy.
           * open-source update center does expose plugins-version.json on casc request so one can manage versions for all hosted plugins, not just latest
           * custom war packager does support plugin installation on his own
           * jenkins evergreen does manage plugin installation based on updates from metadata server, using his own logic implemented by nodejs evergreen client.
           * jenkinsfile-runner does manage plugin installation implemented in Go
           * coreOS provides a [groovy script|https://github.com/coreos/jenkins-os/blob/master/init.groovy] to handle required plugins
           * cloudbees DEV@Cloud uses a set of Chef Ruby recipes for the same purpose
           * etc

           

          Everybody is re-inventing the wheel, partially implementing the "details" of plugin management (signed metadata, artifacts checksums, plugins detached from core, ...). It becomes obvious Jenkins should provide adequate tooling for plugin installation _outside_ jenkins live instance. 

          James Strachan added a comment - - edited

          I'm a big fan of GitOps and using source code to define what version of jenkins core, dockerfile, plugins and their versions etc that folks wanna use. Then to upgrade a plugin/core its a Pull Request.

          It'd be nice to enumerate all the different ways folks configure jenkins core + plugins + versions via source code to generate/setup their Jenkins server.

          e.g. there's the classic Dockerfile + plugins.txt approach like this...

          https://github.com/garethjevans/jenkins-quickstart01/tree/master/jenkinsConfig/departmentFoo/teamA

          or there's Custom War Packager style:

          https://github.com/garethjevans/jenkins-cwp-quickstart01/blob/master/packager-config.yml#L11

          then there's CasC YAML too.

           

          It shouldn't be too hard to handle those 3 source code formats.  

          Then we could create a plugin for updatebot https://github.com/jenkins-x/updatebot/ to automate the generation of PRs for folks using GitOps to upgrade jenkins and/or plugins using either Evergreen,  incrementals:  https://repo.jenkins-ci.org/incrementals/ or releases: https://repo.jenkins-ci.org/releases/

           

          James Strachan added a comment - - edited I'm a big fan of GitOps and using source code to define what version of jenkins core, dockerfile, plugins and their versions etc that folks wanna use. Then to upgrade a plugin/core its a Pull Request. It'd be nice to enumerate all the different ways folks configure jenkins core + plugins + versions via source code to generate/setup their Jenkins server. e.g. there's the classic Dockerfile + plugins.txt approach like this... https://github.com/garethjevans/jenkins-quickstart01/tree/master/jenkinsConfig/departmentFoo/teamA or there's Custom War Packager style: https://github.com/garethjevans/jenkins-cwp-quickstart01/blob/master/packager-config.yml#L11 then there's CasC YAML too.   It shouldn't be too hard to handle those 3 source code formats.   Then we could create a plugin for updatebot https://github.com/jenkins-x/updatebot/  to automate the generation of PRs for folks using GitOps to upgrade jenkins and/or plugins using either Evergreen,  incrementals:  https://repo.jenkins-ci.org/incrementals/  or releases:  https://repo.jenkins-ci.org/releases/  
          James Strachan made changes -
          Assignee New: James Strachan [ jstrachan ]

          Part of the problem here is that those tools rely on the Update Center layout to bake download URL for version of plugins to install, while this layout is not defined by a spec.

          So we need

          1. define|document the plugin update center mechanism (metadata signature, how to retrieve hosted plugin versions and download URL, ...)
          2. offer an implementation that can be used in various installation context

          For (2) I'd like we extract PluginManager into a standalone executable jar so

          •  it can run as a CLI jar and been used in docker images as a replacement for install-plugins script
          • it can be used by custom war packager as an utility library to implement the same need
          • the exact same bits are used by jenkins PluginManager (to enforce consistency)

          Nicolas De Loof added a comment - Part of the problem here is that those tools rely on the Update Center layout to bake download URL for version of plugins to install, while this layout is not defined by a spec. So we need define|document the plugin update center mechanism (metadata signature, how to retrieve hosted plugin versions and download URL, ...) offer an implementation that can be used in various installation context For (2) I'd like we extract PluginManager into a standalone executable jar so  it can run as a CLI jar and been used in docker images as a replacement for install-plugins script it can be used by custom war packager as an utility library to implement the same need the exact same bits are used by jenkins PluginManager (to enforce consistency)

          Baptiste Mathus added a comment - - edited

          FWIW, CWP and Evergreen are using (no enforcement/checker yet, so there's probably smallish discrepancies) both use the Bill Of Materials JEP-309: https://github.com/jenkinsci/jep/tree/master/jep/309.

          So we already have the standard format defined. So we should all use it. And if by chance it's deemed to miss some things, then JEP-309 should just be amended so that we agree on something. I agree with ndeloof this subject of handling Jenkins dependencies is becoming wasteful, fluffier and fluffier with all these variants, and should become a tool on its own so that people stop rewriting the (square) wheel everywhere.

          I've thought about all this just a bit and I wonder technically this should be:

          • I find a tool like this would be good to be usable everwhere easily using CLI, so writing it in Go seems a good direction
          • at the same time, Jenkins ecosystem and consumers would probably need it in Java. Ideally, in that case, even Jenkins core associated logic could be extracted (cannot judge of the associated complexity though) so that really everyone use the same resolver tool. A CLI usable packaged version of this tooling (fatjar or whatever) could then be used:

          Like for Maven dependencies, we need a tool able to:

          • compute a dependency tree without (or with as few as possible) downloads
          • download a whole dependency tree (including optional dependencies or not, here lies some combinatorial too).

          Baptiste Mathus added a comment - - edited FWIW, CWP and Evergreen are using (no enforcement/checker yet, so there's probably smallish discrepancies) both use the Bill Of Materials JEP-309: https://github.com/jenkinsci/jep/tree/master/jep/309 . So we already have the standard format defined. So we should all use it. And if by chance it's deemed to miss some things, then JEP-309 should just be amended so that we agree on something. I agree with ndeloof this subject of handling Jenkins dependencies is becoming wasteful, fluffier and fluffier with all these variants, and should become a tool on its own so that people stop rewriting the (square) wheel everywhere. I've thought about all this just a bit and I wonder technically this should be: I find a tool like this would be good to be usable everwhere easily using CLI, so writing it in Go seems a good direction at the same time, Jenkins ecosystem and consumers would probably need it in Java. Ideally, in that case, even Jenkins core associated logic could be extracted (cannot judge of the associated complexity though) so that really everyone use the same resolver tool. A CLI usable packaged version of this tooling (fatjar or whatever) could then be used: in the Docker image builds in Evergreen generation of resolved ingest.json from the essentials.yaml from Jenkins-X's updatebot from CWP ... Like for Maven dependencies, we need a tool able to: compute a dependency tree without (or with as few as possible) downloads download a whole dependency tree (including optional dependencies or not, here lies some combinatorial too).

          Jesse Glick added a comment -

          There is already a tool which understands how to update versions of components including incremental versions from a specified branch (such as origin master); as per JENKINS-51929, it would “just” need a shim to also read/write the JEP-309 format. That is only going to be useful, however, if the file is actually listing all the plugins you are bundling, as discussed in JENKINS-53506.

          Jesse Glick added a comment - There is already a tool which understands how to update versions of components including incremental versions from a specified branch (such as origin master ); as per JENKINS-51929 , it would “just” need a shim to also read/write the JEP-309 format. That is only going to be useful, however, if the file is actually listing all the plugins you are bundling, as discussed in JENKINS-53506 .
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-51929 [ JENKINS-51929 ]
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-53506 [ JENKINS-53506 ]

            stopalopa Natasha Stopa
            ndeloof Nicolas De Loof
            Votes:
            11 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: