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
Multi-select flow runs and set state in bulk (to clear late runs, delete scheduled runs in bulk, and more) #7006
Comments
Would LOVE to see this implemented. I have spent MANY hours over the last couple of months clearing "stuck" flow runs when my k8s agent has silently crashed. I must clear the pending jobs before deleting the agent pod otherwise the new agent will try to pickup the, at times, hundreds of pending flows which will then cause the agent to get into a continuous crash cycle. Having to select them 1 by 1 from the UI, when there are 500+ flow runs, is incredibly time consuming and tedious. |
cc @zhen0 / @billpalombi this looks like it was triaged but I want to be sure it's actually on a roadmap. |
Thanks @madkinsz! I'm adding to the UI backlog and we can set a priority and see who can pick it up at our team huddle on Monday. |
@zhen0 Just wanted to add that pages for flows, deployments, and work-queues already support the desired behavior (i.e. anywhere we use lists instead of cards). Having a check box next to the "{n} Flow runs" text above the cards that acted as "select all" would probably work well. |
Small update here that we want to think through how we clear these runs - we can easily have thousands (or more) of flow runs in the ui at one time so it's not as simple as the run multi-select or flow/deployment table view objects. We're actively looking into it. |
@zhen0 definitely! In case it makes sense, I'll just add that even being able to select one page-worth at a time would be helpful. |
@billpalombi - shall we add this to product orchestration's backlog? |
Can we have a flow deployment flag that just says "don't catch up on missed runs?" I have jobs that really cannot have two instances running at the same time (trying to insert the same data set into the same table.) |
Is there is any API example related to Prefect 2.0 which can workaround this problem right now? |
Hello again, @anna-geller, can I use this approach for skipping unnecessary flows (within flow function)?
|
Just experienced this issues today and found out it's not possible to delete late runs. In our case the vast majority of times I just want to delete late runs and get fresh data on the next scheduled run. |
@madkinsz Yes that would solve it for me 🫡 |
clicking checkboxes isn't fun. we would love to see this impl. |
Slow cleanup workaround (1-5s per deletion), but it does the job. for _ in {1..10}; do time prefect flow-run ls --limit 100 --state-type=SCHEDULED --state=Late --flow-name=FLOW_NAME | tail -n +5 | head -n -1 | awk '{print $2}' | while read guid; do prefect flow-run delete $guid; done; done |
let buttons = Array.from(document.querySelectorAll('input[class=p-checkbox__input]'));
(async () => {
for (let b of buttons) {
console.log(b)
b.click();
await new Promise(r => setTimeout(r, 100));
}
})(); you can also put this into the browser console to script clicking every button on the page (note: this will select 50 since the list is virtualized, so you must do this each time per 50 items. |
We need this |
As of v2.16.5, the UI now has a shortcut for selecting/deselecting multiple flow runs at once. The selection takes current in-use filters into account to ultimately provide users with the ability to:
Should be available on all pages where flow runs are currently listed in filterable and selectable views - e.g. the flow runs, flow, and deployment pages. Please note that these changes only affected the UI. |
First check
Prefect Version
2.x
Describe the current behavior
Currently, there is no easy way to:
Describe the proposed behavior
Create a feature allowing to:
Example Use
Additional context
Imagine the scenario: you have an hourly scheduled deployment. Your agent went down yesterday at 9 AM. You realized that agent issue today and restarted the agent process at 9 AM the following day.
Current behavior: there are 24 late runs that get immediately picked up once the agent process gets restarted. Some users, justifiably, don't like it, as they would prefer to just start scheduling future runs and clear those 24 late runs scheduled for the past.
The text was updated successfully, but these errors were encountered: