You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/09/18 23:40:17 UTC
[1/3] allura git commit: [#7957] silence some EasyWidgets logging
that pops up when running with gunicorn
Repository: allura
Updated Branches:
refs/heads/master 656dfa307 -> 1d6f87b4f
[#7957] silence some EasyWidgets logging that pops up when running with gunicorn
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/c7195db5
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/c7195db5
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/c7195db5
Branch: refs/heads/master
Commit: c7195db505eb47727b32f94d599f3fe4ca694934
Parents: 656dfa3
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu Sep 17 21:07:45 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 17 21:07:45 2015 +0000
----------------------------------------------------------------------
Allura/development.ini | 8 +++++++-
Allura/docker-dev.ini | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/c7195db5/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index ebca7e5..d8eabf9 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -531,7 +531,7 @@ override_root = task ; TurboGears will use controllers/task.py as root controlle
; https://docs.python.org/2/library/logging.config.html#configuration-file-format
;
[loggers]
-keys = root, allura, sqlalchemy, paste, pylons, taskdstatus, timermiddleware, tmw_details
+keys = root, allura, sqlalchemy, paste, pylons, ew, taskdstatus, timermiddleware, tmw_details
[handlers]
keys = console, stats, taskdstatus, timermiddleware
@@ -567,6 +567,12 @@ level = INFO
qualname = pylons
handlers =
+[logger_ew]
+; easy widgets
+level = WARN
+qualname = ew
+handlers =
+
[logger_tmw_details]
; DEBUG will include every instrumented call in our logging
level = INFO
http://git-wip-us.apache.org/repos/asf/allura/blob/c7195db5/Allura/docker-dev.ini
----------------------------------------------------------------------
diff --git a/Allura/docker-dev.ini b/Allura/docker-dev.ini
index d35fd17..7cc2272 100644
--- a/Allura/docker-dev.ini
+++ b/Allura/docker-dev.ini
@@ -58,7 +58,7 @@ use = main
override_root = task ; TurboGears will use controllers/task.py as root controller
[loggers]
-keys = root, allura, sqlalchemy, paste, pylons, taskdstatus, timermiddleware, tmw_details
+keys = root, allura, sqlalchemy, paste, pylons, ew, taskdstatus, timermiddleware, tmw_details
[handlers]
keys = console, stats, taskdstatus, timermiddleware
@@ -94,6 +94,12 @@ level = INFO
qualname = pylons
handlers =
+[logger_ew]
+; easy widgets
+level = WARN
+qualname = ew
+handlers =
+
[logger_tmw_details]
; DEBUG will include every instrumented call in our logging
level = INFO
[3/3] allura git commit: [#7957] document gunicorn and other wsgi
options
Posted by he...@apache.org.
[#7957] document gunicorn and other wsgi options
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/1d6f87b4
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1d6f87b4
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1d6f87b4
Branch: refs/heads/master
Commit: 1d6f87b4fd901cc87bb91a3e8152f61264c91148
Parents: fadd881
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Sep 18 00:52:02 2015 +0000
Committer: Heith Seewald <hs...@hsmb.local>
Committed: Fri Sep 18 17:38:53 2015 -0400
----------------------------------------------------------------------
Allura/docs/getting_started/installation.rst | 42 +++++++++++++++++++++--
1 file changed, 39 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/1d6f87b4/Allura/docs/getting_started/installation.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/installation.rst b/Allura/docs/getting_started/installation.rst
index 1414236..18a740e 100644
--- a/Allura/docs/getting_started/installation.rst
+++ b/Allura/docs/getting_started/installation.rst
@@ -381,7 +381,8 @@ By default all admins of "allura" project in "Projects" neighborhood are treated
Change default configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-In the :file:`development.ini`:
+The :file:`development.ini` file is geared towards development, so you will want to review
+carefully and make changes for production use.
Change `[handler_console]` section, so that logs go to a file and will include background tasks info.
@@ -407,11 +408,46 @@ You can use the following command to generate a good key:
~$ python -c 'import os; l = 20; print "%.2x" * l % tuple(map(ord, os.urandom(l)))'
+Production-quality web server
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If you are running on a public facing server, you should check out some of the additional gunicorn configuration options at http://gunicorn.org/.
+For example, you'll want multiple worker processes to handle simultaneous requests, proxy behind nginx for added protection, etc.
+
+If you'd like to use another webserver, here are a few options:
+
+`uWSGI <http://uwsgi-docs.readthedocs.org/en/latest/>`_
+
+.. code-block:: bash
+
+ ~$ pip install uwsgi # or install via system packages
+ ~$ uwsgi --ini-paste-logged development.ini --virtualenv /PATH/TO/VIRTUALENV --http 0.0.0.0:8080
+
+
+`mod_wsgi-express <https://pypi.python.org/pypi/mod_wsgi>`_
+
+.. code-block:: bash
+
+ ~$ pip install mod_wsgi # requires httpd2 devel libraries installed in the system
+ ~$ mod_wsgi-express start-server development.ini --application-type paste --user allura --group allura --port 8080 --python-path /PATH/TO/VIRTUALENV/lib/python2.7/site-packages/
+
+For any other wsgi server (e.g. mod_wsgi with Apache, or waitress) you will need a wsgi callable set up like this:
+
+.. code-block:: python
+
+ from paste.deploy import loadapp
+ from paste.script.util.logging_config import fileConfig
+
+ config_file = '/PATH/TO/Allura/development.ini'
+ fileConfig(config_file)
+ application = loadapp('config:%s' % config_file)
+
+
+
Configuring Optional Features
-----------------------------
-The :file:`development.ini` file has many options you can explore and configure. It is geared towards development, so you will want to review
-carefully and make changes for production use.
+The :file:`development.ini` file has many options you can explore and configure.
To run SVN and Git services, see the :doc:`scm_host` page.
[2/3] allura git commit: [#7957] use gunicorn instead of paster serve
Posted by he...@apache.org.
[#7957] use gunicorn instead of paster serve
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/fadd8819
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/fadd8819
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/fadd8819
Branch: refs/heads/master
Commit: fadd8819fd58ff047cbd89ac22e92a1844db669b
Parents: c7195db
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu Sep 17 21:08:06 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 17 21:08:06 2015 +0000
----------------------------------------------------------------------
Allura/development.ini | 2 +-
Allura/docker-dev.ini | 2 +-
Allura/docs/development/contributing.rst | 4 ++--
Allura/docs/getting_started/installation.rst | 2 +-
Allura/docs/getting_started/scm_host.rst | 5 ++---
docker-compose.yml | 2 +-
requirements.txt | 3 +++
7 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/fadd8819/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index d8eabf9..aee8bca 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -611,7 +611,7 @@ formatter = generic
[handler_timermiddleware]
class = handlers.WatchedFileHandler
-; if you run 'paster serve' in allura/Allura/ then that's where this file will be
+; if you run 'gunicorn' in allura/Allura/ then that's where this file will be
; you may want to hard-code a specific directory here.
args = ('stats.log', 'a')
level = NOTSET
http://git-wip-us.apache.org/repos/asf/allura/blob/fadd8819/Allura/docker-dev.ini
----------------------------------------------------------------------
diff --git a/Allura/docker-dev.ini b/Allura/docker-dev.ini
index 7cc2272..25f2232 100644
--- a/Allura/docker-dev.ini
+++ b/Allura/docker-dev.ini
@@ -138,7 +138,7 @@ formatter = generic
[handler_timermiddleware]
class = handlers.WatchedFileHandler
-; if you run 'paster serve' in allura/Allura/ then that's where this file will be
+; if you run 'gunicorn' in allura/Allura/ then that's where this file will be
; you may want to hard-code a specific directory here.
args = ('stats.log', 'a')
level = NOTSET
http://git-wip-us.apache.org/repos/asf/allura/blob/fadd8819/Allura/docs/development/contributing.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/development/contributing.rst b/Allura/docs/development/contributing.rst
index a3b8ba4..56ee818 100644
--- a/Allura/docs/development/contributing.rst
+++ b/Allura/docs/development/contributing.rst
@@ -175,9 +175,9 @@ foreground::
cd Allura
# web
- pkill "paster serve" && paster serve --reload ../development.ini
+ pkill -f gunicorn; gunicorn --reload --paste development.ini
# taskd
- pkill "^taskd" && paster taskd ../development.ini --nocapture
+ pkill "^taskd"; paster taskd development.ini --nocapture
Make a request to the web app, and when your line of code is hit, a debug
session will start on the console where the process is running.
http://git-wip-us.apache.org/repos/asf/allura/blob/fadd8819/Allura/docs/getting_started/installation.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/installation.rst b/Allura/docs/getting_started/installation.rst
index 5ad62a7..1414236 100644
--- a/Allura/docs/getting_started/installation.rst
+++ b/Allura/docs/getting_started/installation.rst
@@ -199,7 +199,7 @@ This shouldn't take too long, but it will start the taskd server doing tons of s
.. code-block:: bash
- (env-allura)~/src/allura/Allura$ nohup paster serve --reload development.ini > /var/log/allura/allura.log 2>&1 &
+ (env-allura)~/src/allura/Allura$ gunicorn --reload --paste development.ini # add --daemon to run in the background
Next Steps
^^^^^^^^^^
http://git-wip-us.apache.org/repos/asf/allura/blob/fadd8819/Allura/docs/getting_started/scm_host.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/scm_host.rst b/Allura/docs/getting_started/scm_host.rst
index 0e91a15..18811b5 100644
--- a/Allura/docs/getting_started/scm_host.rst
+++ b/Allura/docs/getting_started/scm_host.rst
@@ -209,9 +209,8 @@ access handler, e.g.:
AuthBasicAuthoritative off
# Change this path if needed:
PythonOption ALLURA_VIRTUALENV /home/vagrant/env-allura
- # This routes back to the allura webapp, port 8080 if running with paster server (~/start_allura)
- # In a production environment, run allura with a real WSGI server, and
- # change the IP address and port number as appropriate.
+ # This routes back to the allura webapp
+ # In a production environment, change the IP address and port number as appropriate.
# And use https if possible, since the username and password are otherwise
# sent in the clear to Allura.
PythonOption ALLURA_AUTH_URL http://127.0.0.1:8080/auth/do_login
http://git-wip-us.apache.org/repos/asf/allura/blob/fadd8819/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index 8c75cb4..3606980 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -18,7 +18,7 @@
web:
build: .
working_dir: /allura
- command: bash -c 'cd Allura && paster serve docker-dev.ini --reload'
+ command: bash -c 'cd Allura && gunicorn --paste docker-dev.ini --reload'
ports:
- "8080:8080"
volumes:
http://git-wip-us.apache.org/repos/asf/allura/blob/fadd8819/requirements.txt
----------------------------------------------------------------------
diff --git a/requirements.txt b/requirements.txt
index 854688f..e33b957 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -86,3 +86,6 @@ WebError==0.10.3
-e git://github.com/brondsem/sphinx-argparse.git#egg=sphinx-argparse # pending merge requests
sphinx-rtd-theme==0.1.6
sphinxcontrib-programoutput==0.8
+
+# deployment
+gunicorn==19.3.0
\ No newline at end of file