Kraftwerk WSGI is a command line utility that enables easier deployment and commissioning of cloud servers. Kraftwerk has hooks to customize setup of server nodes and WSGI projects. Kraftwerk places loose constraints on project structure and paves the way for local full stack testing and staging.
Deployment in WSGI land is too time consuming when dealing with multiple sites. Kraftwerk is Python website sysadmin made easy.
Current release: 0.1
Read my argument for this kind of software
Assuming you have EC2 access, a key pair called "aws" and a default security group with SSH and HTTP open. This is how we go from a *nix with an internet connection to deployed website.
$ easy_install http://github.com/apache/libcloud/tarball/trunk $ easy_install kraftwerk
Or get the development version
$ easy_install http://github.com/apache/libcloud/tarball/trunk
$ hg clone http://bitbucket.org/jokull/kraftwerk ; cd kraftwerk
$ python setup.py develop
$ kraftwerk create-node my.cloud It looks like this is your first time running kraftwerk Provider [rackspace/ec2_eu_west]: ec2_eu_west Provider user: AKIAICPK.... Provider secret [optional]: ZFl8vSRjsmCvS.... Default Ubuntu image: ami-b3c0ebc7 Default node size: m1.small SSH public key: /Users/jokull/.ssh/id_rsa.pub EC2 Key Pair [default="default"]: Create /etc/hosts entry? [N|y]: y Password: # sudo password Node my.cloud (79.125.x.x) Run 'kraftwerk setup-node my.cloud' $ kraftwerk setup-node my.cloud $ kraftwerk init ~/Code/myproject # Creates a kraftwerk project with a sample Django project # -- Edit project, kraftwerk.yaml, REQUIREMENTS etc. -- $ cd ~/Code/myproject $ kraftwerk deploy my.cloud Site is live!
Kraftwerk doesn't have any Django specific code per se. But you can use the stab command to finish setup. Sync database, create super user and symlink admin media.
$ kraftwerk stab my.cloud -s "DJANGO_SETTINGS_MODULE=myproject.settings django-admin.py syncdb --noinput" $ kraftwerk stab my.cloud -s "DJANGO_SETTINGS_MODULE=myproject.settings django-admin.py createsuperuser --username=admin --email=admin@admin.com" $ kraftwerk stab my.cloud -s "ln -s /web/myproject/lib/python2.6/site-packages/django/contrib/admin/media /web/myproject/myproject/static/admin"
If you have a stage and live node ready you can transfer live data to the stage for better testing
$ cd myproject $ kraftwerk deploy live.cloud # -- Interact with live site, add data, upload images etc. -- $ kraftwerk deploy stage.cloud $ kraftwerk sync-services live.cloud stage.cloud # -- Stage is synced with live data! --
$ kraftwerk dump live.cloud
# Dump ready at live.cloud:/web/myproject/dump/2010-03-24T15:42:54/