speedianet / os

Speedia OS is a container operating system designed so you never have to write a Dockerfile again.
https://speedia.net/os/
Eclipse Public License 2.0
11 stars 2 forks source link

refactor: replace ochinchina/supervisord #57

Open ntorga opened 3 weeks ago

ntorga commented 3 weeks ago

We are using its API and honestly the facade wasn't well written, so replacing it won't be easy peasy. However, it's a great opportunity to search for better replacements and write the code properly, maybe use a version written in Rust, Zig or even the original one as long as the memory requirements isn't that high.

ntorga commented 5 days ago

I looked for an alternative solutions and found nothing reliable enough. There are one here and there but none that is well maintained. The python version is available on minideb by default and I can't find any reason not to use it. The memory usage is not higher and it won't install any dependencies.

I checked the servicesQueryRepo infra implementation and oh boy, that's nasty. It was written before we decided to use templates and sqlite on the project so it's a web of string manipulations done with splits and concatenation. Argh.

The supervisord.conf will need to be updated on the first boot to use a random generated password, although its API will be running via unix socket, so it already doesn't pose any risk.

We can store most of the data regarding the services on the sqlite so if we need to update the .conf file, we just read the entire thing and generate a brand new .conf, easier than "sed" here and "sed" there.

The only info we won't be able to fit on the database is the service status and its metrics of course.