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

AD: We want artifactory-cleanup-rules! #2

Closed
allburov opened this issue Jul 9, 2018 · 7 comments
Closed

AD: We want artifactory-cleanup-rules! #2

allburov opened this issue Jul 9, 2018 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@allburov
Copy link
Member

allburov commented Jul 9, 2018

copy-past from README.md#ad

We also have python-script for Artifactory intelligence cleanup rules with config format like this:

GOOD_FILTER_PATH_SYMBOLS = [
    r'*release*', r'*/r-*',
    r'*master*',
    r'*stable*',
]

RULES = [
    {'name': 'Clean all *.tmp',
     'rules': [
         rules.repo_by_mask('*.tmp'),
         rules.delete_older_than_n_days(7),
     ]},

    {'name': 'Clean all *.BANNED after 7 days',
     'rules': [
         rules.repo_by_mask('*.BANNED'),
         rules.delete_older_than_n_days(7),
     ]},

    {'name': 'Clean all *.snapshot after 30 days',
     'rules': [
         rules.repo_by_mask('*.snapshot'),
         rules.delete_older_than_n_days(30),
     ]},

     {'name': 'tech-symbols',
     'rules': [
         rules.repo, # repo-name like 'name'
         rules.delete_older_than_n_days(30),
         rules.filter_without_path_mask(GOOD_FILTER_PATH_SYMBOLS),
         rules.filter_without_filename_mask(GOOD_FILTER_PATH_SYMBOLS),
         rules.filter_by_filename_mask('*-*symbols.tar.gz'),
         rules.without_downloads()
     ]},

     {'name': 'docker-scmdev',
     'rules': [
         rules.repo, # repo-name like 'name'
         rules.filter_by_path_mask('scmdev.test*'),
         rules.delete_images_older_than_n_days(1),
     ]},
]

If you want it, please vote for issue and we will schedule time for move project to open-source: #2

@allburov allburov added the enhancement New feature or request label Jul 9, 2018
@rtulke
Copy link

rtulke commented Oct 27, 2019

please commit your clean-up script :)

@pvdissel
Copy link

pvdissel commented Oct 30, 2019

Note that there are also a bunch of cleanup plugins available at:
https://github.com/jfrog/artifactory-user-plugins/tree/master/cleanup
And https://github.com/jfrog/artifactory-user-plugins/tree/master/archive/archiveOldArtifacts

I found https://github.com/jfrog/artifactory-user-plugins/tree/master/archive/archiveOldArtifacts to be most useful, I extended it to also support moving the artifacts disk, this way you can really "archive" old artifacts to another disk instead of just deleting them. I will submit these changes to the repo above soon. But already cleaned/archived about 7TB of artifacts using this plugin.
Good part of this plugin IMHO, is that it runs inside Artifactory, therefor it can use the internal cron functionality of Artifactory. Also, the artifacts I'm working with are sized between a few KB till 5GB each, and running the plugin didn't have any impact on memory usage, CPU spiked sometimes, but our 500+ users don't notice anything, performance wise, of the archiving.

@nikolasj nikolasj assigned nikolasj and unassigned allburov Oct 30, 2019
@jetersen
Copy link

I'd very much appreciate this rule based approach!

@nikolasj
Copy link

nikolasj commented Dec 4, 2019

We are going to move the project to open source in the next 2 weeks

@nikolasj
Copy link

We created artifactory-cleanup project.
You can try to use.
To do this you need install package and follow instration:
python3 -mpip install git+https://github.com/devopshq/artifactory-cleanup.git.
We'll add pypi later.

@jetersen
Copy link

MANY THANKS @nikolasj

@allburov
Copy link
Member Author

allburov commented Oct 8, 2020

Fixed, thank you all!

@allburov allburov closed this as completed Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

5 participants