Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

use uwsgi instead of paste #471

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from

Conversation

joka
Copy link
Collaborator

@joka joka commented Jun 30, 2013


# remove exiting links
rm ${:prefix}/bin/python
for i in $(ls ${:prefix}/bin/*[23].*); do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really unstable. Why do we need to remove the files in the first place? And why can't we match python* here?

@phihag
Copy link
Collaborator

phihag commented Jul 1, 2013

For me, this fails with:

$ bin/adhocpy -c 'import zlib;print(zlib.__file__)'
/home/phihag/inavm/adhocracy_buildout/python/python-2.7/lib/python2.7/lib-dynload/zlib.so
$ bin/uwsgi --ini-paste etc/adhocracy.ini
[uWSGI] getting INI configuration from etc/adhocracy.ini
Mon Jul  1 02:00:18 2013 - *** Starting uWSGI 1.9.12 (64bit) on [Mon Jul  1 02:00:18 2013] ***
Mon Jul  1 02:00:18 2013 - compiled with version: 4.4.5 on 01 July 2013 01:56:27
Mon Jul  1 02:00:18 2013 - os: Linux-2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012
Mon Jul  1 02:00:18 2013 - nodename: adhocracy
Mon Jul  1 02:00:18 2013 - machine: x86_64
Mon Jul  1 02:00:18 2013 - clock source: unix
Mon Jul  1 02:00:18 2013 - pcre jit disabled
Mon Jul  1 02:00:18 2013 - detected number of CPU cores: 2
Mon Jul  1 02:00:18 2013 - current working directory: /home/phihag/inavm/adhocracy_buildout
Mon Jul  1 02:00:18 2013 - writing pidfile to /home/phihag/inavm/adhocracy_buildout/var/uwsgi.pid
Mon Jul  1 02:00:18 2013 - detected binary path: /home/phihag/inavm/adhocracy_buildout/parts/uwsgi/bin/uwsgi
Mon Jul  1 02:00:18 2013 - your memory page size is 4096 bytes
Mon Jul  1 02:00:18 2013 - detected max file descriptor number: 1024
Mon Jul  1 02:00:18 2013 - lock engine: pthread robust mutexes
Mon Jul  1 02:00:18 2013 - uWSGI http bound on adhocracy.lan:5001 fd 4
Mon Jul  1 02:00:18 2013 - uwsgi socket 0 bound to TCP address 127.0.0.1:40253 (port auto-assigned) fd 3
Mon Jul  1 02:00:18 2013 - Python version: 2.7.5 (default, Jun 14 2013, 14:08:18)  [GCC 4.4.5]
Mon Jul  1 02:00:18 2013 - Set PythonHome to /home/phihag/inavm/adhocracy_buildout
zipimport.ZipImportError: can't decompress data; zlib not available
Mon Jul  1 02:00:18 2013 - VACUUM: pidfile removed.

which is curious, since both my system Python and the adhocracy Python have zlib installed.

recipe = collective.recipe.template
output = ${buildout:bin-directory}/uwsgi
input = inline:
#!/bin/bash
Copy link
Collaborator

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?

Copy link
Collaborator Author

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?

its not working with sh.

@phihag
Copy link
Collaborator

phihag commented Jul 1, 2013

When I install multiple times (just run ./build.sh), this build uwsgi every time, unlike all other dependencies. Are we by accident deleting any output files or so?

@nidico
Copy link
Collaborator

nidico commented Jul 1, 2013

@phihag: Can you try to run bin/uwsgi with explicit LD_LIBRARY_PATH="${buildout:directory}/python/python-2.7/lib/"? We're doing the same because of libjpeg in the paster supervisor commands.

ln -vfs ${buildout:directory}/python-2.7/bin/python2.7 $DEST;
update-command = ${:command}
# Symlink include, lib directory, uwsgi needs this there
ln -s ${buildout:directory}/python-2.7/include ${:prefix}/include
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also pass in the -f and -T options here, since we're symlinking a directory. In fact, is that the rationale for the rms above? If so, just adding -fT and removing the rms will suffice.

@phihag
Copy link
Collaborator

phihag commented Jul 1, 2013

@nidico Fixed the installation problem in e49fd89 ; python needed to be re-compiled.

@phihag
Copy link
Collaborator

phihag commented Jul 1, 2013

With the changes, uwsgi starts and serves the correct page, but still mentions

Mon Jul  1 03:11:48 2013 - unable to stat() true, events will be triggered as soon as the file is created

This looks like one of the options we set isn't actually boolean.

##############################################################################

[domains]
uwsgi = 127.0.0.1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these two entries used anywhere? It seems like we're simply using {main:port} (as we should)

@@ -7,8 +7,6 @@
##############################################################

[DEFAULT]
{% if parts.adhocracy.debug == 'True' %}debug = True {% end %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this related to uwsgi?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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

joka added 8 commits July 2, 2013 16:59
Its better to use the domains/ports parts only for server hosts/ports
settings and the adhocracy part for adhocracy configuration:

* adhocracy.host is now domains.wsgi
* port.main is now ports.wsgi
* domains.main is no adhocracy.domain
touch-reload = true is throws:
"unable to stat() true, events will be triggered as soon as the file is created"
@joka
Copy link
Collaborator Author

joka commented Jul 3, 2013

This looks like one of the options we set isn't actually boolean.

fixed

@joka
Copy link
Collaborator Author

joka commented Jul 3, 2013

@phihag: Can you try to run bin/uwsgi with explicit LD_LIBRARY_PATH="${buildout:directory}/python/python-2.7/lib/"? We're doing the same because of libjpeg in the paster supervisor commands.

bin/uwsgi sets LD_LIBRARY_PATH now

@joka
Copy link
Collaborator Author

joka commented Jul 3, 2013

updated uwsgi to 1.9.13 to enable support of what?

allow to extent the "LD_LIBRARY_PATH"

@nidico
Copy link
Collaborator

nidico commented Jul 3, 2013

ah :)

@joka
Copy link
Collaborator Author

joka commented Jul 3, 2013

Testet build.sh with Debian 7.1 netboot image, OK

@joka
Copy link
Collaborator Author

joka commented Jul 3, 2013

When I install multiple times (just run ./build.sh), this build uwsgi every time, unlike all other dependencies. Are we by accident deleting any output files or so?

no, the recipe minitage.recipe.du was the reason, fixed.

@joka
Copy link
Collaborator Author

joka commented Jul 3, 2013

For me, this fails with:

$ bin/adhocpy -c 'import zlib;print(zlib.file)'
/home/phihag/inavm/adhocracy_buildout/python/python-2.7/lib/python2.7/lib-dynload/zlib.so
$ bin/uwsgi --ini-paste etc/adhocracy.ini
[uWSGI] getting INI configuration from etc/adhocracy.ini
...
zipimport.ZipImportError: can't decompress data; zlib not available
Mon Jul 1 02:00:18 2013 - VACUUM: pidfile removed.

Can you try again or give me an VM to investigate this?

@joka
Copy link
Collaborator Author

joka commented Jul 9, 2013

@phihag do you still have problems?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants