Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-15970

JClouds plugin: add optional delay between instantiations of Instance Creation Build Environment action

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • jclouds-plugin
    • None

      Some cloud providers have limits on rate of instance creation: e.g. 2/second, 25/minute.

      If 3 instances are specified in JClouds Instance Creation for a build, then it will fail because it will exceed the provider's limit by trying to request 3 concurrently.

      Introducing a "delay between requests" (e.g. 1-10 seconds) would resolve this issue at little relative cost to the build time.

      NOTE: this feature could instead be added for the Cloud Instance Template in the Configure System section of Jenkins which would fix a similar issue: if multiple concurrent builds that are attached to this label are executed at the same time causes this rate to be exceeded (I think)

          [JENKINS-15970] JClouds plugin: add optional delay between instantiations of Instance Creation Build Environment action

          Adam Rofer added a comment - - edited

          I've made a patch that implements a delay in JCloudsSlaveTemplate in the get() function - I had to synchronize on an object too because it's called by the Jenkins threadpool stuff in batches. I can throw together a pull request sometime this week, probably.

          Adam Rofer added a comment - - edited I've made a patch that implements a delay in JCloudsSlaveTemplate in the get() function - I had to synchronize on an object too because it's called by the Jenkins threadpool stuff in batches. I can throw together a pull request sometime this week, probably.

          Adam Rofer added a comment -

          Patch that seems to work well for me with small delay values (e.g. 2000 ms)

          Adam Rofer added a comment - Patch that seems to work well for me with small delay values (e.g. 2000 ms)

          Adam Rofer added a comment -

          This patch was made indirectly off of 67af6abca653a01404e1439944ee39f435fb8f53, FWIW.

          Adam Rofer added a comment - This patch was made indirectly off of 67af6abca653a01404e1439944ee39f435fb8f53, FWIW.

          Andrew Bayer added a comment -

          Any chance you could do this as a pull request?

          Andrew Bayer added a comment - Any chance you could do this as a pull request?

          Adam Rofer added a comment -

          Sure, give me a day or two and I'll have that up in that form.

          Adam Rofer added a comment - Sure, give me a day or two and I'll have that up in that form.

          Adam Rofer added a comment -

          Pull request issued. I have tested this mostly with implicit spooling (one project running multiple sub-projects in a row that are bound to one VM template label) and not the Instance Creation, although it should work for that as well.

          Adam Rofer added a comment - Pull request issued. I have tested this mostly with implicit spooling (one project running multiple sub-projects in a row that are bound to one VM template label) and not the Instance Creation, although it should work for that as well.

          Andrew Bayer added a comment -

          Merged - thanks!

          Andrew Bayer added a comment - Merged - thanks!

          Code changed in jenkins
          User: Adam Rofer
          Path:
          src/main/java/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate.java
          src/main/resources/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate/config.jelly
          src/main/resources/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate/help-spoolDelayMs.html
          src/test/java/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplateTest.java
          http://jenkins-ci.org/commit/jclouds-plugin/e7eb5a32647971ec3cc204100861c43c6bcca0ad
          Log:
          Fix for JENKINS-15970: Add forcible synchronized serial delay option

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Adam Rofer Path: src/main/java/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate.java src/main/resources/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate/config.jelly src/main/resources/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate/help-spoolDelayMs.html src/test/java/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplateTest.java http://jenkins-ci.org/commit/jclouds-plugin/e7eb5a32647971ec3cc204100861c43c6bcca0ad Log: Fix for JENKINS-15970 : Add forcible synchronized serial delay option

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/main/java/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate.java
          src/main/resources/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate/config.jelly
          src/main/resources/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate/help-spoolDelayMs.html
          src/test/java/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplateTest.java
          http://jenkins-ci.org/commit/jclouds-plugin/42167b274770ba9ba4c4c57105d0c939d76b4d47
          Log:
          Merge pull request #35 from adamrofer/JENKINS-15970

          Fix for JENKINS-15970: Add forcible synchronized serial delay option

          Compare: https://github.com/jenkinsci/jclouds-plugin/compare/67af6abca653...42167b274770

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate.java src/main/resources/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate/config.jelly src/main/resources/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplate/help-spoolDelayMs.html src/test/java/jenkins/plugins/jclouds/compute/JCloudsSlaveTemplateTest.java http://jenkins-ci.org/commit/jclouds-plugin/42167b274770ba9ba4c4c57105d0c939d76b4d47 Log: Merge pull request #35 from adamrofer/ JENKINS-15970 Fix for JENKINS-15970 : Add forcible synchronized serial delay option Compare: https://github.com/jenkinsci/jclouds-plugin/compare/67af6abca653...42167b274770

          Andrew Bayer added a comment -

          Will be in next release - probably 2.3.2.

          Andrew Bayer added a comment - Will be in next release - probably 2.3.2.

            abayer Andrew Bayer
            adam_rofer Adam Rofer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: