This repository has been archived by the owner on Jul 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
use uwsgi instead of paste #471
Open
joka
wants to merge
25
commits into
develop
Choose a base branch
from
feature_444_use_uwsgi_instead_of_paste
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
b94c667
run adhocarcy with uwsgi instead of paster
joka a03f4c3
updated changelog
joka d293ff2
use virtualenv to create python executables, uwsgi needs this
joka 8fda21d
improved uwsgi conf
joka 60feb81
set LD_LIBRARY_PAT right to make PIL work
joka 3b121e3
improved uwsgi conf
joka cd49610
nicer uwsgi conf
joka 9439517
added script to open an interactive python shell with "IPDB()".
joka 439ca1c
Merge branch 'develop' into feature_444_use_uwsgi_instead_of_paste
joka 038bf75
Merge branch 'develop' into feature_444_use_uwsgi_instead_of_paste
joka b712f26
link lib and include directory instead of using virtualenv
joka 4dc5398
cleanup
joka e49fd89
[build.sh] Rebuild Python if lib/ is missing
phihag eb4e135
Remove hardcoded path
phihag 398038b
Fix gitignore: lib is a symlink, not a directory
phihag 0d75019
Fix listen
phihag 7582ed3
Fix: uwsgi process is forking off
joka b72920a
Cleanup linking the python binaries and lib directory
joka 3091da4
Fix: buildout vars "etc-directory" and "var-directory" do not exists
joka 9b16c97
Removed buildout options domains.main and ports.main
joka 977b45e
Fix: error message when starting uwsgi
joka 85f6388
Fix: uwsgi recompiles all the time
joka 88d0937
compile uwsgi without xml support to remove the libxml dependency
joka 92ad97a
updated uwsgi to 1.9.13 to enable support of
joka fd03c1c
Fix: uwsgi start script does not run mit 'bin/sh'
joka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -24,6 +24,7 @@ parts | |
bin | ||
local | ||
/src/*_theme | ||
/lib | ||
lib64 | ||
eggs | ||
develop-eggs | ||
|
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
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,118 @@ | ||
############################################################################## | ||
# Buildout to install uwsgi https://github.com/unbit/uwsgi | ||
# | ||
# requires: | ||
# | ||
# - bin/adhocracpy-env to set the PYTHONPATH variable | ||
# | ||
############################################################################## | ||
|
||
[buildout] | ||
|
||
parts += | ||
uwsgi | ||
uwsgi_bin | ||
|
||
adhocracy-supervisor = | ||
45 adhocracy (environment=${supervisor:environment} stopsignal=INT redirect_stderr=true stdout_logfile=var/log/adhocracy.log stderr_logfile=NONE) ${buildout:bin-directory}/uwsgi [--ini-paste ${buildout:directory}/etc/adhocracy.ini] | ||
|
||
############################################################################## | ||
# System settings | ||
############################################################################## | ||
|
||
[domains] | ||
wsgi = 127.0.0.1 | ||
|
||
[ports] | ||
wsgi = 5001 | ||
|
||
[urls] | ||
uwsgi = http://projects.unbit.it/downloads/uwsgi-1.9.13.tar.gz | ||
|
||
############################### | ||
# Install and configure uwsgi # | ||
############################### | ||
|
||
# compile options | ||
[uwsgi_build_conf] | ||
recipe = collective.recipe.template | ||
output = ${buildout:directory}/etc/uwsgi_buildconf.ini | ||
input = ${buildout:directory}/etc/uwsgi_buildconf.ini.in | ||
bin-name = ${buildout:bin-directory}/uwsgi_original | ||
plugin-dir = ${buildout:directory}/var/uwsgi_plugins | ||
main-plugin = python, gevent | ||
|
||
[uwsgi_build_env] | ||
UWSGI_PROFILE = ${uwsgi_build_conf:output} | ||
PYTHONHOME = ${buildout:directory} | ||
UWSGI_INCLUDES = ${buildout:directory}/lib | ||
|
||
# compile egg | ||
[uwsgi] | ||
recipe = minitage.recipe.scripts | ||
url = ${urls:uwsgi} | ||
eggs = | ||
${buildout:eggs} | ||
uwsgi | ||
environment = uwsgi_build_env | ||
|
||
# uwsgi bin | ||
[uwsgi_bin] | ||
recipe = collective.recipe.template | ||
output = ${buildout:bin-directory}/uwsgi | ||
input = inline: | ||
#!/bin/bash | ||
source ${adhocpy:env-file} | ||
LD_LIBRARY_PATH = ${uwsgi_build_env:UWSGI_INCLUDES} | ||
export LD_LIBRARY_PATH | ||
exec ${buildout:bin-directory}/uwsgi_original "$@" | ||
mode = 755 | ||
|
||
# configure | ||
[uwsgi_conf] | ||
conf = | ||
#basics | ||
|
||
http = ${domains:wsgi}:${ports:wsgi} | ||
pidfile = ${buildout:directory}/var/uwsgi.pid | ||
master = true | ||
chdir = ${buildout:directory}/src | ||
home = ${buildout:directory} | ||
|
||
# extended | ||
|
||
# Reload if ini changes | ||
touch-reload = ${buildout:directory}/etc/adhocracy.ini | ||
# stop uwsgi if the wsgi app is not available | ||
need-app = true | ||
# allow threads | ||
enable-threads = true | ||
#Set close-on-exec on sockets (could be required for spawning processes in requests). | ||
close-on-exec = true | ||
#Automatically kill workers if master dies (can be dangerous for availability). | ||
no-orphans = true | ||
# Try to remove all of the generated files/sockets (UNIX sockets and pidfiles) upon exit. | ||
vacuum = true | ||
|
||
#performance tuning | ||
|
||
processes = 1 | ||
worker = 20 | ||
post-buffering = 4096 | ||
max-requests = 1000 | ||
# Reload a worker if its address space usage is higher than the specified value (in megabytes). | ||
reload-on-as = 128 | ||
#gracefull dead | ||
harakiri = 60 | ||
harakiri-verbose = true | ||
|
||
#logging | ||
|
||
log-date = true | ||
log-slow = true | ||
|
||
# debug | ||
|
||
# IPDB(); opens python shell | ||
shared-import = ${buildout:directory}/scripts/interact.py | ||
# memory-report = true |
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,8 +7,6 @@ | |
############################################################## | ||
|
||
[DEFAULT] | ||
{% if parts.adhocracy.debug == 'True' %}debug = True {% end %} | ||
{% if parts.adhocracy.debug != 'True' %}debug = False {% end %} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is this related to uwsgi? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This debug flag does not work with mutliprocess WSGI-servers such as uwsgi |
||
# Uncomment and replace with the address which should receive any error reports | ||
email_to = ${parts.adhocracy['email.to']} | ||
|
@@ -18,13 +16,16 @@ error_email_from = ${parts.adhocracy['email.from']} | |
|
||
[server:main] | ||
use = egg:Paste#http | ||
host = ${parts.adhocracy.host} | ||
port = ${parts.ports.main} | ||
host = ${parts.domains.wsgi} | ||
port = ${parts.ports.wsgi} | ||
{% if parts.adhocracy.debug == 'True' %}use_threadpool = False {% end %} | ||
{% if parts.adhocracy.debug != 'True' %}use_threadpool = True {% end %} | ||
threadpool_workers = 20 | ||
|
||
|
||
{% if "uwsgi_conf" in parts %} | ||
[uwsgi] | ||
${parts.uwsgi_conf.conf} | ||
{% end %} | ||
|
||
{% if parts.adhocracy.themed == 'False' %} | ||
###################not themed adhocracy ################### | ||
|
@@ -166,9 +167,9 @@ adhocracy.interactive_debugging = true | |
# active instance, e.g. "Test Instance" for test.adhocracy.lan. | ||
|
||
{% python | ||
adhocracy_domain = parts['domains']['main'] | ||
if parts['domains'].get('main.force_port', None): | ||
adhocracy_domain += ':%s' % parts['ports']['main'] | ||
adhocracy_domain = parts['adhocracy']['domain'] | ||
if parts['domains'].get('adhocracy.force_port', None): | ||
adhocracy_domain += ':%s' % parts['ports']['wsgi'] | ||
%} | ||
adhocracy.domain = ${adhocracy_domain} | ||
adhocracy.protocol = ${parts.adhocracy.protocol} | ||
|
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,50 @@ | ||
; this is mainly copied from the uwsgi buildconf/default.ini | ||
; trying to surface some of the build options to buildout | ||
; properties. | ||
[uwsgi] | ||
bin_name = ${:bin-name} | ||
plugin_dir = ${:plugin-dir} | ||
main_plugin = ${:main-plugin} | ||
xml = false | ||
ini = true | ||
yaml = true | ||
json = auto | ||
sqlite3 = auto | ||
zeromq = auto | ||
snmp = true | ||
spooler = true | ||
embedded = true | ||
ssl = auto | ||
udp = true | ||
multicast = true | ||
threading = true | ||
minterpreters = true | ||
async = true | ||
ldap = auto | ||
pcre = auto | ||
routing = auto | ||
alarm = auto | ||
ipv6 = false | ||
debug = false | ||
unbit = false | ||
xml_implementation = libxml2 | ||
yaml_implementation = auto | ||
malloc_implementation = libc | ||
extras = | ||
plugins = | ||
append_version = | ||
embedded_plugins = %(main_plugin)s, ping, cache, nagios, rrdtool, carbon, rpc, corerouter, fastrouter, http, ugreen, signal, syslog, rsyslog, logsocket, router_uwsgi, router_redirect, router_basicauth, zergpool, redislog, mongodblog, router_rewrite, router_http, logfile, router_cache, rawrouter | ||
as_shared_library = false | ||
|
||
locking = auto | ||
event = auto | ||
timer = auto | ||
filemonitor = auto | ||
|
||
blacklist = | ||
whitelist = | ||
|
||
embed_files = | ||
|
||
embed_config = | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
/bin/sh
- the file is not dependent on bash at all, or is it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not working with sh.