cli: new "node prune" command
Used to remove shared parts that are no longer referenced.
With shared part installed for example in
the heuristic is to assume that if
HASH is present in a software's
.installed.cfg, then this software is using this shared part.
HASH is present in
/opt/slapgrid/shared/another/ANOTHER_HASH/.slapos*signature then share
part another for hash
ANOTHER_HASH is using the shared part.
This also have some support to recursively look in instances and if they
slapos.cfg file, look for software and shared parts to see if
they use the shared part.
In other cases, this shared part can be deleted.
marked as a Work In ProgressToggle commit list
@rafael @tomo @luke @alain.takoudjou I adapted my quick script to remove unused shared parts and made it a slapos command. This uses JP's "GC" approach from "Shared build" thread on nexedi forum, but does not rely on symlink, but simply of the presence of the hash in
- is that name OK
slapos node prune?
- isn't there already a function we can use instead of that
rmtreethat is duplicated from test node for now ?
There is a
--dry-runoption :). Even though I used similar script several times, I think we should be paranoid and use this option a bit and check it works .
- is that name OK
I think the name is ok, the other alternative could be more an option of slapos node software (like --prune), this would avoid to extend the API more widely.
But I have no preference myself.
This seemed to work "well enough" and it's probably better to merge this so that people can start to use this command. If it's only in this branch it's not so easy for average user to use the feature.
Let's merge ?
unmarked as a Work In ProgressToggle commit list
mergedToggle commit list