You shouldn\u2019t concern yourself too much with the server at this point. Instead, let us ask: what does the application look like?<\/p>\n
Silver Lining is inspired by Google App Engine in this respect; an application is a bunch of files that are uploaded to the server. You don\u2019t \u201cbuild\u201d an application on the server. To upload or update an application, you run:<\/p>\n
$ silver update path\/to\/app\/ myapp.com<\/p><\/blockquote>\n
This uploads your files, makes sure requests to myapp.com go to your new application. Your application has a file app.ini (located, in this example, in path\/to\/app\/app.ini) which describes the basics of the application.<\/p>\n
This also sets up any services that you need for your application (which you have listed in app.ini). Services include any kind of persistence your application requires. This would be a database, or even just a location where you can store files (which isn\u2019t available unless you ask for it). These services then inject their configuration into your application though environmental variables. So when you start your application you might look for os.environ[‘CONFIG_PG_DBNAME’] to see what PostgreSQL database you should connect to. (What each service adds to the environment is covered in the services document.)<\/p>\n
You might also ask: what about binary packages? For instance, lxml. With Silver Lining only portable files can go in your application directory; typically .py files, templates, and other plain-text data files. So if you want lxml you have to have the Ubuntu package installed; you\u2019d add (to app.ini) the configuration packages = lxml.<\/p>\n
A lot of this is covered in application configuration.<\/p>\n
And what kind of frameworks can you use with Silver Lining? Anything really. The only real exception is Zope 2, which has strict Python version requirements, lots of C extensions, and all sorts of other complexities. Repoze will work fine though, and a ZEO service is easy to imagine (though not yet implemented).<\/p>\n
The Server<\/h2>\n
The server is setup thusly:<\/p>\n
Ubuntu Jaunty (Karmic seems to work too).
\nPython 2.6.
\nApache with mod_wsgi.
\nBut you don\u2019t directly interact with either of these.
\nRight now the persistence handling is minimal; this is where the most additional support needs to be added to the system (backups, migration, cloning, separating servers, and eventually stuff like replication). Currently there is basic setup for:
\nPostgreSQL with the PostGIS extensions.
\nCouchDB served locally
\nMongoDB served locally
\nNothing cron-like has been implemented yet, though probably it will be implemented very similar to App Engine (with internal requests). App setup and migration has to be hand-coded, but can be configured to be run.
\nEach app lives at its own domain; per-directory applications are not currently implemented (but would be nice). Multiple hostnames pointing to a single application is not implemented, but would be easy. Wildcards require some more thought (simply in terms of Apache configuration).<\/p>\n
Provider support<\/h2>\n
This package currently has only been tested with Rackspace Cloud. The only specific Rackspace extension is the use of \u201cfiles\u201d on server creation (this is part of the node-creation API that uploads files on the newly created node\/server). The use of the files extension is minimal at this point (just setting up \/root\/.ssh\/authorized_keys), and it is usable without that. If you are signing up for an account by clicking through this affiliate link you can throw a few bucks my way.<\/p>\n
Silver Lining uses libcloud, which is a library abstracting several provider APIs. It should be usable with other providers, but it\u2019s only been tried with Rackspace, expect bumps with other services.<\/p>\n
Language Support<\/h2>\n
There is some experimental support for PHP; it\u2019s not incredibly graceful, but it has many of the same deployment advantages as with Python.<\/p>\n
Other languages would also be possible. Ruby is a prime candidate of course, probably using Passenger instead of mod_wsgi. If I had any clue how Perl was best deployed, it might also seem reasonable. But I (Ian) only have a personal interest in the two supported platforms and maybe Java.<\/p>\n
Installing<\/h2>\n
Window clients are not supported. The only way Windows will be supported is if someone volunteers to maintain the Windows support. Individual patches won\u2019t be accepted until that time \u2013 it would only be a disappointment to Windows users to get a half-working and unsupported client.<\/p>\n
If you don\u2019t want to install from the zip file, you can install Silver Lining into a virtualenv environment pretty easily too:<\/p>\n
First get virtualenv, which also gives you pip. Also be sure you have Mercurial (hg) and Subversion (svn) installed. Then run:<\/p>\n
$ virtualenv -p python2.6 silver
\n$ silver\/bin\/pip install -r http:\/\/bitbucket.org\/ianb\/silverlining\/raw\/tip\/requirements.txt<\/p><\/blockquote>\n
This installs a bunch of stuff, most importantly silver\/bin\/silver. Your applications will go in a separate environment, so you should be sure that silver works regardless of what virtualenv environment is activated. I recommend:<\/p>\n
$ alias silver=”\/path\/to\/silver\/bin\/silver”<\/p><\/blockquote>\n
Cloud Server Management<\/h2>\n
There\u2019s several commands just to manage servers (also called nodes). These are really just frontends to what libcloud provides.<\/p>\n
Each \u201cnode\u201d has a hostname, which is the name of the node, and also the hostname setup in \/etc\/hosts.<\/p>\n
\n
\n- silver list-images:<\/strong>
\nLists all the images available (these are starter systems that can be cloned).<\/li>\n- silver list-sizes:<\/strong>
\nLists all the sizes (plans) you can get for your server (a combination of RAM\/disk and sometimes bandwidth).<\/li>\n- silver create-node:<\/strong>
\nCreates a new node (aka server).<\/li>\n- silver destroy-node:<\/strong>
\nDeletes a node. It is advisable to remove the node from ~\/.ssh\/known_hosts after destroying it to avoid SSH warnings in future.<\/li>\n- silver setup-node:<\/strong>
\nThis takes a bare Ubuntu Jaunty system and sets it up.<\/li>\n<\/ol>\n<\/div>\n