-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up pipelines associated with old / merged branches #153
Comments
I'm wondering what approach we should take here. A few possible approaches:
I am not sure how complicated we want to make it for ODS pipeline. The main goal of pipeline pruning is - at least in my eyes - twofold: to avoid the UI to become too crowded, and to reduce the number of resources in the K8s cluster. With that in mind, keeping n number of pipelines could be a viable option until we need something better. But maybe there is a smart solution that isn't complicated? Ideas @gerardcl @kuebler @henninggross @renedupont @stitakis? |
How difficult do you think would it be to mirror the behaviour of the jenkins webook proxy? For me, it makes sense how the jenkins webhook proxy handles it. IMO just keeping n number does not take into account how fine granular a team creates branches. Team A might create 10 branches a day while Team B only 1 per week. So the preferred n for Team A and B might differ. I know that might be only a very theoretically case, but I know you like nitpicking 😄. |
IMHO I would for now just try to keep the list automatically cleaned up and see if it is really required to have specific actions per events like in the jenkins webhook. At the end the goal is to have the list to not be inifinite and basically one is interested on the latest ones and current on active mode...(and if required to recover an old one it is also possible anyhow) I don't see the need on only deleting in case of events indeed (might even not always work as per experiences). The trick is to me though on deciding what would be a nice default value (as per @renedupont nitpicking escenario :) ) |
I have a new idea how to approach this. Let's see if you like it :) The main idea is to keep n branches per environment. All branches mapped to one environment end up in one "bucket". All remaining branches (not mapped to an env) end up in one bucket as well. Then we keep n branches per bucket. Additionally I would offer a second configuration parameter, a "removal delay". For example, this could be set to 48 hours, and that would have the effect that no branch is cleaned up before 48 hours pass. Both knobs work well together, should be relative simple to implement and do not require to listen for the webhook events like the Jenkins webhook cleanup. I think it also provides what one wants: access to recent pipeline runs, plus access to the n last pipeline runs that deployed into an env (e.g. last 5 deployments into prod). @renedupont it addresses your "nitpick" somewhat I believe: since n is not global, many dev branches do not affect pipeline runs that deploy into QA/PROD. It doesn't fully address the different amount of, say, feature branches. But maybe the "removal delay" is good enough for that problem? Thoughts? :) |
Not sure if I understand. How is a branch mapped to an environment? Isn't it often like this: prod env -> 1 branch (master) That way only the dev env "bucket" would mainly be of interest. Or do you mean something else when speaking of environment? |
@renedupont The cleanup would actually remove Example: Also, let's say we keep only 5 pipeline run, and we have the following situation:
When cleanup kicks in, we would remove:
Does that help? |
Also see updates in v1.6 of OpenShift Pipelines: https://docs.openshift.com/container-platform/4.9/cicd/pipelines/op-release-notes.html#new-features-1-6_op-release-notes |
One issue I realized with my proposal in the meantime is that it depends on the |
I've had some more thoughts on this as it is in the critical path towards resolving #394. I do not consider my proposal above ideal anymore, as cleanup would depend on state in a branch, which might lead to unwanted side effects, plus the logic wasn't as simple as I'd like it to be. I have since realized that all pipeline runs target a certain In addition, I would also keep the "removal delay" described above (so that all pipeline runs are there for at least 48 hours or so). This strategy should lead to rather aggressive cleanup for the @ManuelFeller @gerardcl You've assigned this issue to yourself. Could you review my proposal? Also - not sure if you intended to implement it. If so, please let me know if you need pointers to get started and when you would be able to get to it. Otherwise I would take this over since I think it is best to solve the issue here before working in #394, and that issue needs to be dealt with soon. |
hi @michaelsauter , we did not met yet so we did not check proposals so far. |
Hi @michaelsauter. I see it pretty similar if we do not want to make things too complex. The approach with "have |
@gerardcl @ManuelFeller Thanks for the feedback! I am going to assign this to myself now ... |
No description provided.
The text was updated successfully, but these errors were encountered: