Greetings all. I’ve seen a few related posts and questions on the web, but nothing verbose or particularly concrete.
Objective
I want a CI pipeline entirely defined by my plugin, without consuming config from userspace, such as a Jenkinsfile
. The only initial build step is my-plugin
, and it creates a CI plan (collection of tasks), allocates nodes/executors, and feeds work to workers (a pull system vs a push system) until all of the work distributed and completed.
Specifically, the plugin shall host the following capabilities:
- derive the tasks needed to execute. Consider this work a black-box for now. I’ll shell out to some toolkit for this.
- Reserve N nodes from my compute pool
- For node n in N nodes, for each executor e in n, request work from the controller and execute it in parallel, until the the controller has no work remaining.
Discussion
- The ability to schedule work into the current build/run isn’t entirely clear to me yet. Some internet searches have suggested “the best you can do is trigger another job”, but surely their must be a way to programmatically add steps into the current run?
- (p.s. I’m a baby jenkins plugin dev if it’s not already obvious. I’ve merely completed the HelloWorld plugin dev-ux, but happy to report that it went off without a hitch
)
- (p.s. I’m a baby jenkins plugin dev if it’s not already obvious. I’ve merely completed the HelloWorld plugin dev-ux, but happy to report that it went off without a hitch
- How does one inspect the jenkins agent pool and those agents’ capabilities in-plugin?
- A stretch goal would be to be able to efficiently transport build artifacts between child tasks running on different nodes/workspaces without some intermediate cache provider!
I’m not looking for anyone to dev this for me (obviously), but, I am seeking advice from plugin author veterans. Help me with APIs, or even an opinionated roadmap for what low-level jenkins resources I’ll need to stitch together, what lifecycle hooks to plug into, points of friction you think I’ll encounter… etc etc.
Thanks for your time!