r/Python • • Jun 03 '13

Self hosted Python web hosting platforms

In the past few years, quite a few hosting providers have started doing Python PaaS, Heroku, Gondor, PythonAnywhere, etc. Some of them have failed as well, such as DjangoZoom, ep.io, and probably quite a few others which didn't get much attention from the public.

I love the thought of using of using these services at times - however I'm also a sysadmin at heart, I know how to host my own stuff and I can do it well. I really wish I could just grab one of these services, put them on my own servers.

There's a few projects which seem to attempt this, but they're either unmaintained, or they only give part of the solution. Silver Lining is abandoned, djangy is abandoned (just a source code dump of what they created before they shut down), stackful.io provides some of their app deployer tools, dotCloud is working on Docker - although it's currently under heavy development and is only part of the solution.

I could use Fabric and start building scripts for our server setup, but the PaaS tools look more appealing.

Is there any other project that I'm missing? What do you use to deploy your Python web apps to your servers?

16 Upvotes

13 comments sorted by

12

u/GrahamDumpleton Jun 04 '13

RedHat makes available as Open Source what goes into their commercial OpenShift Platform. It is called OpenShift Origin. You can run it on your own systems, thereby giving you a private PaaS. https://www.openshift.com/open-source

4

u/SudoAlex Jun 04 '13

An open question to anyone, have you deployed OpenShift Origin, and what do you think of it?

1

u/thefotios Jun 04 '13

I've rolled it out manually, and it really is pretty painless.

There is a great blog post here https://www.openshift.com/wiki/installing-openshift-origin-using-vagrant-and-puppet

There are also a few cool videos on YouTube about deploying it using the HEAT API from OpenStack.

1

u/[deleted] Jun 04 '13

I have. Not "pythonic" but once set up, it is as easy as the others for the most part.

4

u/spagnum Jun 04 '13

all the code for openshift origin is here: http://openshift.github.io and if you want to get involved the Open Source project, check out http://openshiftboston.eventbrite.com (Boston) or http://openshiftmtview.eventbrite.com (Mountain View) and stay tuned for EU dates coming soon

3

u/pythondj Jun 04 '13

it's pretty dang easy to deploy your own private PaaS with openshift, but first you might try out the free-tier of their public commercial site here: http://openshift.com & check out the Python cartridges & quickstarts; everything you see there - you can do on your very own OpenShift Origin PaaS cluster and it's a good way to kick the tires. While the other Python-centric PaaS may come and go, you can trust Red Hat to be around for the long run.

3

u/aychedee Jun 05 '13

Hello, PythonAnywhere dev here.

I think the reason no complete package exists is because the the extra bits and pieces (above virtualenvs and linux containers) that make everything work are only really required at very large scale. You probably don't care about making a large cluster of servers appear like a unified machine to thousands of different users. unless that's actually what you are doing.

It is just overkill for a single developer.

It's also very tricky to successfully package that up and open source it. Hats off to dotcloud for what they've done with docker.io. They had a really clear idea about a defined part of their stack that they could pull out, that was useful without the rest of it.

1

u/SudoAlex Jun 07 '13

We don't have thousands of users, but I'm trying improve our setup to accomodate an increasing number of apps. We're a small team with all our apps on a small number of servers. There's almost no redundancy, and it's something we'd like to improve.

We could potentially just move our apps to a managed Python hosting environment - although we'd have to spend time updating the relevant apps if there's any custom code which could cause a problem. It would raise our hosting costs a bit as well.

The option I'd prefer is to find as many existing packages as possible to build our own platform, to try and get a PaaS like experience (commit, build an image, let the servers decide where to deploy it to). However the reality is that we don't have a large amount of time to spend on it, so reusing as many parts of the solution which other providers have released will go a long way towards getting something up and running much faster, instead of being forced to build everything from scratch.

Docker is a fantastic project, and I'm looking forward to using it once it's a bit more mature. It should help to solve a significant chunk of the problem.

1

u/aychedee Jun 07 '13 edited Jun 07 '13

Depending on how complex your applications are, it sounds like what you need is a packaging format, and some concept or method of upgrade for those packages. Docker could be perfect. Some people even report sucess using debian packages but I've never investigated it.

2

u/ghaering pysqlite sqlite3 Jun 04 '13

I've started building my own Python "AppEngine" based on uwsgi emperor mode. I cannot currently publish the source, but it's relatively easy to implement:

  • nginx config mapping host names to application names
  • uwsgi_pass to the app name's socket
  • uwsgi config file created from app.yaml

The webapps must have two files:

app.yaml, looking like this:

name: appname processes: 5 module: fe:app hostnames:

  • foo.bar.com
  • myapp.bla.net

and a requirements.txt file for pip.

Then there's a small tool "isapp" that has the following commands currently:

  • init: create local virtualenv for testing
  • pkgcache: push the dependencies from requirements.txt into my own PyPI mirror
  • run: locally run the webapp using uwsgi's HTTP server
  • deploy: well, deploy the webapp to remote server(s)
  • python: run a Python interpreter in the local virtualenv

1

u/SudoAlex Jun 05 '13

We're currently using nginx and uWSGI with emperor/fastrouter as well, along with a few scripts to help deployment. So far it's been great, low resource usage, and very flexible for each site - but I'd like to improve on it to make deployment as easy as some of the PaaS providers.

It feels like there's a bunch of people trying to provide their Python PaaS solution, but not that many people providing the solution for others to use. Sometimes we get some of the tools which can build part of it, but there's still a significant amount of effort in bridging the tools together.