helpdesk icon indicating copy to clipboard operation
helpdesk copied to clipboard

[repo.jenkins-ci.org] Ensure repository `incrementals` is automatically garbage-collected

Open dduportal opened this issue 9 months ago • 3 comments

Context: following https://github.com/jenkins-infra/helpdesk/issues/2386 in which the incrementals Maven repository had an initial cleanup of all artifacts older than 90 days, we now want to apply an automatic system which role is to perform regularly the same kind of task, so we do NOT reproduce the problem in the future.

Expected policy is to remove all artifacts older than 90 days for this repository.

We have to decide the "how" and "how frequent" though

dduportal avatar Feb 18 '25 10:02 dduportal

Where would this job run and what constraints do I need to live in?

darinpope avatar Feb 19 '25 15:02 darinpope

Where would this job run and what constraints do I need to live in?

First preference is to see if JFrog has a feature that would allow us to configure the cleanup entirely from within their environment so that we don't need a job outside Artifactory.

If that's not available or not feasible, then second preference is a job that runs on trusted.ci.jenkins.io and has a credential stored on trusted.ci.jenkins.io that authorizes the cleanup of the incrementals repository.

MarkEWaite avatar Feb 19 '25 15:02 MarkEWaite

That makes sense.

I've attached an all-in-one Jenkinsfile, i.e. we don't need a repo or any extra files, but we should use a repo, that I've fully tested running on 2.492.1 on Kubernetes 1.31.5. (I had to add a .txt extension in order to attach.) The only thing that will have to be added to the controller is a Secret Text credential with the id of artifactory-access-token.

If we move the Jenkinsfile to a repo (which we should), we can simplify the Jenkinsfile by creating a query.aql file and a generate.sh file. If we go down the repo path, I'll be glad to put in PRs so I can test locally.

Based on what I'm seeing running locally, we should run this at least once a week, but to keep the runs short, I recommend once a day.

Jenkinsfile-delete-incrementals.txt

darinpope avatar Feb 19 '25 16:02 darinpope