Skip to content
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

run-queue: Automatically prune the test results database #7318

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions run-queue
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ def consume_webhook_queue(dq: distributed_queue.DistributedQueue) -> ConsumeResu
sha = pull_request['head']['sha']
db = os.path.join(get_images_data_dir(), "test-results.db")
body = {
"command": (f"./store-tests --db {db} --repo {repo} {sha} && "
f"./prometheus-stats --db {db} --s3 {os.path.join(LOG_STORE, 'prometheus')}")
"command": (
f"./store-tests --db {db} --repo {repo} {sha} && "
# prune the db if it gets too big; 14 days weighs about 15 MB
f"if [ $(stat +%c {db}) -gt 25000000 ]; then ./prometheus-stats --db {db} --prune 14; fi &&"
f"./prometheus-stats --db {db} --s3 {os.path.join(LOG_STORE, 'prometheus')}"
)
}
dq.channel.basic_publish('', 'statistics', json.dumps(body),
properties=pika.BasicProperties(priority=distributed_queue.MAX_PRIORITY))
Expand Down
Loading