-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganise Bouncer's Gunicorn config
This reorganise's Bouncer's Gunicorn config files following the same pattern as was recently done in h: hypothesis/h#8407 I'm applying this simpler and more explicit Gunicorn config approach to all our apps consistently. For motivation see: https://docs.google.com/document/d/13AnUPtu9AO3PfRm-fhH7_3RZzyLGSFd4uPv36dIeynA Benefits: * Gunicorn config files are explicitly mentioned in the `gunicorn` commands in the `supervisord[-dev].conf` files. This makes things less confusing/surprising, less likely that a Gunicorn config file will be missed (compared to Gunicorn's default behavior if you run it without a `--config` argument: it reads any `gunicorn.conf.py` file in the current working directory). * The Gunicorn config files are in the `conf/` directory with the other config files. Again: makes it less likely that a config file will go unnoticed. * Separate production and development Gunicorn config files. This is consistent with our separate production and development Pyramid config files, and is probably a good idea to prevent development settings accidentally getting applied in production. (Gunicorn's default behavior of reading a root `gunicorn.conf.py` file would mean that file gets read in both dev and production).
- Loading branch information
Showing
17 changed files
with
145 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ | |
|
||
node_modules | ||
bouncer/static/scripts/bundle.js | ||
supervisord.log | ||
supervisord.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[app:main] | ||
use = call:bouncer.app:create_app | ||
debug = true | ||
|
||
[loggers] | ||
keys = root, bouncer | ||
|
||
[handlers] | ||
keys = console | ||
|
||
[formatters] | ||
keys = generic | ||
|
||
[logger_root] | ||
level = INFO | ||
handlers = console | ||
|
||
[logger_bouncer] | ||
level = DEBUG | ||
handlers = | ||
qualname = bouncer | ||
|
||
[handler_console] | ||
class = StreamHandler | ||
args = (sys.stderr,) | ||
level = NOTSET | ||
formatter = generic | ||
|
||
[formatter_generic] | ||
format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
bind = "0.0.0.0:8000" | ||
reload = True | ||
reload_extra_files = "bouncer/templates" | ||
timeout = 0 | ||
workers = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bind = "0.0.0.0:8000" | ||
worker_tmp_dir = "/dev/shm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[pipeline:main] | ||
pipeline: | ||
proxy-prefix | ||
bouncer | ||
|
||
[app:bouncer] | ||
use = call:bouncer.app:create_app | ||
|
||
[filter:proxy-prefix] | ||
use: egg:PasteDeploy#prefix | ||
|
||
[loggers] | ||
keys = root, bouncer, alembic | ||
|
||
[handlers] | ||
keys = console | ||
|
||
[formatters] | ||
keys = generic | ||
|
||
[logger_root] | ||
level = INFO | ||
handlers = console | ||
|
||
[logger_bouncer] | ||
level = DEBUG | ||
handlers = | ||
qualname = bouncer | ||
|
||
[logger_alembic] | ||
level = INFO | ||
handlers = | ||
qualname = alembic | ||
|
||
[handler_console] | ||
class = StreamHandler | ||
args = (sys.stderr,) | ||
level = NOTSET | ||
formatter = generic | ||
|
||
[formatter_generic] | ||
format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[supervisord] | ||
nodaemon=true | ||
silent=true | ||
|
||
[program:web] | ||
command=newrelic-admin run-program gunicorn --paste conf/development.ini --config conf/gunicorn-dev.conf.py | ||
stdout_events_enabled=true | ||
stderr_events_enabled=true | ||
stopsignal=KILL | ||
stopasgroup=true | ||
|
||
[eventlistener:logger] | ||
command=bin/logger --dev | ||
buffer_size=100 | ||
events=PROCESS_LOG | ||
stderr_logfile=/dev/fd/1 | ||
stderr_logfile_maxbytes=0 | ||
stdout_logfile=/dev/null | ||
|
||
[unix_http_server] | ||
file = .supervisor.sock | ||
|
||
[rpcinterface:supervisor] | ||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | ||
|
||
[supervisorctl] | ||
serverurl = unix://.supervisor.sock | ||
prompt = bouncer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ pip-tools | |
pip-sync-faster | ||
ipython | ||
ipdb | ||
supervisor | ||
-r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ h-pyramid-sentry | |
pyramid | ||
pyramid-jinja2 | ||
requests | ||
newrelic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters