Jenkins - Throttle build to run on ONE job per available Node

Viewed 679

I have 2 Nodes (one has 4 executors), I want one of my pipeline jobs to be restricted to only running one job on each node, if the job runs concurrently on the same node then it will fail. I'm using the throttle builds plugin but it doesn't work. Here's my code

    agent { label 'release-smoke-tests' }
options {
    throttleJobProperty(
        categories: [],
        limitOneJobWithMatchingParams: true,
        maxConcurrentPerNode: 1,
        maxConcurrentTotal: 2,
        throttleEnabled: true,
        throttleOption: 'project'
    )
}

With these settings the job will still run twice concurrently on a single Node, even though I have maxConcurrentPerNode set to 1!

Thanks for the help and please don't suggest using disableConcurrentBuilds() because I want them to run concurrently just not on the same build Agent. And I'd like to not limit the amount executors to 1 as they are needed for other tasks. Thanks again.

0 Answers
Related