This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Overview

Silk is a Fabric based tool for setting up Python WSGI apps on what I like to call the SNUG stack:

  • Supervisord for starting processes and keeping them alive.
  • Nginx for proxying between your WSGI app and the big bad web.
  • Ubuntu as the OS of choice, enabling resolution of system dependencies with apt. Debian might work as well but hasn’t been tested.
  • Gunicorn for serving your WSGI app.

(I suppose it could also be the GUNS stack but that sounds far less friendly.)

Key Features

  • Deploy your site to one or more servers with a single command (‘silk push’).
  • Automatic configuration of Nginx, Supervisord, and Gunicorn to get your site running.
  • Isolation of each site into a separate Virtualenv
  • Support for differing app config depending on which role you deploy to (a different DB in staging than production, for example).

Installation

Use pip:

pip install silk-deployment

You can also install the current development version straight from bitbucket:

pip install hg+http://bits.btubbs.com/silk-deployment#egg=silk-deployment

Commands

(Almost) all of the commands below require that you specify a role name, like ‘silk dosomething -R dev’.

Commands can generally be run from the site root directory or any subdirectory of it.

push

silk push -R rolename

This command is the main reason for Silk’s existence. It does the work required to get your app running on a host (or set of hosts) given the configuration specified in site.yaml and the selected role .yaml file. ‘push’ does the following:

  1. SSHes to the remote server(s) specified in the role config.
  2. Copies the site from your local machine to a temporary directory on the remote server.
  3. Creates a virtualenv for the site.
  4. Installs python dependencies into the virtualenv.
  5. Writes config file includes for nginx and supervisord.
  6. Writes a supervisord config for the site and starts it up.
  7. Makes a request to the homepage to ensure the site is running.
  8. Tells nginx to route traffic to the new instance instead of the old one.

run

silk run -R rolename

This command runs the site from the local machine, on port 8000. (Nothing is pushed of copied.) Static directories listed in the static_dirs section of site.yaml will also be served. (CherryPy is used for this magic.)

skel

silk skel sitename

Creates a directory with a basic Silk file and directory structure.

Layout

A silk-enabled project should be layed out something like this:

mysite.com
├── fabfile.py
├── membrane.py
├── requirements.txt
├── roles
│   ├── dev.yaml
│   ├── staging.yaml
│   └── production.yaml
├── site.yaml
└── my-django-project

Some of those files/folders are required, other are optional:

Required

  1. site.yaml - This is the main config file (comparable to app.yaml in Google App Engine)
  2. requirements.txt - A pip-compatible list of Python package names and versions.
  3. roles/*.yaml - One or more ‘role’ files that contain the config to be passed into your app depending on the deployment context.

All of the required files will be created for you with the ‘silk skel’ command.

Optional

  1. membrane.py - For Django projects it’s nice to have a little shim to expose the project as a WSGI app. I like to call mine membrane.py. You can use whatever you like, or nothing at all, depending on your setup.
  2. my-django-project - Silk isn’t restricted to Django; any valid WSGI app on your Python path should be servable. But for Django projects I think it makes sense to stick them right there.
  3. fabfile.py - A Fabric-compatible fabfile that imports Silk’s Fabric functions. This is where you can customize Silk’s ‘push’ function by wrapping it with your own (I do this to run Django’s “collectstatic” on push), or add in your own Fabric tasks.
Release History

Release History

0.3.14

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.13

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.12

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.11

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.9

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
silk-deployment-0.3.14.tar.gz (527.1 kB) Copy SHA256 Checksum SHA256 Source Mar 19, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting