-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
feat: vacuum unused packages #3467
base: main
Are you sure you want to change the base?
Conversation
Is the command name
|
About command name
When I was working on the integration, I wanted to use "remove" but there were dependencies in the controller with elements that were, with my level in golang..., too important. It seemed to me that there was a dependency with the If I have X repositories with different yaml configurations, I didn't want the command to interact only with the packages defined in one of them. So I wanted to have a complete decorrelation with remove. And when I proposed the idea in the https://github.com/orgs/aquaproj/discussions/3086, I had thought of vacuum rather than clean, as I felt that clean was too close to remove in connotation. And I thought of Postgres, which implements the vacuum command. In the end, it seemed more appropriate. Also, adding timestamp management to the use/download of each package seemed too far removed from the term "remove", I felt that adding a new feature responsible for the overall functionality of remembering the elements it needs to clean was more coherent.
What don't you like about "vacuum"? Whether or not to use a db bboltI would have loved to have my name on this repository code and i found the use of a bbolt really sexy. But I still think that using a bbolt is more appropriate, as it seems less "cobbled-together". Then perhaps registry management or other elements could be integrated in the future? In short, you have the last word! |
Thank you for your comment. Now I think adding a vacuum command is best. About the command name, note that I'm not a native English speaker and I'm not so good at English. The word "vacuum" brought to mind the noun meaning "a void" or "emptiness." https://www.ldoceonline.com/dictionary/vacuum
Agree. About merging, I considered API. e.g. remove --expired [--init-timestamp, --init-vacuum] [--expired-days 60] But I don't think this is user-friendly.
Yeah, I'm so sorry to create a new pull request instead of your pull request. I think BoltDB is an awesome project. I was glad to learn it in this time. Ideally, I'd like to store metadata in the same directory with each package. Now:
Ideal: (There is a room to improve file and directory names and structure)
But this is a breaking change, so we gave up it. |
v2.43.0-0 is out. https://github.com/aquaproj/aqua/releases/tag/v2.43.0-0 You can try this version: aqua upa v2.43.0-0 The document is here. aquaproj/aquaproj.github.io#1342 Note:
|
|
Close #2942
aqua vacuum
removes packages and timestamp files if timestamp is older than vacuum days.aqua vacuum --init
searches packages from aqua.yaml including global configuration files$AQUA_GLOBAL_CONFIG
and creates timestamp files if they are installed.How does it work?
aqua manages each package's last used datetime in
$(aqua root-dir)/metadata/<package path>/timestamp.txt
.aqua creates or updates these files when packages are installed or executed.
aqua vacuum
removes packages and timestamp files if timestamp is older than vacuum days.Until packages are installed or executed, timestamp files aren't created.
If packages don't have timestamp files,
aqua vacuum
doesn't remove those packages.To solve the problem,
aqua vacuum --init
searches packages from aqua.yaml including global configuration files$AQUA_GLOBAL_CONFIG
and creates timestamp files if they are installed.Compared with #3442
#3442 uses boltDB to manage last used dates.
On the other hand, this pr uses text files to manage them.
This pull request is much simpler than #3442 and the overhead is much cheaper.
We don't need to learn boltDB, and we don't need to maintain complicated asynchronous codes.
Complicated code makes the maintenance hard and raises bugs easily.
So simplicity is justice.
This pull request doesn't implement functions to show timestamps because the feature is used only for debug.
This pull request implements the function to initialize timestamps by the current datetime.
Performance