New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throttling flyweight tasks #34
base: master
Are you sure you want to change the base?
Conversation
Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests. |
needs a review |
Hi all. The problem I ran into in detail: I have a job (batch) which starts several parametrized instances of another job (compile). I want to limit the number of nodes the compile job runs on, so I configured it with throttle-concurrent: pipelineJob("Compile")
{
concurrentBuild(true);
throttleConcurrentBuilds {
maxPerNode(1)
maxTotal(3)
}
parameters {
stringParam('TARGET', 'TGT', 'The target to compile')
}
environmentVariables {
keepSystemVariables(true);
keepBuildVariables(true);
}
definition {
cps {
script(readFileFromWorkspace('pipelines/compile.groovy'))
}
} If I start them manually, the throttling works. The batch job is another pipeline definition: def targets=["TGT1","TGT2","TGT3","TGT4","TGT5"]
def jobs=[:]
for(int i = 0; i < targets.size(); i++)
{
def target= targets.get(i)
println "triggering compilation for ${targets}"
jobs[region]={
build job: 'Compile', parameters: [[$class: 'StringParameterValue', name: 'TARGET', value: region]]
}
}
parallel jobs When this is triggered then I get all 5 compile jobs running immediately where I would expect execution to be throttled down to 3 nodes |
Hi @damphyr |
I doubt it completely solves the throttling topic, at least for Sorry about dropping a ball on it. |
Hi, I've merged master into our branch and made some minor improvements. Could you please review it? |
any update??? |
@damphyr can you check if adding quietPeriod to build() doesn't help accidently? |
Hi,
This pull request enables throttling flyweights tasks. No new UI's added, but now if a user turns on throttling for a flyweight job, it works.
Some bits of explanation:
I realise the implementation's somewhat unusual. But I spent some time studying the Jenkins code and didn't found any other options to throttle flyweight tasks. Probably throttling flyweights usually doesn't make much sense. But we have real cases when it does.
Please, share your thoughts.