Change the way we run server/workers on public machines
Currently, we run server/wokers via ./bin/run
which just calls server start-all
.
This is fine & quick for dev mode, but for public machines it is suboptimal and causes confusion, like in #495 .
I propose to:
- create a systemd job for server to just run:
nix-shell --run "cabal v2-run gargantext -- server start --mode Prod --settings-path gargantext-settings.toml"
- create a systemd job for workers:
nix-shell --run "cabal v2-run gargantext -- worker run-all --settings-path gargantext-settings.toml"
- create job templates e.g. under
./devops/systemd
so that we have an idea how the job is constructed.
Having jobs in systemd is much better than some command being run in tmux:
-
CPUQuota
setting of systemd: we can limit CPU usage of workers, say, to 50% so that server slowness like in #495 is reduced. - unified logs in
journald
- automatic startup on boot, restarts on failure
- possibility to add dependencies, i.e. ggtx server/wokers won't start until postgres is started