-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Track unused models and automatically delete them : issue-08 #87
Track unused models and automatically delete them : issue-08 #87
Conversation
Initially I set the condition to delete the models not used in last 5 minutes for testing . It has been changed to 30 days.
Hi @Amna-28 this is a very good approach, many thanks for taking the lead. I agree with you: deletion of other models should not be done inside the serve command. But having said that, I think you are very close to a good solution - I like the
What do you think about this approach? |
Hi @miquelduranfrigola , this i a great approach I think
I will do the changes shortly, thanks for your guidance. |
This sounds very good! Just keep the "one week" in a variable so we can modify it easily. All the rest looks great. |
Updated serve.py to only include the part where the timestamp of a model is updated.
Maintain last_cleaned.json check if current_time - last_cleaned_time > 1 week , checks unused models and cleans them up
Just read your comment, let me add this to a variable. |
Added the variables that contain the time limit for model clean-up and model usage.
Hi @Amna-28 I am ready to accept your pull request. Before doing that, I am wondering if your code should go in the CLI submodule (as it does now), or rather be applicable to CLI-independent usage (e.g. as a python library). It should be relatively straightforward to migrate your code to the python classes themselves (ModelFetcher, ModelDeleter...) and to the main init.py file. What do you think? Some people use Ersilia as a python package (not as a CLI) and sadly your nice functionalities will not run in their cases. Happy to gather your feedback. If you want to keep the code like this for the moment, I think it is perfectly fine too and I am ready to do the merging. |
Thank you for your feedback @miquelduranfrigola , |
Hi @Amna-28, of course, happy to help. For starters, how about creating a For example, you can have a function called Once all functions are created, we can figure out where to place them exactly. Sounds good? |
Hi @miquelduranfrigola , that sounds great. I will get back to you once I create the functions in the |
Really nice work with the tracking of unused models @Amna-28 😍. I see you're now shifting your code into |
Hi @Riyabelle25 , thankyou for your appreciation and interest. |
Add relevant links
Template for outreachy participants
Move this to the issue templates
Create new issue template for outreachy participants
Signed-off-by: shivani parihar <shivaniparihar1502@gmail.com>
@GemmaTuron I worked on your suggestion and update as per your suggestions. Please check once and give me feedback.
Update the license name and link also.
Signed-off-by: Sukriti-sood <soodsukriti1111@gmail.com>
Hi @GemmaTuron , there was an issue left in my readme file I edited it . Issue - The links present in table of content is opening the editing file instead of the real readme file. Please merge it once again and sorry for you inconvenience.
…mna-issue-08-v1
Hi @Riyabelle25 , many thanks for helping me and migrating the code. I am merging your code into my branch |
[add] Migrate code to python methods under utils/cron.py
Hi @Riyabelle25 and @Amna-28 really appreciate you cooperating here. Thanks. All of this is really great stuff. I really like to keep everything under In the current case, if we use ersilia as a Python library, the cron jobs will not be executed, which is a pity :) Do you think we would migrate the bulk of the code to cron.py, and then just import the functions correspondingly, for example, in the ModelFetcher, ModelFullDeleter, etc? I know this is complicated, so please do not spend too much extra time on this if you get stuck. I am mindful of your time. |
Hi @miquelduranfrigola , I get your point. |
Hi @miquelduranfrigola , I made the following changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very good. Approving PR!
Hi @Amna-28 this looks great. I have approved the PR hoping CircleCI tests will pass. I will let you know if we find any issue, but this looks great overall! |
Hi @miquelduranfrigola,
on issue #8 , I have come up with the following solution:
was fetched (initially)
whenever ersilia hub is used, i.e. when serve.py is executed, it checks if there is any model on the disk unused for more than x
time (I have set it to 5 minutes just for testing) and calls delete command for all unused models.
deleted
Please guide me for the following queries :
The required functionality is running fine overall, but I think there must be a better approach, I would love to hear your feedback on this