You could use the lockable resources plugin (v2.2+):
Set up a single resource for each node and give them all a common label
Then your Jenkinsfile would be:
lock(label: "common-label", variable: "LOCKED_NODE"){
node(env.LOCKED_NODE){
//build project
}
}
Regards,
Daniel.
On Thu, Jan 31, 2019 at 7:48 AM Vitaly Karasik <[email protected]> wrote:
> I'd like to mark *whole* pipeline job as throttling resource; and unlike
> freestyle jobs, Throttleling plugin does't know to do that. I.e. I cannot
> use "throttle" in pipeline options.
>
> On Wednesday, January 30, 2019 at 7:47:20 PM UTC+2, Den Slobozhanskyi
> wrote:
>>
>> Just to clarify - does it mean that Throttling plugin throttles not the
>> job as a whole, but each step in parallel? My assumption was that
>> throttling is only for the job, and nested threads have nothing to do with
>> throttle. By your words it looks like setting throttling to "1" for the job
>> reduce the possible parallel threads execution to a single thread at a time
>> as well, is that true?
>>
>> If this is not true, you just gather all the jobs under one throttling
>> category and set the concurrent builds limit to 1.
>>
>> BR,
>> Denys
>>
>> среда, 30 января 2019 г., 14:17:15 UTC+1 пользователь Vitaly Karasik
>> написал:
>>>
>>> I have multibranch job, whole pipeline runs on certain node.
>>>
>>> Currently I have a slaves with single executor, so multiple jobs cannot
>>> run on the same node. I'd like to use parallel steps inside my pipeline, so
>>> I need to increase number of executors.
>>>
>>> What is the best way to prevent concurrent job execution?
>>>
>>> Such configuration was trivial with Jenkins freestyle job and Throttling
>>> plugin - I simple used "Maximum Concurrent Builds Per Node". But in
>>> pipeline it seems that I cannot use "throttle" for whole pipeline, I need
>>> to use it for each step. Is there more elegant solution?
>>>
>>> TIA, Vitaly
>>>
>> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/d6b76faf-f9e6-4960-8dc5-ab79c6c6ac0f%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/d6b76faf-f9e6-4960-8dc5-ab79c6c6ac0f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/CAO37hbgQQWsggy8VdYxnn6RhWmYP%3DVBh4A%3D8JxO-etH6iOSpTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.