On Sun, 11 Apr 2021 22:40:59 +0300
Povilas Kanapickas <povi...@radix.lt> wrote:

[...]

> In the past I've implemented support for a similar feature where I
> Buildbot would suspend the host a worker is running on in order to
> reduce noise and electricity costs. I haven't upstreamed all of this
> work yet.
> 
> It was quite a generic implementation, there's an arbitrary command to
> start a machine and an arbitrary command to stop it. So you
> potentially could hook this to start/stop Jenkins jobs.

Hi Povilas.

It is easy to see how the start command would fit the solution space
(request the web hook URL when the master has a build request and is
ready to use the worker, not immediately when any change had happened).

I guess the stop command would also request an URL, this time from
the master HTTP API to initiate a graceful shutdown for the worker, is
this correct?

Having written that, I suspect that the start and the stop commands do
not need to be in the master or the worker code base. It could be a
standalone cron job that uses the master HTTP API as follows:

---------------------------------------------------------------
w = the worker behind Jenkins
if (w is offline AND has pending build requests)
{
  use Jenkins web hook to start the build that starts the worker
}
elif (w is online AND has no pending build requests)
{
  use the master HTTP API to request a graceful shutdown for the worker
}
---------------------------------------------------------------

Would that be a better solution?

-- 
    Denis Ovsienko
_______________________________________________
users mailing list
users@buildbot.net
https://lists.buildbot.net/mailman/listinfo/users

Reply via email to