[users at bb.net] Buildbot worker in Jenkins

Povilas Kanapickas povilas at radix.lt
Sun Apr 11 21:34:08 UTC 2021


On 4/11/21 11:08 PM, Denis Ovsienko wrote:
> On Sun, 11 Apr 2021 22:40:59 +0300
> Povilas Kanapickas <povilas at 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?
> 

I will check what code I have and create a PR if it rebases cleanly to
newer Buildbot. Then we have something concrete to discuss and it will
be clear how it could address your problem.

Cheers,
Povilas


More information about the users mailing list