@helmut Thanks for the report. We are currently planning to introduce feature that makes it possible to expire artifacts, we can think about doing the same about builds. I don't know if we decide to expire builds.
perfect, expiring build's is not that important, expiring artifacts is definitly a feature i would like to have, to get back my diskspace :) - thx for your reply, waiting for 8.7
Grzegorz BizonTitle changed from Cleanup Scripts to Expire build artifacts
Title changed from Cleanup Scripts to Expire build artifacts
We definitely need to have a way to remove the artifacts (and maybe the build), either manually or automatically. When the build artifacts are in the scale of 50MB, you cannot keep them forever.
We will probably ship something like deleting builds manually before making artifacts expire automatically. @ayufan should we ship deleting builds in 8.5?
@ayufan Yes, it is great! But I think manual process is also very important, but not for removing particular artifacts, but for removing entire build (build trace and artifacts included).
@ayufan I was just thinking about a button in a build summary like "Delete this build". This is important in case if build trace discloses some confidential information. There is issue for that somewhere.
Until we get that feature, is it safe to just delete artifacts below /var/opt/gitlab/gitlab-rails/shared/artifacts/ (or whatever path is used) or are they also tracked in the db and it would result in errors or something like that?
I've tried to follow @ayufan 's rails console commands above, to remove some really large artifacts. ci_builds does not seem to be a property anymore - I changed that to builds, which seems to work.
However, running the full command returns nil, and all artifacts are still there.
@roelofs Since 8.5 we have and API for erasing artifacts and ,,Erase'' button, that will delete build trace and artifacts. If you do not want to upgrade, there is now Project#builds method, instead of Project#ci_builds.
@grzesiek Thanks! As mentioned, I found the Project#builds, but issuing the full command as above, does not remove the artifacts. Up to .find_each, it lists the members, but will not remove them with :remove_artifacts.file. Any advice?
For the moment, I'd prefer to remove them this way, rather than do a full upgrade to 8.5.
On a tangential note - is there any way to remove artifacts from the backup:create rake task?
@NeroBurner That would make sense, I am using tags for deployment and want to keep the artifacts since they contain a copy of a specific public release. It should at least be configurable and as I wrote earlier, there should be an option to expire build artifacts if branch/tag is deleted
So, I'm unsure of whether artifact expiry actually made it into 8.8? I upgraded to 8.7.4 2 weeks ago (awesome release!), but would prefer to delay any further upgrades till this functionality has made it in...
Is the expire: 7d implemented already? And how do pages work with this? If a build artifact that represents a GitLab page expires, does the page still work?
In other words, are GitLab pages a copy of an artifact or not?
Is this enabled by default and what does that mean for existing artifacts (For one project I keep a backup from old releases as artifacts and I don't want them to vanish).
@jonathon-reinhart Thank you, and thank you to everyone on the GitLab team for an awesome product! I'm looking forward to 8.9, and to the admin tools for dealing with older artifacts being added!
@roelofs Thanks, but this is no accomplishment of mine; I'm just an actively interested GitLab admin/user. Nice job @markpundsack and @ayufan for implementing this. I too am looking forward to a very nice 8.9 release!
@morph027 Note that my tool is more sophisticated, in that it will not remove artifacts for tagged builds, and will only remove builds older than X days. If you have any problems with it, I would appreciate it if you open an issue. Thanks!
For reference, these GitLab Rails console commands doesn't seem to work any more. If anyone has an up-to-date command for doing like this, it'd be greatly appreciated.