Project

General

Profile

Feature #6747

product cleanup script

Added by Lynn Garren about 5 years ago. Updated almost 2 years ago.

Status:
Accepted
Priority:
Low
Assignee:
-
Target version:
-
Start date:
08/04/2014
Due date:
% Done:

0%

Estimated time:
Spent time:
Scope:
Internal
Experiment:
-
SSI Package:
cetpkgsupport
Co-Assignees:
Duration:

Description

Supply a script that can be used to remove a product and all its dependencies. Such a script must verify that the dependencies are not needed by another product in the ups database.

History

#1 Updated by Christopher Green about 5 years ago

  • Status changed from New to Accepted
  • Priority changed from Normal to Low
  • Target version set to 521
  • SSI Package cetpkgsupport added
  • SSI Package deleted ()

This is certainly desirable in some form, but there are complexities and cases where products may be removed that are still desired for standalone use (e.g. python), that need careful consideration.

#2 Updated by Brett Viren about 5 years ago

I recently found the need for such a tool and Lynn pointed me to this ticket.

This seems to be a good application for the mark-and-sweep garbage collection algorithm. I think it should be fairly simple to implement. The one minor sticking point is that one needs to generate the full dependency graph of all the UPS products to be considered.

Can UPS generate this full graph by itself? The only way I know how to do it would be to iterate on the output of "ups list" and call "ups depend" for each line. This should work but will be a bit tedious to code and probably slow to run.

#3 Updated by Brett Viren about 5 years ago

FYI, I've begun development of such a tool.

https://github.com/brettviren/python-ups-utils/

At this point, given the description of a high-level product it can determine which other products may be purged which are not needed by others that are to be kept.

It still needs some testing which I'll do against the installed products at RACF.

BTW, in the end, the mark-and-sweep alg was an overblown idea. Instead, the simple built in Python set methods and what networkx provides was enough to split the product tree into parts that can be purged and parts that must be kept.

#4 Updated by Brett Viren about 5 years ago

FYI, the python-ups-util package now handles purging of products from a UPS products area, correctly respecting any remaining need for shared dependecies. See the readme file for examples. It can only purge at the relatively coarse package/version level. As per discussion on the larsoft mailing list, this is because there is not enough information given by the "ups" command to reliably purge at the level of individual flavor/qualifiers.

#5 Updated by Lynn Garren about 5 years ago

Actually, that's great. Removing all copies of a particular version of a package is what we imagined.

#6 Updated by Kyle Knoepfel almost 2 years ago

  • Target version deleted (521)


Also available in: Atom PDF