This will allow us to use systemd to create a unix socket for incoming Gunicorn requests when deploying.
@mjia what was the thought process of using Gunicorn over Apache + mod_wsgi? With Apache you wouldn't have to deal with systemd unit files. I suppose Apache is rather heavy for a container deployment, but you wouldn't be using systemd in a container anyways.
I'd vote for Apache + mod_wsgi simply because it's what we use in every other Fedora app (that I'm aware of)
There was some discussion of this in #34 ... @mjia can you make your commit message reference that issue please.
I am completely on the fence about whether we should or should not ship a systemd unit in waiverdb itself (vs. install one by Ansible). You are right that in OpenShift the systemd unit will not be used. It will run gunicorn inside the container directly as pid 1.
The commit message has been updated. I have successfully deployed the internal dev server with nginx + Guncorn + systemd as a chance of learning.
As jcline said, I guess we should use Apache + mod_wsgi to keep the consistency.
2 new commits added
rebased
We are shipping two units (the .socket and the .service) so both need to be mentioned here. Same for %systemd_preun.
It doesn't make sense to restart a .socket unit, we actually want to restart just the .service.
You also need %{?systemd_requires} as per: https://fedoraproject.org/wiki/Packaging:Scriptlets#Systemd
%{?systemd_requires}
This is ready to review again.
Typo, should be %systemd_preun
The typo is fixed. :-)
:+1:
Pull-Request has been merged by mjia
This will allow us to use systemd to create a unix socket for incoming Gunicorn requests when deploying.