-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
provide a pipeline concurrency limit #1305
Comments
/kind feature I wonder if this should be a feature for pipeline (core) or some integration tooling (like jenkins-x) |
This sounds like it could be pretty cool!! I agree with @vdemeester in that I'm not 100% sure where it would best belong - but there have been some related ideas that have come up lately (but are slightly more complicated) such as:
I think it could be pretty cool to think about what it would be like to apply generic policies to Pipeline execution, maybe in an admission controller, so it could be decoupled from the Tekton Pipelines codebase but could be ultra flexible. |
Any updates about this issue? @bobcatfish @vdemeester |
Hey @assertion ! I don't think there has been any movement but if you (or anyone else in the community) wants to take this on I think we'd be happy to see it! Let me know if you want any pointers re. next steps to work on this. |
I looked into the approach using an admission controller. To ensure a pipeline has no concurrent executions, I registered a validating admission controller for creation of taskruns. As the incoming AdmissionReview contains the taskrun definition, I can query for other running pipelines and as a result return either true or false. This works fine as the tekton controller retries creating the taskrun after it was rejected. As the retry seems to follow some exponential backoff pattern, I´m a bit worried that if this is requested multiple times, a lot of time might be wasted. Any ideas about that? Do you know where I can find details about the backoff pattern? |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I'm gonna reopen this one, I wonder if we should add it to the roadmap also 🤔 /reopen |
@bobcatfish: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
We're adding this to our roadmap, I changed the name a bit to reflect that we feel like we'd want to address this in general but maybe not specifically for branch + repo only |
Some thoughts on how this could possibly work, feel free to propose alternatives:
Open Questions:
|
Related issue: #2591 |
@jstrachan work on this is happening in experimental tektoncd/experimental#699, please continue the investigation / discussion on this there. Closing this one for now. |
Expected Behavior
Its common in CI systems to limit the number of concurrent pipelines that can execute on a given repository and branch. e.g. process PRs concurrently, but only allow a maximum of 1 release to be performed at once in case releases clash with each other. e.g. to avoid race conditions between concurrent pipeline steps that operate on shared git repositories/buckets/kubernetes clusters.
e.g. imagine a simple pipeline of
kubectl
to deploy some resources using this version number or update the website/changelogIf you run this pipeline concurrently all kinds of things could happen due to the wonders of concurrency (e.g. seeing the version number go forwards then backwards).
When working on separate PRs concurrency is not usually an issue; but working on shared resources (e.g. producing a sequential stream of artifacts or updating a shared cluster) we often want to force a clean ordering on the pipelines to avoid confusion or worse things.
Actual Behavior
There's currently no way to force a pipeline to not execute until all other pipelines for that repository + branch have completed without writing some kind of leader election step.
We're pondering writing a little leader election step as a workaround (which would be Jenkins X specific jenkins-x/jx#5471); but figure it would be nice to be able to add this kind of capability into the tekton controller.
If you squint its a little like the tekton controller being like the
ReplicaSet
controller; ifreplicas = 1
for a unique string (e.g. the git repository URL + branch name), only start a newPod
for aPipelineRun
when no others are running for that string.Steps to Reproduce the Problem
Additional Info
If there was some kind of
MaximumConcurrency
for a specific source repository and branch we could modify the tekton controller to only create a new Pod when it knows there are no other running pods for a given source repository + branch.The text was updated successfully, but these errors were encountered: