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

Add NodeProperty to skip-clean-on-this-node

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • hudson-wsclean-plugin
    • None
    • Jenkins master with a mix of static slaves and cloud-provisioned slaves.

      Not all Jenkins slave nodes need cleaning - some are disposable slave nodes that are used once and then discarded (along with their workspace).

      In the situation where we have a mix of static slave nodes (which run build after build and could run out of disk space if it wasn't for this plugin tidying up unwanted workspaces) and various cloud-provisioned "single use only" slave nodes (e.g. docker-plugin provided docker container slaves) which are each only ever used for one build before being destroyed, there's no need for the distributed cleanup functionality to try to remove the build workspace from a single-use-only slave (as the only workspace on a single-use slave is from the build it's running "right now").
      i.e. For best efficiency, this plugin should ignore any single-use-only slaves.

      If we did this then, in addition to the efficiency improvement, there's also a side benefit that, as these slaves might cease to exist while this plugin is trying to ask them to remove the workspace, this would also help keep the logs clean of irrelevant error messages.

      This plugin should define a NodeProperty<Node> (much like the Workspace Cleanup Plugin does) to flag a slave node as "Should be ignored by the distributed workspace cleanup", and then skip any nodes with that property.
      Alternatively, we could allow the user to specify a label expression to be used to further trim down the list of slave nodes on which workspaces will be removed.

      TL;DR: Provide a way of flagging slaves as "to be skipped by this plugin"

            pjdarton pjdarton
            pjdarton pjdarton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: