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

prune #8

Open
mottosso opened this issue Jun 27, 2019 · 1 comment
Open

prune #8

mottosso opened this issue Jun 27, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@mottosso
Copy link
Owner

Goal

Optimise disk space by cleaning up unused localised packages

Motivation

Localising works great for performance, but isn't as friendly on disk space, especially not when packages are large, like Maya itself or larger plug-ins for it like Arnold.

Over time, as projects come and go, artists may find themselves with a lack of disk space due to localised packages or versions of packages that are no longer used.

Implementation

rez env localz -- prune

The question is, which packages should it remove? Preferably, it would just remove those that hasn't been used in x-amount of time (x being configurable) but as there isn't anything tracking when and where packages are used that's hard to tell.

A less great but possibly sufficient metric is to look at the time of localisation. E.g. anything localised a month or later ago is pruned.

Because localised packages also exist "online" (i.e. on a server or web) then pruning a critical and often used package wouldn't break anything; it would just temporarily run slower until it has been relocalised.

From there, we could implement further mechanisms to fine-tune this pruning.

rez env localz -- prune --before=30d
rez env localz -- prune --before=1561646445  # Timestamp
rez env localz -- prune --after=1561646444
rez env localz -- prune --greaterThan=1GB
rez env localz -- prune --lessThan=1MB
rez env localz -- prune --size=20MB,<1GB  # Complex expressions
rez env localz -- prune --versionCount=1+
rez env localz -- prune --variantCount=<3
@mottosso mottosso added the enhancement New feature or request label Jun 27, 2019
@bfloch
Copy link

bfloch commented Jun 27, 2019

Looking good!

It should have exclusion filter, for example for currently deployed toolsets that are know to be used for a particular project.

This could be a set with an existing context.
prune --keep-intersect=project.rxt

Maybe there is other metrics that are native to a studio. Some do their own telemetry so next to the build-in criteria I could imagine a plugin interface that accepts:
--filter=studio_telemetry,123,456 where studio_telemetry is the name of the custom filter and everything else is arguments.

Maybe some buildins could be implemented this way. I wouldn't mind:
--filter=before,30d and --filter=intersect,project.rxt but one could also register with custom parameters instead.

Not particular thought out yet, but hope it's useful feedback regardless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants