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

would like to use one instance per build

    XMLWordPrintable

Details

    • New Feature
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • ec2-plugin
    • None

    Description

      A combination of factors:

      • Our builds are fairly infrequent
      • Our instance set up + build is a bit less than an hour (but instance set up + build + wait 30 minutes is more than an hour)
      • It would be nice not have to trust the code we are building too much

      mean that for our purposes we would like to start a fresh instance for each build we do.

      I've had a bit of a look at this, and it seems that one approach would be to play with the RetentionStrategy used for the ec2 slaves, but I'm not sure that this would result in the slave being terminated if there was a build waiting when one finished.

      Attachments

        Activity

          Released in EC2 plugin Version 1.43

          sverhoef Stefan Verhoeff added a comment - Released in EC2 plugin Version 1.43
          jvz Matt Sicker added a comment - PR merged to master: https://github.com/jenkinsci/ec2-plugin/pull/323
          tykeal Andrew Grimberg added a comment - - edited

          So... I know this is a long standing issue at this point but I've developed a work around to get single use instances with a bit of hackery.

          The Single Use Slave Plugin along with this remove_ec2_node.groovy script run from a cron job against the Jenkins node will get you an effective working solution.

          Having something like this is pretty important to my customers, especially now that EC2 bills by the second instead of by the hour!

          tykeal Andrew Grimberg added a comment - - edited So... I know this is a long standing issue at this point but I've developed a work around to get single use instances with a bit of hackery. The Single Use Slave Plugin  along with this  remove_ec2_node.groovy  script run from a cron job against the Jenkins node will get you an effective working solution. Having something like this is pretty important to my customers, especially now that EC2 bills by the second instead of by the hour!
          arazauci arazauci added a comment - +1 $500 for whoever fixes this https://freedomsponsors.org/issue/594/would-like-to-use-one-instance-per-build?alert=SPONSOR#
          johntdyer John Dyer added a comment -

          I actually would like this as well, but I havnt been able to figure out how to do it. Right now I have Jenkins creating an instance with a single executor and I start Job1 which is taged to run on that new node. I then start Job2 which is taged to start on the same slave but it seems to wait for that executor on the first slave to finish. How can I make it scale up another slave for Job2?

          johntdyer John Dyer added a comment - I actually would like this as well, but I havnt been able to figure out how to do it. Right now I have Jenkins creating an instance with a single executor and I start Job1 which is taged to run on that new node. I then start Job2 which is taged to start on the same slave but it seems to wait for that executor on the first slave to finish. How can I make it scale up another slave for Job2?

          People

            kohsuke Kohsuke Kawaguchi
            mwhudson mwhudson
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: