Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 429564

Summary: Automate the removal of obsolete nightly builds
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: RelengAssignee: Pierre-Charles David <pierre-charles.david>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: laurent.redor
Version: unspecifiedKeywords: triaged
Target Milestone: 5.0.0   
Hardware: All   
OS: All   
Whiteboard:

Description Pierre-Charles David CLA 2014-03-04 08:34:54 EST
Currently our nightly builds simply accumulate and a manual operation is needed from time to time to remove very old ones. We should have a script and a corresponding automated job on our HIPP to do this automatically.

See bug 422069 for more details.
Comment 1 Pierre-Charles David CLA 2016-11-27 10:31:22 EST
Since our HIPP was upgraded to SLES12, the nightlies are published with permissions which do not allow us to manually remove them "once in a while, when we think about it". This means we have to find another way to avoid using too much disk space.

I've made some tests, and a job running on the HIPP has the rights to remove them.

I've just created https://hudson.eclipse.org/sirius/job/sirius-updates-cleaner/ which currently only *lists* the builds it finds, which ones it considers should be kept, and which ones it considers should be removed. For not the job does not perform any modification. I'll schedule it to run every night and monitor the results for a while, until I'm confident that it produces correct result and would not remove important stuff.

If/when I'm confident enough, I'll change it to do the actual removal itself, but probably only when run manually. The way I see it, the job will have a DRY_RUN parameter, enabled by default, which only produces a report of what it would remove. It would be run every night with DRY_RUN=true. Every once in a while, someone would run it manually with DRY_RUN=true, verify the result, and if it looks fine, re-run it explicitly with DRY_RUN=false to actually remove the obsolete builds.

Ideally, "every once in a while" would be when too many old builds have accumulated, which would be detected by sending us an email. The most obvious way would be to make the "build" fail in such a case
Comment 2 Pierre-Charles David CLA 2017-01-01 06:10:39 EST
I've just executed the first actual run which removed obsolete folders (https://hudson.eclipse.org/sirius/job/sirius-updates-cleaner/52/). Everything seems to have worked as expected. I'll stay in manual invocation mode for a while, the next step being to notify me by mail when too many obsolete nightlies have accumulated. The final step will be to automatically do the removal when needed without bothering anyone.
Comment 3 Pierre-Charles David CLA 2017-02-28 08:44:11 EST
The job has been running fine for a while, both automatic daily "dry runs" and the occasional manual "real" cleanup. I've just changed the job's configuration to actually do the cleanup by default every night. I'm closing this for now, and will only reopen if we see something strange/wrong.
Comment 4 Pierre-Charles David CLA 2017-05-15 04:45:13 EDT
Verified on CI server.
Comment 5 Pierre-Charles David CLA 2017-06-29 03:32:01 EDT
Available in Sirius 5.0.0, see https://wiki.eclipse.org/Sirius/5.0.0 for details.