diff --git a/Makefile b/Makefile index 3bac442..97c2f29 100755 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ LIBEVENTOUT=evserver/libevent.so egg: eggs eggs: - $(PYTHON) setup.py bdist_egg + $(PYTHON) setup.py bdist_egg --plat-name=linux-i686 clean: find . -name "*.pyc" | xargs rm -f diff --git a/README b/README index 8664361..731cd43 100644 --- a/README +++ b/README @@ -1,82 +1,5 @@ -INSTALLATION - -You should probably check out current development brach: -$ svn checkout http://evserver.googlecode.com/svn/trunk/ evserver - -Then, to use 'evserver' you just need to set your PYTHONPATH environment -variable, for example, if you have evserver sources installed in your home directory: -$ PYTHONPATH="$HOME/evserver" python ./myscript.py - -If you must have egg package, you can get one: -$ wget "" -$ sudo easy_install evserver - -But beware, this packet has included a libevent.so binary, which is 32 bits only. - - -COMPILATION - -This package needs libevent.so binary and automatically generated python wrapper -file for this specific version of libevent. Currently I include libevent 1.4.5 -32 bit files. If you need to use your own version of libevent, you must: - - install dependencies: - $ sudo apt-get install gccxml python-setuptools - $ sudo easy_install ctypeslib - - - grab libevent sources. Libevent from 1.4.2 to 1.4.5 seems to be working. 1.4.1 had - an important bug in chunk encoding, 1.4.6 and newer have issues when receiving - timeouts on file descriptors. I use libevent-1.4.5. - You need to compile the sources. - $ wget "http://monkey.org/~provos/libevent-1.4.5-stable.tar.gz" - $ tar xvzf libevent-1.4.5-stable.tar.gz - $ cd libevent-1.4.5 - $ ./configure && make - - - Run 'make ctypes' with LIBEVENTSOURCES environment variable set, for example: - $ LIBEVENTSOURCES=../libevent-1.4.5-stable make ctypes - Then, if you need to create egg, just run 'make egg' - $ LIBEVENTSOURCES=../libevent-1.4.5-stable make egg - Your package will be ready in 'dist' directory. - - -RUNNING - -If you installed egg just try: - $ evserver - -If you haven't installed egg, only got the development branch in ~/evserver: - $ ~/evserver/evserver.py - - -TESTS - -There are some working tests for the application. You can run them: - $ make test - - -FEATURES - -The status panel is great. Just add '-s 127.0.0.1:9999' option when running eveserver, -and see the status at url http://127.0.0.1:9999/ - - - - -BUGS - - There are still some issues with this software: - - Despite long fight, there are still some memory leaks in libevent. The leaks are tiny, but take - them into consideration and think of restarting the worker processes once in few months. - - - - -I FOUND A BUG! - That's great! It means that I'm still a human (I lost my certainty about this point). - Write a test case using our 'test.py' facility, then I'll try to fix a bug for free. - In the other case feel free to fix the bug yourself, I'd be happy to include your - changes. Just drop me the patch at majek04+evserver@gmail.com - - +The good idea is to take a look at: +http://code.google.com/p/evserver/wiki/Documentation diff --git a/evserver/examples/haproxy-tcp.cfg b/evserver/examples/haproxy-tcp.cfg new file mode 100644 index 0000000..8be8398 --- /dev/null +++ b/evserver/examples/haproxy-tcp.cfg @@ -0,0 +1,37 @@ +global + log 127.0.0.1 local0 + log 127.0.0.1 local1 notice + maxconn 256 + chroot /var/empty + uid 65534 + gid 65534 + daemon + +defaults + log global + mode tcp + option httplog + option dontlognull + retries 3 + option redispatch + maxconn 2000 + contimeout 5000 + clitimeout 50000 + srvtimeout 50000 + +listen http-server 0.0.0.0:80 + mode tcp + balance roundrobin + clitimeout 86400000 # a day + srvtimeout 86400000 + server inst00 127.0.0.1:9000 check inter 2000 fall 3 + server inst01 127.0.0.1:9001 check inter 2000 fall 3 + server inst02 127.0.0.1:9002 check inter 2000 fall 3 + server inst03 127.0.0.1:9003 check inter 2000 fall 3 + server inst04 127.0.0.1:9004 check inter 2000 fall 3 + server inst05 127.0.0.1:9005 check inter 2000 fall 3 + server inst06 127.0.0.1:9006 check inter 2000 fall 3 + server inst07 127.0.0.1:9007 check inter 2000 fall 3 + server inst08 127.0.0.1:9008 check inter 2000 fall 3 + server inst09 127.0.0.1:9009 check inter 2000 fall 3 + server inst10 127.0.0.1:9010 check inter 2000 fall 3 diff --git a/setup.py b/setup.py index 1f4850d..0344510 100755 --- a/setup.py +++ b/setup.py @@ -1,14 +1,33 @@ from setuptools import setup, find_packages +from setuptools.dist import Distribution import os -print find_packages(".") +import subprocess +import re + +version = "0.01" + +try: + proc = subprocess.Popen(["svn", "info"], stdout=subprocess.PIPE) + svn = proc.stdout.read() + + rev = int(re.compile(r"Revision: ([0-9]*)").findall(svn)[0]) + version = "%s-r%s" % (version, rev) +except Exception: + pass + + +class MyDist(Distribution): + def has_ext_modules(self): + return True + setup( name="evserver", description = "EvServer - Asynchronous WSGI http server", - version = "0.01", + version = version, keywords = "wsgi awsgi django asynchronous libevent", author = "Marek Majkowski", - url = "", - license = "GPL", + url = "http://code.google.com/p/evserver/wiki/Documentation", + license = "BSD", package_data = {'': ['*.so']}, packages = ['evserver', 'evserver.management', 'evserver.management.commands'], package_dir = {'':"."}, @@ -16,5 +35,6 @@ entry_points = { 'console_scripts': ['evserver = evserver.evserver:egg_entry_point'], }, + distclass = MyDist, ) diff --git a/test.py b/test.py index 9ed8b93..8822b9b 100755 --- a/test.py +++ b/test.py @@ -274,4 +274,5 @@ def test_return_chunked_11_keepalive(): print "test %s: FAILED (%r)" % (t,ret) sys.exit(1) print "test %s: OK" % (t,) + print "All tests finished with SUCCESS" sys.exit(0)