fix: start the services from the virtual environment instead of through uv #196
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Michiel-Beijen/intranet:fix/services-use-existing-venv"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #195, which did the same for the cron scripts.
What
Both unit files in
deploy/started the service withuv run. They now startgunicornanddaphnedirectly from.venv/bin. The twoUV_*settings in the gunicorn unit are removed, because nothing reads them any more.Why
uv runsyncs the environment before it starts the program. The services run aswww-data, with a different uv cache than the deployment uses, so every restart could rebuild parts of.venvunder a second account. After this change the deployment (rollout-prod.sh) is the only thing that builds the environment.Behaviour change
A service restart can no longer repair a broken or missing
.venv. If the deployment failed halfway, the services fail to start until the deployment is rerun.Installing
Merging does not change the running services: the unit files are copied to the server by hand. After the merge has deployed:
The installed units on the server are currently identical to the old versions in this repository.
Testing
Locally, started both programs straight from
.venv/binwith an empty environment (no activation, no uv); both served the front page with HTTP 200. Not tested under systemd.