[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread jgrant...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeff G edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I honestly did not have much hope when I saw this issue having been updated in my e-mail this morning.[~marcus_phi], I'll second your comment/excitement on finally having a solution to this mystery. (flag)[~metamilk], thank you so much! (y)Our team already has our declarative and scripted pipelines largely live in libraries.  I gave a couple attempts to implement the throttle as described by [~metamilk] and here is a little more on how I think I'll `throttle` in our builds by renaming {{sharedPipeline}} to {{sharedPipelineInner}} and having {{sharedPipeline}} wrap the throttle category around the {{sharedPipeline()}} call.  This way, I don't need to update 100+ repositories * number of branches. The current {{Jenkinsfile}} looks like this more or less...{code:java}// library importssharedPipeline(){code}vars/sharedPipeline.groovy{code:java}def call() {  throttle(['throttle-category']) {sharedPipelineInner()  }}{code}vars/sharedPipelineInner.groovy{code:java}def call() {  pipeline {  agent { label 'mylabel' }  stages {stage('first') {  steps { sleep 60  }}  }}{code} I did try to simply shift the pipeline config into a {{def}} within the original file, but that did not work.This defect asks for {{throttle}} within a step, which this solution does not provide, so I guess it will need to stay open.  The docs for the plugin should be updated, for sure, with an example like this. Edit - Then again, the title says _entire build_ so maybe this solution does apply and the example in the body does not. [~anthonymastrean], can you comment?  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread jgrant...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeff G edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I honestly did not have much hope when I saw this issue having been updated in my e-mail this morning.[~marcus_phi], I'll second your comment/excitement on finally having a solution to this mystery. (flag)[~metamilk], thank you so much! (y)Our team already has our declarative and scripted pipelines largely live in libraries.  I gave a couple attempts to implement the throttle as described by [~metamilk] and here is a little more on how I think I'll `throttle` in our builds by renaming {{sharedPipeline}} to {{sharedPipelineInner}} and having {{sharedPipeline}} wrap the throttle category around the {{sharedPipeline()}} call.  This way, I don't need to update 100+ repositories * number of branches. The current {{Jenkinsfile}} looks like this more or less...{code:java}// library importssharedPipeline(){code}vars/sharedPipeline.groovy{code:java}def call() {  throttle(['throttle-category']) {sharedPipelineInner()  }}{code}vars/sharedPipelineInner.groovy{code:java}def call() {  pipeline {  agent { label 'mylabel' }  stages {stage('first') {  steps { sleep 60  }}  }}{code}  I did try to simply shift the pipeline config into a {{def}} within the original file, but that did not work. This defect asks for {{throttle}} within a step, which this solution does not provide, so I guess it will need to stay open.  The docs for the plugin should be updated, for sure, with an example like this.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this mess

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread jgrant...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeff G edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I honestly did not have much hope when I saw this issue having been updated in my e-mail this morning.[~marcus_phi], I'll second your comment/excitement on finally having a solution to this mystery. (flag)[~metamilk], thank you so much! (y)Our team already has our declarative and scripted pipelines largely live in libraries.  I gave a couple attempts to implement the throttle as described by [~metamilk] and here is a little more on how I think I'll `throttle` in our builds by renaming {{sharedPipeline}} to {{sharedPipelineInner}} and having {{sharedPipeline}} wrap the throttle category around the {{sharedPipeline()}} call.  This way, I don't need to update 100+ repositories * number of branches. The current {{Jenkinsfile}} looks like this more or less... {code:java}// library imports  sharedPipeline() {code}  vars/sharedPipeline.groovy{code:java}def call() {  throttle(['throttle-category']) {sharedPipelineInner()  }}{code}vars/sharedPipelineInner.groovy{code:java}def call() {  pipeline {  agent { label 'mylabel' }  stages {stage('first') {  steps { sleep 60  }}  }}{code} This defect asks for {{throttle}} within a step, which this solution does not provide, so I guess it will need to stay open.  The docs for the plugin should be updated, for sure, with an example like this.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this grou

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread jgrant...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeff G edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I honestly did not have much hope when I saw this issue having been updated in my e-mail this morning.[~marcus_phi], I'll second your comment/excitement on finally having a solution to this mystery. (flag)[~metamilk], thank you so much! (y)   Our team already has our declarative and scripted pipelines largely live in libraries.  I gave a couple attempts to implement the throttle as described by [~metamilk] and here is a little more on how I think I'll `throttle` in our builds by renaming {{sharedPipeline}} to {{sharedPipelineInner}} and having {{sharedPipeline}} wrap the throttle category around the {{sharedPipeline()}} call.  This way, I don't need to update 100+ repositories * number of branches. The current {{Jenkinsfile}} looks like this more or less... sharedPipeline() vars/sharedPipeline.groovy{code:java}def call() {  throttle(['throttle-category']) {sharedPipelineInner()  }}{code}vars/sharedPipelineInner.groovy{code:java}def call() {  pipeline {  agent { label 'mylabel' }  stages {stage('first') {  steps { sleep 60  }}  }}{code} This defect asks for {{throttle}} within a step, which this solution does not provide, so I guess it will need to stay open.  The docs for the plugin should be updated, for sure, with an example like this.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it,

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread jgrant...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeff G edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I honestly did not have much hope when I saw this issue having been updated in my e-mail this morning.[~marcus_phi], I'll second your comment/excitement on finally having a solution to this mystery. (flag)[~metamilk], thank you so much! (y) Our team already has our declarative and scripted pipelines largely live in libraries.  I gave a couple attempts to implement the throttle as described by [~metamilk] and here is a little more on how I think I'll `throttle` in our builds by renaming {{sharedPipeline}} to {{sharedPipelineInner}} and having {{sharedPipeline}} wrap the throttle category around the {{sharedPipeline()}} call.  This way, I don't need to update 100+ repositories * number of branches. The current {{Jenkinsfile}} looks like this more or less... sharedPipeline() vars/sharedPipeline.groovy{code:java}def call() {  throttle(['throttle-category']) {sharedPipelineInner()  }}{code}vars/sharedPipelineInner.groovy{code:java}def call() {  pipeline {  agent { label 'mylabel' }  stages {stage('first') {  steps { sleep 60  }}  }}{code}  This way, no {{Jenkinsfile}} will need to be updated and they will all be throttled for free.    This defect asks for {{throttle}} within a step, which this solution does not provide, so I guess it will need to stay open.  The docs for the plugin should be updated, for sure, with an example like this.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google 

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread jgrant...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeff G edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I honestly did not have much hope when I saw this issue having been updated in my e-mail this morning.[~marcus_phi], I'll second your comment/excitement on finally having a solution to this mystery. (flag)[~metamilk], thank you so much! (y) Our team already has our declarative and scripted pipelines largely live in libraries.  I gave a couple attempts to implement the throttle as described by [~metamilk] and here is a little more on how I think I'll `throttle` in our builds by renaming {{sharedPipeline}} to {{sharedPipelineInner}} and having {{sharedPipeline}} wrap the throttle category around the {{sharedPipeline()}} call.  This way, I don't need to update 100+ repositories * number of branches. The current {{Jenkinsfile}} looks like this more or less... sharedPipeline() vars/sharedPipeline.groovy{code:java}def call() {  throttle(['throttle-category'])    {   sharedPipelineInner()   }}{code}vars/sharedPipelineInner.groovy{code:java}def call() {  pipeline {  agent { label 'mylabel' }  stages {stage('first') {  steps { sleep 60  }}  }}{code} This way, no {{Jenkinsfile}} will need to be updated and they will all be throttled for free. This defect asks for {{throttle}} within a step, which this solution does not provide, so I guess it will need to stay open.  The docs for the plugin should be updated, for sure, with an example like this.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google G

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread jgrant...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeff G edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I honestly did not have much hope when I saw this issue having been updated in my e-mail this morning.[~marcus_phi], I'll second your comment/excitement on finally having a solution to this mystery. (flag)[~metamilk], thank you so much! (y) Our team already has our declarative and scripted pipelines largely live in libraries.  I gave a couple attempts to implement the throttle as described by [~metamilk] and here is a little more on how I think I'll `throttle` in our builds by renaming {{sharedPipeline}} to {{sharedPipelineInner}} and having {{sharedPipeline}} wrap the throttle category around the {{sharedPipeline()}} call.  This way, I don't need to update 100+ repositories * number of branches. The current {{Jenkinsfile}} looks like this more or less... sharedPipeline() vars/sharedPipeline.groovy{code:java}def call() {  throttle(['throttle-category'])  { sharedPipelineInner() }}{code}vars/sharedPipelineInner.groovy{code:java}def call() {  pipeline {  agent    { label 'mylabel' }  stages {stage('first') {  steps  {sleep 60  }   }}  }}{code}    This way, no {{Jenkinsfile}} will need to be updated and they will all be throttled for free. This defect asks for {{throttle}} within a step, which this solution does not provide, so I guess it will need to stay open.  The docs for the plugin should be updated, for sure, with an example like this.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the 

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread jgrant...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeff G edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I honestly did not have much hope when I saw this issue having been updated in my e-mail this morning.[~marcus_phi], I'll second your comment/excitement on finally having a solution to this mystery. (flag)[~metamilk], thank you so much! (y) Our team already has our declarative and scripted pipelines largely live in libraries.  I gave a couple attempts to implement the throttle as described by [~metamilk] and here is a little more on how I think I'll `throttle` in our builds by renaming {{sharedPipeline}} to {{sharedPipelineInner}} and having {{sharedPipeline}} wrap the throttle category around the {{sharedPipeline()}} call.  This way, I don't need to update 100+ repositories * number of branches. The current {{Jenkinsfile}} looks like this more or less... sharedPipeline() vars/sharedPipeline.groovy ``` {code:java}   def call() { throttle(['throttle-category'])  { sharedPipelineInner() } }  {code } ``` vars/sharedPipelineInner.groovy {code:java}  def call() { pipeline { agent  { label 'mylabel' }  stages { stage('first') { steps  { sleep 60 }   } } } } {code  }    This way, no {{Jenkinsfile}} will need to be updated and they will all be throttled for free. This defect asks for {{throttle}} within a step, which this solution does not provide, so I guess it will need to stay open.  The docs for the plugin should be updated, for sure, with an example like this.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Googl

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread jgrant...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeff G edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I honestly did not have much hope when I saw this issue having been updated in my e-mail this morning.[~marcus_phi], I'll second your comment/excitement on finally having a solution to this mystery. (flag)[~metamilk], thank you so much! (y) Our team already has our declarative and scripted pipelines largely live in libraries.  I gave a couple attempts to implement the throttle as described by [~metamilk] and here is a little more on how I think I'll `throttle` in our builds by renaming {{sharedPipeline}} to {{sharedPipelineInner}} and having {{sharedPipeline}} wrap the throttle category around the {{sharedPipeline()}} call.  This way, I don't need to update 100+ repositories * number of branches. The current {{Jenkinsfile}} looks like this more or less...sharedPipeline()vars/sharedPipeline.groovy ``` def call() {throttle(['throttle-category'])  {  { sharedPipelineInner()  }  } ``` vars/sharedPipelineInner.groovydef call() {pipeline {agent   { label 'mylabel' }  stages {stage('first')  \ {steps  {  { sleep 60  }  }}}} This way, no {{Jenkinsfile}} will need to be updated and they will all be throttled for free. This defect asks for {{throttle}} within a step, which this solution does not provide, so I guess it will need to stay open.  The docs for the plugin should be updated, for sure, with an example like this.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   


[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread jgrant...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeff G commented on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I honestly did not have much hope when I saw this issue having been updated in my e-mail this morning. Marcus Philip, I'll second your comment/excitement on finally having a solution to this mystery.  Dmitry Mamchur, thank you so much!    Our team already has our declarative and scripted pipelines largely live in libraries.  I gave a couple attempts to implement the throttle as described by Dmitry Mamchur and here is a little more on how I think I'll `throttle` in our builds by renaming sharedPipeline to sharedPipelineInner and having sharedPipeline wrap the throttle category around the sharedPipeline() call.  This way, I don't need to update 100+ repositories * number of branches.  The current Jenkinsfile looks like this more or less... sharedPipeline() vars/sharedPipeline.groovy def call() { throttle(['throttle-category'])  { sharedPipelineInner() } } vars/sharedPipelineInner.groovy def call() { pipeline { agent  { label 'mylabel' }  stages { stage('first') { steps  { sleep 60 }  } } } }  This way, no Jenkinsfile will need to be updated and they will all be throttled for free.   This defect asks for throttle within a step, which this solution does not provide, so I guess it will need to stay open.  The docs for the plugin should be updated, for sure, with an example like this.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails f

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread marcus.a.phi...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Marcus Philip commented on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 Je-s F-ng C-st! It's insane that that would make a difference but it does. So the 'pipeline block must be at the top-level' check is just on a file (textual) basis, not on the actual code structure. Thanks Dmitry Mamchur! You made my day!  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.183244.1498502397000.5784.1585908180730%40Atlassian.JIRA.


[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread marcus.a.phi...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Marcus Philip edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I tried [~metamilk]s creative suggestion but on more recent versions this is explicitly prohibited:  {noformat}WorkflowScript: 2: pipeline block must be at the top-level, not within another block. @ line 2, column 5.   pipeline {   ^{noformat}  h3. Demo pipeline:{code: groovy java } throttle(['myThrottle']) {pipeline {agent { label 'mylabel' }stages {stage('first') {steps {sleep 60}}}}}{code}  I've tested many other variants and I claim it is currently (with latest versions) impossible to get node throttling on a declarative pipeline. If someone has a counterexample I would appreciate that.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.183244.1498502397000.5750.1585907640734%40Atlassian.JIRA.


[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread metaphysical.intoxicat...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dmitry Mamchur commented on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 Marcus Philip The secret sauce is having your pipeline defined in a shared library. vars/myPipeline.groovy 

 

def call() {
pipeline {
agent { label 'mylabel' }
stages {
stage('first') {
steps {
sleep 60
}
}
}
}
} 

 jobs/my-pipeline/Jenkinsfile 

 

throttle(['myThrottle']) {
myPipeline()
} 

  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.183244.1498502397000.5720.1585907460719%40Atlassian.JIRA.


[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2020-04-03 Thread marcus.a.phi...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Marcus Philip commented on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I tried Dmitry Mamchurs creative suggestion but on more recent versions this is explicitly prohibited: 

 
WorkflowScript: 2: pipeline block must be at the top-level, not within another block. @ line 2, column 5.
   pipeline {
   ^
 

 Demo pipeline: 

 

 throttle(['myThrottle']) {
pipeline {
agent { label 'mylabel' }
stages {
stage('first') {
steps {
sleep 60
}
}
}
}
}
 

  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.183244.1498502397000.5687.158590650075

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2019-10-11 Thread median...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Nick Jones commented on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I'm seeing what Guy Banay sees. I'm now testing a Declarative Pipeline workaround as Kyle Walker suggested – namely, putting the properties block outside the pipeline altogether – and it works, but it only honors the maxConcurrentTotal property, not the maxConcurrentNode one. Very simple repro (assuming a "ThrottleTest" category is configured globally): 

 

properties([
  [
$class: 'ThrottleJobProperty',
categories: ['ThrottleTest'],
throttleEnabled: true,
throttleOption: 'category'
  ],
])

pipeline {
agent any
stages {
stage('Long-running') {
steps {
input message: 'Shall we continue?'
echo "Thanks! Continuing."
}
}
}
}
 

 If I configure a maximum of 5 concurrent builds across all nodes, but only 1 per node, the only limit enforced is the total limit; a single build agent can still run as many builds of this job as it has executors. Only the maxConcurrentTotal takes effect.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, se

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2019-07-29 Thread guy.ba...@zerto.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Guy Banay commented on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 Hi, Any update with this issue? The property "maxConcurrentPerNode" is not working   Thanks    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.183244.1498502397000.2675.1564400162400%40Atlassian.JIRA.


[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2019-04-18 Thread median...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Nick Jones commented on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 I had to revert back to a scripted pipeline in order to get throttling to work as intended. The issue seems to be that the throttle option in a Declarative pipeline occurs on a particular agent node, and it's either too late – the executor is already consumed – or it's simply a no-op, but in any case, I'm not seeing any actual evidence of throttling, either overall or per node. 

 

pipeline {
  agent { label 'foo' }
  options {
throttle(categories: ['MyCategory']) // <-- doesn't do anything, even with MyCategory defined in the system configuration
  }
  stages {
// ...
  }
}
 

 What I would have wanted is either to have the throttle option take effect before the agent is selected, or some sort of declarative syntax that would let me have agent none at the top level of the pipeline (where the throttle option is specified), then the ability to specify a particular agent for all the actual stages to be executed (Build, Test, Publish, etc.). I tried this: 

 

pipeline {
  agent none // <-- to avoid having an agent allocated before the throttle category is evaluated
  options {
throttle(categories: ['MyCategory'])
  }
  stages {
stage('Overall') {
  agent {
label 'foo' // <-- to get the real agent I want for the real stages
  }
  stages {
stage('Build') {
   // ...
}
stage('Test') {
  // ...
}
  }
}
  }
}
 

 But it simply hung with no useful output. If there's some other way to have agent none at the top level, then a single, reused agent for the actual stages within, I'd be interested to hear about it. I know I could have an agent per stage (Build, Test, etc.), but that wouldn't work for me – it has to be the same machine for all of these, and I'd rather not stash and unstash all the artifacts I need between these stages.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
   

[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2019-04-05 Thread metaphysical.intoxicat...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dmitry Mamchur edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 Hello, I'm having the same problem: {code:java}options {  throttle(['shared-workspace'])}{code} doesn't work for the entire  build in a  declarative job.As a workaround, I'm using shared libraries: 1) define the entire declarative pipeline in a shared library var, as per [https://jenkins.io/blog/2017/10/02/pipeline-templates-with-shared-libraries/] 2) surround pipeline invocation with throttle, e.g.{code:java}Jenkinsfilethrottle(['shared-workspace']) {  myDeliveryPipeline {  branch = 'master'  scmUrl = 'ssh://g...@myscmserver.com/repos/myRepo.git'  email = 't...@example.com'  serverPort = '8080'  developmentServer = 'dev-myproject.mycompany.com'  stagingServer = 'staging-myproject.mycompany.com'  productionServer = 'production-myproject.mycompany.com'  }}{code}  Hope this will be helpful to someone!  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2019-04-05 Thread metaphysical.intoxicat...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dmitry Mamchur commented on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 Hello, I'm having the same problem:  

 

options {
  throttle(['shared-workspace'])
} 

  doesn't work for the entire declarative job. As a workaround, I'm using shared libraries: 1) define the entire declarative pipeline in a shared library var, as per https://jenkins.io/blog/2017/10/02/pipeline-templates-with-shared-libraries/ 2) surround pipeline invocation with throttle, e.g. 

 

Jenkinsfile
throttle(['shared-workspace']) {
  myDeliveryPipeline {
  branch = 'master'
  scmUrl = 'ssh://g...@myscmserver.com/repos/myRepo.git'
  email = 't...@example.com'
  serverPort = '8080'
  developmentServer = 'dev-myproject.mycompany.com'
  stagingServer = 'staging-myproject.mycompany.com'
  productionServer = 'production-myproject.mycompany.com'
  }
}
 

 Hope this will be helpful to someone!  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2018-09-21 Thread sharadhol...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sharad Holani edited a comment on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 [~jayspang]!image-2018-09-21-18-20-12-512.png |width=932,height=156 !  - I tried the step you suggested. Added throttle settings in manage jenkins. Added  throttle(categories: ['test-category']) in options. Also added the code suggested by [~kylejameswalker]. But the number of builds are not getting throttled.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2018-09-21 Thread sharadhol...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sharad Holani commented on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 Jay Spang         
 
I tried the step you suggested. Added throttle settings in manage jenkins. Added  throttle(categories: ['test-category']) in options. Also added the code suggested by Kyle Walker. But the number of builds are not getting throttled. 
  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2018-09-21 Thread sharadhol...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sharad Holani updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-45140  
 
 
  Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
Change By: 
 Sharad Holani  
 
 
Attachment: 
 image-2018-09-21-18-20-12-512.png  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-45140) Add support of throttling of the entire build in Declarative Pipeline

2018-02-27 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-45140  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add support of throttling of the entire build in Declarative Pipeline   
 

  
 
 
 
 

 
 Jay Spang - the maxConcurrentPerNode property goes on the category you define in the Jenkins global config, and then you use that category in the Pipeline.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.