Charm Needed: Gunicorn (WSGI subordinate)
Bug #1012939 reported by
Patrick Hetu
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Juju Charms Collection |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Since there is a lot of different WSGI http servers and that they are deployed on the same machine
that runs the WSGI application, they would make good candidates to be used as subordinates. Gunicorn is my favorite
WSGI server so I made a charm for it.
One thing still bugs me: how do I restart the wsgi server on application's configuration change hook?
In other words, does the config-change hooks propagate to its subordinate?
Related branches
Changed in charms: | |
status: | Incomplete → Fix Committed |
To post a comment you must log in.
Hi Patrick. Encapsulation demands that you communicate with the other charms via relationships only. This is relatively simple. If, in your config-changed, you want to inform the other side of your wsgi relationships that something is changed, you can do something like this:
for relid in `relation-ids wsgi-file` ; do myconfig. conf`
relation-set -r $relid config-md5=`md5sum /etc/gunicorn/
done
This works in all hook contexts, not just *-relation-* hooks.
This will cause the other side's "changed" hook to execute. You don't have to use the 'config-md5' value.. you could use a timestamp, someting. Just change some variable. Then the other side will be able to react.