Repository navigation
Add maintenance.py for K8s CronJob scheduling - #22
Merged
Merged
Conversation
Self-contained tools/maintenance.py replaces inline DuckDB CLI calls with native Python duckdb, reusing the same env vars. Justfile recipes now delegate to the script. Also fixes missing INSTALL for DuckDB CLI extensions in the justfile shell setup.
Push maintenance_start_time on start and maintenance_duration_seconds on completion via PUSHGATEWAY_URL. Default S3 endpoint/ssl/url_style to match the old justfile when env vars are unset. Reject --days < 1 to prevent accidental full expiry. Update README and AGENT.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
tools/maintenance.pyreplaces inline DuckDB CLI calls intools/justfilewith native Pythonduckdb, reusing the same env vars and Docker imagemaintenance_start_time(immediately on start) andmaintenance_duration_seconds(on completion) to Prometheus Pushgateway whenPUSHGATEWAY_URLis set, enabling Grafana annotation queries for maintenance windows--days < 1to prevent accidental full expiry/deletionshellanddropremain as DuckDB CLI callsINSTALLfor DuckDB CLI extensions in justfile_setupTest plan
python tools/maintenance.py --helpand verify all subcommands listedpython tools/maintenance.py maintain --days 0and verify it errorspython tools/maintenance.py maintain --days 7 --dry-runagainst a DuckLake instancejust maintain-dry-run 3delegates correctlyjust shellworks (INSTALL + LOAD extensions)/app/tools/maintenance.pyis presentPUSHGATEWAY_URLand verify metrics are pushed on start and completionPUSHGATEWAY_URLand verify no errors or log noise