devopshq / devopshq/artifactory-cleanup
_collect_docker_size queries for all items in the registry
- Dominant language
- Python
- Stars
- 160
- Forks
- 87
- PR merge metrics
- No merged PRs in 30d
Description
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:
```
- name: Example
rules:
- rule: Repo
name: "docker"
- rule: IncludePath
masks: "app/*"
- rule: DeleteDockerImagesOlderThan
days: 14
```
https://github.com/devopshq/artifactory-cleanup/blob/018dcdb9c637db5210fa1d8f15a7df5288a2fee1/artifactory_cleanup/rules/docker.py#L63
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`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.