sorry i didn't mean to skip anything, what did I miss?
Koterpillar
oops, my bad, it's me who missed the dpaste. Jon_R: sorry!
Jon_R: nothing, sorry
Jon_R
kk :-)
moldy
Jon_R: you have --python-path in your systemd unit file right now? if you didn't do that yet, please run systemctl stop gunicorn; systemctl daemon-reload; systemctl start gunicorn
calq_ has quit
also, show us the updated gunicorn.service file
darylantony joined the channel
Jon_R
ah that's a good point i've been reloading not restarting, 2 secs
programmerq joined the channel
FunkyBob
gah
Jon_R
it's --pythonpath not --python-path, 2 secs
moldy
oh, right -- sorry
SamSagaZ_ joined the channel
Jon_R
woohoo!
it works!
moldy
good :)
FunkyBob
I'll stick with uwsgi, thanks :)
koyaan joined the channel
Jon_R
my systemd config now just says "/srv/wsgi/django/env/bin/gunicorn --env DJANGO_SETTINGS_MODULE=production.settings --pid /run/gunicorn/pid production.wsgi" , no pythonpath or anything
but it works :-)
which is what i had before, but now somehow it's different
FunkyBob
pid files? really?
why?
moldy
FunkyBob: does uwsgi make a big difference here? you don't have to specify the pythonpath there?
Jon_R
because that's what the gunicorn documentation says to use
moldy> in uwsgi you just say virtualenv=/foo/env and job done
moldy
oh. i actually like the gunicorn approach better, tbh.
Jon_R
i'm trying to behave myself and do what I'm told as much as possible here :-)
FunkyBob
well, you can install uwsgi in your venv
moldy
FunkyBob: yes, that's what i do with gunicorn, too
FunkyBob
however, uwsgi provides a LOT more than gunicorn
moldy
but how does uwsgi detect the path to your django project root if you don't configure it?
FunkyBob
moldy: that's nothing to do with venv
moldy
FunkyBob: yes, that is why i wonder
FunkyBob
that's a pythonpath issue, and you configure that
Jon_R
haha now all i need to do is work out how to get nginx to behave
sure, uwsgi can do more, but if you don't need any of that, it doesn't matter. i also think that uwsgi does a little too much, maybe. matter of taste :)
FunkyBob
I really need to put fragment links in this doc
moldy: yeah.. Graham Dumpleton has the same view :)
it's a bit like AWS... once you start using one thing, it tends to borg the rest of you
moldy
i don't really enjoy it to take over maintainership of projects that are uwsi-only because they use their "cron" thing, for example
FunkyBob
caching, spooling, and so much more :)
moldy
uhh :p
pjs
uwsgi cron thing?
FunkyBob
yeah, it can run periodic tasks
moldy
iirc i was told you can run periodic tasks with uwsgi
FunkyBob
moldy: ws API, mules, offload workers...
pjs
hah cool. I didn't even know that and I've used uwsgi forever
moldy
so you don't need celery (which is nice), but now your app is bound to uwsi (not so nice)
ToApolytoXaos has quit
mattmcc
Heh. We've actually got a project where uwsgi spawns the celery worker with attach-daemon.
FunkyBob
oh, yeah, so don't need supervisord either :P
moldy
i just use systemd :)
FunkyBob
eww
moldy
by now it's a good practice, imho
FunkyBob
:P
moldy
why should each app deploy its own process supervisor
and you get half-decent logging for free.. journalctl -u
FunkyBob
oh, I agree... _no_ app needs to daemonise
moldy
and the template thing can be used to get zero-downtime deployment relatively easily
pjs
mattmcc: hah
Utal joined the channel
FunkyBob
and if you move resource limit enforcement, duration control ,et c etc into the launcher's config, you're moving closer to mainfame OS territory :)
eieste has quit
moldy
what i do is: have gunicorn.project_name@.service, where the tag is a timestamp. deploy the new code to a directory with a timestamp in the name, start the new service, rewrite the nginx config, wait a little, reload nginx
FunkyBob
I did something similar for opensm ... the @ syntax is neat
barajasfab joined the channel
the way I configure nginx means I don't need to reconfigur it
moldy
oh, how do you do that?
FunkyBob
see my link ^^ :)
moldy
will give it a read :)
darylantony has quit
though i probably need an nginx config change in some situations, because i also do fully-automatic letsencrypt :)
FunkyBob
it's not quite what I use now... [many of my servers don't even use nginx now]
ah, yes...
moldy
so i first deploy the app with ssl, then get the cert, then enable ssl
the line before is Sep 28 01:17:45 dexter gunicorn[31296]: browser reported failure
the line before that says "received unexpected data"
moldy
i really think i should polish up my stuff, document it, support more distros, and then we could have a nice community-managed standard deployment script
"uWSGI 1.9 (codenamed “ssl as p0rn”) added support for SNI (Server Name Identification) throughout the whole SSL subsystem. The HTTPS router, the SPDY router and the SSL router can all use it transparently."... why are they using pr0n as a codename, why are they doing SPDY...?
FunkyBob
well, they do https2 now
in 1.9 it was still called spdy :)
hamdjan joined the channel
darylantony has quit
Jon_R
yeah but uwsgi is wsgi why is it worried about http/http2/etc at all?
FunkyBob
... no, it's FAR FAR more than that
tdy joined the channel
darylantony joined the channel
besides, WSGI is just the back end... it needs a front end protocol to talk, right?
it does http, https, http2, uwsgi, fastcgi... and probably more
just like gunicorn talks http
Jon_R
oh i thought it was a wsgi server you stuck a web server in front of
yeah that was a thing that worried me about gunicorn ;-)
FunkyBob
well, sure, but it needs a protocol for other servers to pass it requests, right?
Utal has quit
Jon_R
yes, wsgi?
FunkyBob
wsgi is not a protocol
it's an API specification
an interface
the whole point of tools like gunicorn, uwsgi, waitress, etc...
is to publish WSGI apps
provide some protocol for requests to come in, and then hand them to the app
Jon_R
ok so I now have no idea what "uwsgi_pass" does in nginx ;-)
moldy
FunkyBob: where is the uwsgi_pass thing coming from?
FunkyBob
moldy: ?
Jon_R: it tells nginx to pass requests to another server using the uwsgi protocol
Jon_R
uwsgi is a protocol?
frewsxcv_
uWSGI designed its own protocol, unrelated to WSGI or HTTP
ironfroggy joined the channel
Jon_R
ah
here's me trying to avoid NIH syndrome and finding myself constantly the victim of other peoples' addiction to it ;-)