forked from readthedocs/readthedocs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add supervisord contrib example (readthedocs#3262)
* Add supervisord contrib example Useful for running a development instance really quickly. Doesn't yet support: * ipdb/pdb, but still supports rdb * color log output * Revert to celery concurrency * Updates
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 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
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 @@ | ||
Running Read the Docs via Supervisord | ||
===================================== | ||
|
||
This is the easiest way to start all of the commands you'll need for development | ||
in an environment relatively close to the production evironment. All you need is | ||
``supervisord`` and ``redis-server``. Installation of ``redis-server`` is | ||
outside the scope of this documentation, but once installed, all you need to run | ||
from ``supervisord`` is:: | ||
|
||
pip install supervisord | ||
cd contrib/ | ||
supervisord | ||
|
||
This will bring up a web instance for the dashboard, a web instance for | ||
documentation serving, two celery instances, and redis-server. | ||
|
||
If you already are running redis-server, this will complain about the port | ||
already being in use, but will still load. | ||
|
||
Debugging | ||
--------- | ||
|
||
To debug, set trace points like normal, with ``pdb``/``ipdb``. Then you can | ||
connect to the process by bringing it to the foreground:: | ||
|
||
supervisorctl fg main | ||
|
||
You'll still see logging to STDERR on the main supervisord process page. |
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 @@ | ||
[supervisord] | ||
nodaemon = True | ||
directory = ../ | ||
loglevel = error | ||
strip_ansi = False | ||
environment = PYTHONUNBUFFERED=1,READTHEDOCS_INSTANCE=readthedocs.org | ||
|
||
[inet_http_server] | ||
port = 127.0.0.1:9001 | ||
username = π | ||
password = π | ||
|
||
[supervisorctl] | ||
username = π | ||
password = π | ||
|
||
[rpcinterface:supervisor] | ||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | ||
|
||
[program:redis] | ||
command = redis-server | ||
directory = ../ | ||
priority = 0 | ||
startretries = 0 | ||
stderr_logfile = /dev/stderr | ||
stderr_logfile_maxbytes = 0 | ||
|
||
[program:main] | ||
command = python manage.py runserver 8000 | ||
directory = ../ | ||
priority = 100 | ||
stopasgroup = True | ||
stderr_logfile = /dev/stderr | ||
stderr_logfile_maxbytes = 0 | ||
|
||
[program:celery] | ||
command = celery worker -A readthedocsinc -Q default,celery,web,builder -l DEBUG -c 2 | ||
directory = ../ | ||
priority = 100 | ||
stopasgroup = True | ||
stderr_logfile = /dev/stderr | ||
stderr_logfile_maxbytes = 0 |