aixigo / PREvant

Composing Microservices into Reviewable and Testable Applications
MIT License
13 stars 10 forks source link

Automatic Cleanup for PREvant tiles #149

Open AnumDastgir opened 11 months ago

AnumDastgir commented 11 months ago

PREvant allows us to instantiate individual environments very quickly. While this being a great feature, these easily created environments can easily be forgotten, thus causing an issue of draining and running out of resources at the hosting system.

To overcome this issue, an automatic cleanup for those unwanted environments is needed, so that if they're not being used, they can be deleted after a specific time period automatically. For this purpose, the creation time and last updated timestamp for each tile/environment can be kept in account. This data can be utilized to dynamically modify or prolong the configuration, ensuring tiles are deleted only when being idle and not being used for specific amount of time.

Check crate chrono to address this issue.

harridu commented 4 months ago

Please also consider to not restart the environments on a reboot. Esp for using Docker you have to wait ages at boot time, till all containers are running again.

schrieveslaach commented 2 months ago

I'm considering that this deletion should be more sophisticated once PREvant is able to collect metrics of the hardware utilization (see #201) so that things get cleaned up when the backend (K8s or Docker) hardware utilization reaches a certain threshold.