-
Notifications
You must be signed in to change notification settings - Fork 67
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
_collect_docker_size queries for all items in the registry #107
Comments
What timing are you talking about, could you give an example for your case? Like if the some cleanup-script runs even for an hour each night - it should be fine, imo. |
I think right now it's not possible to pass other rules attributes to |
I stopped it after 3 hours. I have a large backlog of things to cleanup, repo wide searches are very slow. Right now i'm using the following patch to filter to the common path of the artifacts returned, this avoid any additional parameters. common_path = path.commonpath([artifact['path'] for artifact in artifacts])
args = ["items.find", {"$and": [{"repo": {"$eq": repo for repo in docker_repos}}, {"$or": [{"path": { "$match": f"{common_path}/*", }}]}]}] Deletes are also slow in my case, each delete takes a couple minutes. Right now its performed serially, have parallel deletes been considered? |
It sounds awful, agreed. With common path it's possible that the common path will be
There ware no needs, but it's possible. We could use thread pool for that as an easy fix. |
Running an aql query to get all items is very slow on large repositories. I also use object storage for the binary store which likely contributes to slower queries.
Example rule combination that I'm trying to use:
artifactory-cleanup/artifactory_cleanup/rules/docker.py
Line 63 in 018dcdb
I tested replacing this line with
args = ["items.find", {"$or": [{'path': {'$match': 'app/*'}}]}]
and it is significantly faster while retaining the size info.Happy to attempt to contribute a fix. I thought about two potential options; disabling getting the size or accepting a mask on
DeleteDockerImagesOlderThan
.The text was updated successfully, but these errors were encountered: