There is a concept of a Resource within Jenkins and jobs can be marked as using N of that number of the Resource instances, and you can declare how many total instances of the resource exist.
Jenkins will stall builds until they can get the required number of those resources. The locks and latches plugin uses this with resources of size 1 to implement locks... Beware there are bugs in the Resource model that to my knowledge have never been fixed (these are mostly seen as "bugs in locks and latches" but actually are issues in core) have a look at the issues in the locks and latches plugin to see if they are things you can live with before you start down that road though On Thursday, 31 October 2013, AndyB wrote: > Hi > > I have a question about how to manage limited resources (actually software > licences). Say I have a pool of machines M, a subset of the those > machines, S, are able to run licenced software, however only N licences can > be used concurrently. I know (thanks to an earlier reply), that I can use a > label parameter to ensure the jobs only run on the appropriate machines, is > there any mechanism to ensure that only N jobs can run at any time? (It > sounds like a reference counted resource problem) > > I can make S == N, but that doesn't result in the best distribution of > jobs (esp. when N is small) as a machine S could be running a job that > doesn't require a licence causing the job that requires the licence to > queue waiting for it to become available while other resources could > potentially be used. Is there a good way to manage this scenario? > > Thanks, > Andy > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:_e({}, > 'cvml', 'jenkinsci-users%[email protected]');>. > For more options, visit https://groups.google.com/groups/opt_out. > -- Sent from my phone -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
