librelist archives

« back to archive

Deployment

Deployment

From:
David Winslow
Date:
2010-05-05 @ 19:37
On Monday Ariel asked me to take a look at his notes on deploying a 
GeoNode site on Ubuntu [1].  I finally took a few minutes to peruse 
them, and here is the feedback that I have:

* The pavement.py edits mentioned should be unneeded after r1116, which 
addresses a related issue that Andreas ran into this morning.
* Ubuntu's Tomcat package can have some similar issues to their Maven 
one; it's generally less hassle to run GeoServer in Tomcat as 
distributed by the upstream project.
* We're not relying on PostGIS for the GeoNode at this time, so setting 
that up isn't strictly necessary.  Eventually it would be nice for 
uploaded shapefiles to be automatically loaded into PostGIS and indexed, 
and it would be a natural fit for GeoNode to use Postgres for that as 
well, but I'm not sure where that fits into the roadmap right now.

I'm not familiar with nginx, but I do find it odd that you're deploying 
it alongside httpd.  There might be a little fat to be trimmed here.  Is 
the ngnix mod_wsgi plugin insufficient for some reason?  If so, is nginx 
that much better at serving static files that you need to keep it around?

Additionally, a couple of action items we might want to consider for the 
core:

* https:// for the svn:external to GXP seems a little odd when we have a 
self-signed certificate on that server, although it should still be 
protecting passwords from snoopers.  Maybe the answer for this is just 
for us to shell out a few bucks for a real cert.
* we should rearrange the deployment (and development) setup scripts so 
that running without the --no-site-packages option is possible.  This 
will accommodate setups like Ubuntu and Windows where one might want to 
use platform-native packages to get ReportLab and PIL over 
setuptools/pypi, for whatever reason.

I'm also attaching a copy of our deployment script for Ariel's perusal.  
This is a little more limited in scope, as it assumes you are updating a 
pre-existing GeoNode deployment in a fairly specific 
Tomcat/httpd/mod_wsgi setup, but may still be informative.

--
David Winslow
OpenGeo - http://opengeo.org/

Re: [geonode] Deployment

From:
Ariel Nunez
Date:
2010-05-05 @ 20:58
On Wed, May 5, 2010 at 2:37 PM, David Winslow <dwinslow@opengeo.org> wrote:

> On Monday Ariel asked me to take a look at his notes on deploying a GeoNode
> site on Ubuntu [1].  I finally took a few minutes to peruse them, and here
> is the feedback that I have:
>
> * The pavement.py edits mentioned should be unneeded after r1116, which
> addresses a related issue that Andreas ran into this morning.
>
Great, I'll take a look at that.


> * Ubuntu's Tomcat package can have some similar issues to their Maven one;
> it's generally less hassle to run GeoServer in Tomcat as distributed by the
> upstream project.
>
I will keep this in mind. However I leaned towards using the packaged one
because installing Tomcat in Ubuntu has aways been a pain (permissions,
setting up /etc/init.d scripts, location of config/log files). But in
general I agree with your statement.


> * We're not relying on PostGIS for the GeoNode at this time, so setting
> that up isn't strictly necessary.  Eventually it would be nice for uploaded
> shapefiles to be automatically loaded into PostGIS and indexed, and it would
> be a natural fit for GeoNode to use Postgres for that as well, but I'm not
> sure where that fits into the roadmap right now.

 Yes, I should mark that as optional, just that I prefer doing Django
deployments using Postgres (instead of SQLite, which is perfect for dev) .
The PostGIS / GeoDjango setup is just icing in the cake, I agree that is an
overkill since GeoNode is not using GeoDjango at all, however my evil
intentions are to take advantage of Dynamic Django models[1] and Layer
Mapping[2], among other things.

[1] http://code.djangoproject.com/wiki/DynamicModels
[2] http://docs.djangoproject.com/en/dev/ref/contrib/gis/layermapping/

I'm not familiar with nginx, but I do find it odd that you're deploying it
> alongside httpd.  There might be a little fat to be trimmed here.  Is the
> ngnix mod_wsgi plugin insufficient for some reason?  If so, is nginx that
> much better at serving static files that you need to keep it around?
>

I am using Nginx as a frontend proxy for both Apache and Tomcat, that way
the need to workaround Javascript limitations using a proxy script is not
needed. But there are also other reasons:

1. The posibility to use a static generator[3], the posted Nginx
configurations tests first for a file on the given directory and if it finds
none, it redirects the request to the Django Application server, this allows
us to skip the dynamic generation part for pages that do not change often:
 [3] http://superjared.com/projects/static-generator/

2. Reduces overall load, Nginx is more friendly to the (expensive) Apache
process than the final user, because of network latency / bandwidth, etc. So
using Nginx as a proxy means the Apache process is freed as soon as it's
done rendering the request and the lighter Nginx process handles sending
back the response to the customer, as well as timeouts, etc.

3. Follow the Django deployment practice of using a separate web server for
media in order to fine tune the media server (Nginx in this case, with a
configuration to make YSlow happy) for serving static files and the
Application Server (Apache + mod_wsgi). It's usually better to run Django in
prefork mode (which is not the most efficient Apache MPM mode nowadays) to
avoid trouble with the Python GIL - Django is supposed to be multithreading
safe but in reality it depends on the actual implementation of your website
(in this case GeoNode).

[snip]
> * we should rearrange the deployment (and development) setup scripts so
> that running without the --no-site-packages option is possible.  This will
> accommodate setups like Ubuntu and Windows where one might want to use
> platform-native packages to get ReportLab and PIL over setuptools/pypi, for
> whatever reason.
>

Yes, this would allow the symlinks we had to create in Ubuntu. Neither
Reportlab nor PIL can be installed from PyPi in Ubuntu 10.04 at the moment.


>
> I'm also attaching a copy of our deployment script for Ariel's perusal.
>  This is a little more limited in scope, as it assumes you are updating a
> pre-existing GeoNode deployment in a fairly specific Tomcat/httpd/mod_wsgi
> setup, but may still be informative.
>

Thanks a lot, I am going to take a look.

Ariel.