Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Timeout before trying to provision a new agent

33 views
Skip to first unread message

Alex Earl

unread,
Dec 9, 2024, 8:24:52 AM12/9/24
to Jenkins Developer List
Hi everyone,

I developed a plugin for use in house at my company to launch ephemeral agents on our internal cloud infrastructure. One thing I am seeing is that when it takes more than a few seconds to launch an agent (which is expected), I see several agents being created by Jenkins for a single task. Is there an API that will allow me to specify a timeout for Jenkins to expect an agent to be up and running?

Thanks,

slide

Jesse Glick

unread,
Dec 9, 2024, 5:32:27 PM12/9/24
to jenkin...@googlegroups.com
On Mon, Dec 9, 2024 at 8:25 AM Alex Earl <slide...@gmail.com> wrote:
when it takes more than a few seconds to launch an agent (which is expected), I see several agents being created by Jenkins for a single task

Offhand it sounds like you are not using https://javadoc.jenkins.io/hudson/slaves/Cloud.CloudState.html#getAdditionalPlannedCapacity() correctly, or otherwise misimplementing https://javadoc.jenkins.io/hudson/slaves/Cloud.html#provision(hudson.slaves.Cloud.CloudState,int) to provision more nodes than are actually being requested.

I had somebody else asking recently about implementing `Cloud`. It is not trivial. Would be nice to start with a known-good implementation (say, that in `kubernetes`) and create a plugin which lets you as the admin define CLI commands to provision or destroy agent infrastructure, with some environment variables being used to define the agent name etc. (There is https://plugins.jenkins.io/scripted-cloud-plugin/ but it is way out of date.) As an alternative to running processes on the controller account, it could support launching Docker or Kubernetes containers.
Reply all
Reply to author
Forward
0 new messages