mixer-tools icon indicating copy to clipboard operation
mixer-tools copied to clipboard

Feature: mixer to clean old updates to free disk space

Open chivakker opened this issue 6 years ago • 6 comments

It turns out that after a number of mixer build bundles && mixer build update, one can run out of space in the disk. It would be good to have a command that will remove old update/ stuff that is not useful going forward.

chivakker avatar Oct 09 '18 19:10 chivakker

What exactly is not useful going forward? Since you cannot ensure all clients will be updated, you need to keep all previous versions available. Also, a file needed in the current version may be present in a previous version if there were no changes to that file, so pretty much all the content in update/ must stick around.

rchiossi avatar Oct 10 '18 07:10 rchiossi

What does mixer do if it runs out of space? does ti notify the user it needs X amount of space to continue?

LibertadCruz avatar Oct 31 '18 18:10 LibertadCruz

@LibertadCruz yes it does lately. The best option to free space in the disk is as follows

Before running out of space

mixer build all --native --min-version={current-version - 1}

then it is safe to erase all versions {current-version -2}

@rchiossi, I believe the above can be converted into a mixer command that calculates versions and is transparent to users.

chivakker avatar Oct 31 '18 19:10 chivakker

@chivakker removing old content is not a trivial thing like rm -rf /old-content, you will need to decide which content you don't need anymore, which clients are on which versions, because if you remove the update content for a version they are on, they will no longer be able to verify or install content, etc.

This is unfortunately not something that can be easily generalized, but very easy to do process-wise for an OSV running mixer. Following your process above is one way, and you should be aware of your system limits :)

tmarcu avatar Nov 05 '18 22:11 tmarcu

Re-opening for tracking purposes, but this is a large engineering effort on the code side that I still think should be mitigated by proper build processes.

tmarcu avatar Nov 05 '18 22:11 tmarcu

This would be super useful for devops. It sometimes rely on doing a minversion to aggressively clean space, which is a penalty to clients to deal with a "server" problem. Its would help to minimize those cases (even that you hardlink, there is a bunch of stuff to be removed as the time goes by).

We could have 'mixer clean <int optional arg>' to do the cleaning where the arg is the number versions we want to keep due to create delta packs.

mbelluzzo avatar Feb 05 '19 22:02 mbelluzzo