1
votes

In our steps towards Continuous Integration we split the build job into two parts:

  1. Fast running essentials
  2. Slower heavy tasks

The goal is to always have the first one run through in less than 10 minutes and only contains build, unit-test and deploy to artifact-repository. The second one may also take hours.

Currently we have one master that is handling everything, no slaves. The master has two executors. This can not be changed.

What I want to do is make the heavy one wait for two slots to be open in order to assure there is always one executor available for fast running tasks.

Heavy may run:

FastJob: -------xxxxxxxx---------xxxxx-------xxxxx------xxxxxxx-

LongJob: ---xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-----------------

Heavy has to wait:

FastJob: --xxxxxx--xxxxxxxx---------xxxxx-------xxxxx-----------

LongJob: ---wwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-----------

--- = nothing
xxx = executing build
www = waiting

I already looked at the Heavy Job Plugin, however that does not solve this issue as it blocks both executors afterwards. The heavy job shall wait until two executors are free and then only block one.


Also see the follow up question about the reservation of x% of the executors.

1

1 Answers

1
votes

Well, you can just block LongJob when any other job is running with Build Blocker Plugin:

This plugin keeps the actual job in the queue if at least one name of currently running jobs is matching with one of the given regular expressions.

LongJob will not run until both executors become available.