[JIRA] (JENKINS-58493) Add NodeProperty to skip-clean-on-this-node

11 views
Skip to first unread message

pjdarton@gmail.com (JIRA)

unread,
Jul 15, 2019, 7:15:02 AM7/15/19
to jenkinsc...@googlegroups.com
pjdarton created an issue
 
Jenkins / Improvement JENKINS-58493
Add NodeProperty to skip-clean-on-this-node
Issue Type: Improvement Improvement
Assignee: tspengler
Components: hudson-wsclean-plugin
Created: 2019-07-15 11:14
Environment: Jenkins master with a mix of static slaves and cloud-provisioned slaves.
Priority: Minor Minor
Reporter: pjdarton

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"

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

pjdarton@gmail.com (JIRA)

unread,
Aug 13, 2019, 11:27:02 AM8/13/19
to jenkinsc...@googlegroups.com
pjdarton assigned an issue to pjdarton
Change By: pjdarton
Assignee: tspengler pjdarton

pjdarton@gmail.com (JIRA)

unread,
Aug 13, 2019, 11:30:05 AM8/13/19
to jenkinsc...@googlegroups.com
pjdarton commented on Improvement JENKINS-58493
 
Re: Add NodeProperty to skip-clean-on-this-node

I've created a PR that'll address this issue ... but until the plugin code has a Jenkinsfile (see PR#5) folks will have to build their own copy of the code.

pjdarton@gmail.com (JIRA)

unread,
Aug 13, 2019, 11:31:06 AM8/13/19
to jenkinsc...@googlegroups.com
pjdarton started work on Improvement JENKINS-58493
 
Change By: pjdarton
Status: Open In Progress

pjdarton@gmail.com (JIRA)

unread,
Aug 21, 2019, 6:59:02 AM8/21/19
to jenkinsc...@googlegroups.com
pjdarton commented on Improvement JENKINS-58493

Update for anyone watching this:
I implemented a NodeProperty ... but then found that not all of the cloud plugins I used supported NodeProperties, so I've also added the ability to filter by nodeName as well.

There's now a Pull Request that contains a fix for this issue (plus other enhancements). Anyone can download the .hpi file of the bugfixed plugin from there and then upload that (Manage Jenkins -> Manage Plugins ->Advanced -> Upload plugin) to their own Jenkins server(s) to try it out.

Once I'm confident that everything is OK then I'll merge those changes in and release the new plugin officially.

pjdarton@gmail.com (JIRA)

unread,
Aug 28, 2019, 9:05:43 AM8/28/19
to jenkinsc...@googlegroups.com
pjdarton resolved as Fixed
 

Fixed in version 1.0.6, which was released today.

Change By: pjdarton
Status: In Progress Resolved
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages