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

[BUG]: MAX fills up cache #256

Open
martinvuyk opened this issue Nov 25, 2024 · 3 comments
Open

[BUG]: MAX fills up cache #256

martinvuyk opened this issue Nov 25, 2024 · 3 comments
Labels
enhancement New feature or request max-repo

Comments

@martinvuyk
Copy link
Contributor

martinvuyk commented Nov 25, 2024

Bug description

I don't use MAX, yet it comes bundled with Mojo. I have a small partitioned disk for 2 OSes and it fills up quick. I've been downloading nightly almost every time one comes out, my cache was at 125.2 GB. Every max-core nightly is around 1.4 GB, /max-core[...]/lib/mojo shows ~33 MB. I deleted many other packages as well, but the cache got reduced to 11GB when I deleted mostly only max-core versions (I imagine it's because of the amount of static linking you do).

There were many files which hadn't been accessed in 2 months and are hanging unused by any environment. Could you please set it up so that either some time passes since the file has been accessed and/or if there are more than X files newer and Y files older than 2 months, they get deleted? Maybe deleting the cache after upgrading an environment, or setup a timer until it gets used by another environment, or do some sort of ref count. Maybe set this up only for nightly. It would be nice to allow this to be configurable as well (something like magic --cache-config). I imagine pixi already has this functionality.

Steps to reproduce

...

System information

...
@martinvuyk martinvuyk added the bug Something isn't working label Nov 25, 2024
Copy link
Member

Thanks for reporting! I'm assuming you don't have a global environment so what happens if you run magic clean ?

@ehsanmok ehsanmok added the enhancement New feature or request label Nov 25, 2024 — with Linear
@ehsanmok ehsanmok removed the bug Something isn't working label Nov 25, 2024
@martinvuyk
Copy link
Contributor Author

martinvuyk commented Nov 25, 2024

Thanks for reporting! I'm assuming you don't have a global environment so what happens if you run magic clean ?

It deletes the local env folder and it does not delete the cache for that installation since it doesn't download again if I rerun magic update && magic install. magic clean cache works but deletes everything (whish I'd done magic clean -h sooner, I went directly to the folder 😆), I think it needs some better granularity but it seems that it's a limitation of pixi itself (running magic clean cache -h shows very limited options).

I think it's still a good default to have global cache, but there needs to be some cleanup given MAX is so huge. But this seems like a potential issue only for people who have a lot of different versions.

BTW (a tangential issue that I came across when trying to solve this), another issue of the name magic besides there already existing packages with that name, is that when I run man magic I get

MAGIC(5)                                                          BSD File Formats Manual                                                          MAGIC(5)

NAME
     magic — file command's magic pattern file

...

If you are willing to break a lot of code (sooner rather than later), I think renaming is fitting (majic, magic-cli, or something like that; the community would have a blast bike-shedding this)

@ehsanmok
Copy link
Member

Right! good point.

@goldiegadde goldiegadde added the max-repo label Dec 18, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request max-repo
Projects
None yet
Development

No branches or pull requests

3 participants