pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

Ability to throttle concurrent TaskRuns

Open nick123pig opened this issue 2 years ago • 7 comments

Feature request

I would like the ability to throttle a certain Task to have a maximum number of concurrent TaskRun at a time. IE...if I submit a task 100 times, and I have a throttle set to 5, the tasks would complete with a maximum of 5 running at a time (with the backlog queuing once another slot opens). This might not need to be a tekton specific functionality, but I have tried to implement this with standard kubernetes ResourceQuotas and Object Count Quotas, but it doesn't take into account the "running" state of the task. I could probably get something working that's non-precise with regular cpu/memory limits as well, but it would be nice to control this precisely. If there's another workaround approach, I'm all ears.

Use case

We have a task in a pipeline that

  1. has an expensive API call with strict rate limit rules (to an external service which I don't control)
  2. can be submitted in bursts where a lot can be running concurrently.

My goal is prevent rate limit exceptions with the external service.

Thank you!

nick123pig avatar May 24 '22 04:05 nick123pig

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

tekton-robot avatar Aug 22 '22 05:08 tekton-robot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten with a justification. Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

tekton-robot avatar Sep 21 '22 05:09 tekton-robot

TEP-0120 is working on canceling concurrent pipeline runs - it does not support queuing but that could be another concurrency strategy we add

dibyom avatar Oct 04 '22 17:10 dibyom

/remove-lifecycle rotten

afrittoli avatar Oct 18 '22 16:10 afrittoli

We do not handle this today but it's an interesting use case for the future, so marking as frozen

afrittoli avatar Oct 18 '22 16:10 afrittoli

/lifecycle frozen

afrittoli avatar Oct 18 '22 16:10 afrittoli

queueing would be awesome

sibelius avatar Apr 10 '24 11:04 sibelius