Add CLI command to delete runs older than date #10832
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary & Motivation
Deleting older than a certain date is super useful in Dagster. We don't really care about jobs older than a certain date range (say 90 days), this just takes up storage space.
What would be useful is a command to delete older than a date.
See this issue #4497
I really like this idea:
U02B400J44U: Maybe
dagster run wipecould take an argument like
--older-than=2w``, So I added it.I really don't like adding this to wipe as wipe is an incredibly destructive action and I foresee users wiping their instances by mistake. Instead I've created a new command called
delete-range
. If someone has a better name for this, I'm open for suggestions as I don't like this name :).Now you can do the following:
dagster run delete-range 1h
And it will ask you if you want to delete older than the date it found:
And after it will tell you how many deletions it made:
It will also show you a progress bar which will update every run.
Questions:
Once I get #2 answered I'll finish the tests.
🤔 Should there be a
delete_many
function added at some point to bulk delete runs? Right now you have to do run-by-run.How I Tested These Changes