ITISFoundation / osparc-simcore

🐼 osparc-simcore simulation framework
https://osparc.io
MIT License
46 stars 27 forks source link

Global Resource Expiration System #1489

Closed GitHK closed 1 year ago

GitHK commented 4 years ago

USER STORY

As a developer I want to create temporary resources which expire after a certain amount of time. The following must apply:

Current Implementation

Submodule resource_manager in the webserver service:

Shortcomings:

Observations

Systems which might need resource expiration:

Useful features to have:

Motivation

Because generally all resources are tied to a user or some user activity it makes sense to bundle them in a "TTL session".

Implementation proposal

Create a separate service which runs in a separate container. We expose it via an API to internal services. Also a python module should be created which interacts directly with the API. This service is responsible for checking resource TTLs and removing resources when they expire. The service must have access to the systems which must be garbage handled (eg: Postgres, MinIO, etc...) For each resource type a "destroy" callback must be implemented which actively removes the resource from the system. This is the only piece of code which has to be actively maintained in case of changes.

[suggestion @sanderegg] I agree we should have one service for resource management in a mid-term timing. But this sounds like much more to do in terms of refactoring and we have an issue right now that could be fixed pretty fast.

My suggestion here would be:

  1. first fix the 2 issues using the current webserver as it is (see my fix suggestions above) - we need these problems resolved
  2. Create a separate service (which will for sure mean quite a bit of refactoring)

Possible side effects

This issue was created from the following document

sanderegg commented 1 year ago

named garbage collector.