InseeFrLab / onyxia

🔬 Data science environment for k8s
https://onyxia.sh
MIT License
463 stars 80 forks source link

admin feature : allow the possibility to call onyxia api to suspend a service #830

Open alexisdondon opened 3 months ago

alexisdondon commented 3 months ago

The suspension of a service is a great feature to allow ressources savings.

Anyway none of my user click on suspend and we begin to implement an admin task running at regular interval to ask for the suspension of user service.

The workflow is:

There is some drawbacks:

I don't know the signature of onyxia api to ask for suspension but if not too hard, impleting and admin endpoint to ask for the suspension of a user service with an api admin token or something else that secure the call could allow for us a simpler workflow:

fcomte commented 3 months ago

what do you think ? @trygu @johnksv @olevitt

olevitt commented 2 months ago

I agree there is some logic hidden behind the "pause / resume" that makes scripting outside of Onyxia doable but not that easy.

Creating a /admin path in Onyxia-API with some endpoints (starting with the pause / resume) makes sense to me. Creating another module (instead of adding that to Onyxia-API) does not seem worth it to me at the moment. If the admin features tend to grow a lot then we could still reconsider this and move that onto a new module. As for the authentication, I think we can start simple with a admin token that would be provided in the env configuration. I also think the admin path should be disabled by default.

I will draft a PR to implement this. Feel free to comment and discuss in it :)