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

documentation on how to delete workers after each Jenkins job

      I guess this is probably supported, but not documented...

      I want to configure a pool of single-use dynamic workers:
      once a jenkins tied to that pool/label is about to run, a new node is created in Openstack cloud, the job runs, then the node is destroyed.

      I see "retention time" of -1 means "keep nodes forever". I'm guessing setting it to 0 would do something similar to what I described. but not sure... because if nodes are cleaned up once a minute (for example), then another job can start running on that node in those 60 seconds between the last job finished and the cleanup starts..

      so how do I force deleting nodes after each jenkins job?

          [JENKINS-29987] documentation on how to delete workers after each Jenkins job

          Alex Java added a comment -

          actually, I see setting retention time to 0 would be the same as setting it to 30:

              public int getRetentionTime() {
                  return retentionTime == 0 ? DEFAULT_INSTANCE_RETENTION_TIME_IN_MINUTES : retentionTime;
              }
          

          Alex Java added a comment - actually, I see setting retention time to 0 would be the same as setting it to 30: public int getRetentionTime() { return retentionTime == 0 ? DEFAULT_INSTANCE_RETENTION_TIME_IN_MINUTES : retentionTime; }

          The way to do this is configuring "OpenStack Single-Use Slave" in every job. I consider this to be the other way around and agree this should be an attribute of the slave/template and not the job.

          Oliver Gondža added a comment - The way to do this is configuring "OpenStack Single-Use Slave" in every job. I consider this to be the other way around and agree this should be an attribute of the slave/template and not the job.

          LawYard LawYard added a comment - - edited

          Fixed in new jclouds-plugin:

              public int getRetentionTime() {
                  final JCloudsSlave node = getNode();
                  return null == node ? CloudInstanceDefaults.DEFAULT_INSTANCE_RETENTION_TIME_IN_MINUTES : node.getRetentionTime();
              }
          

          When retention time set to 0 then nodes deletes after less than 1 minute after builds.

          LawYard LawYard added a comment - - edited Fixed in new jclouds-plugin : public int getRetentionTime() { final JCloudsSlave node = getNode(); return null == node ? CloudInstanceDefaults.DEFAULT_INSTANCE_RETENTION_TIME_IN_MINUTES : node.getRetentionTime(); } When retention time set to 0 then nodes deletes after less than 1 minute after builds.

          But that does not guarantee next build will not be scheduled.

          Oliver Gondža added a comment - But that does not guarantee next build will not be scheduled.

            olivergondza Oliver Gondža
            alskor Alex Java
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: