An introduction to OpenStack Heat

Fri 06 December 2013 by Lars Kellogg-Stedman Tags openstack heat neutron

Heat is a template-based orchestration mechanism for use with OpenStack. With Heat, you can deploy collections of resources -- networks, servers, storage, and more -- all from a single, parameterized template.

In this article I will introduce Heat templates and the heat command line client.

read more

A Python interface to signalfd() using FFI

Thu 28 November 2013 by Lars Kellogg-Stedman Tags python

I just recently learned about the signalfd(2) system call, which was introduced to the Linux kernel back in 2007:

signalfd() creates a file descriptor that can be used to accept signals targeted at the caller. This provides an alternative to the use of a signal handler or sigwaitinfo(2), and has the advantage that the file descriptor may be monitored by select(2), poll(2), and epoll(7).

The traditional asynchronous delivery mechanism can be tricky to get right, whereas this provides a convenient fd interface that integrates nicely with your existing event-based code.

I was interested in using signalfd() in some Python code, but Python does not expose this system call through any of the standard libraries. There are a variety of ways one could add support, including:

  • Writing a Python module in C
  • Using the ctypes module (which I played with a few years ago)

However, I decided to use this as an excuse to learn about the cffi module. You can find the complete code in my python-signalfd repository and an explanation of the process below.

read more

Long polling with Javascript and Python

In this post I'm going to step through an example web chat system implemented in Python (with Bottle and gevent) that uses long polling to implement a simple publish/subscribe mechanism for efficiently updating connected clients.

My pubsub_example repository on GitHub has a complete project that implements the ideas discussed in this article. This project can be deployed directly on OpenShift if you want to try things out on your own. You can also try it out online at http://pubsub.example.oddbit.com/.

read more

Sockets on OpenShift

Sat 23 November 2013 by Lars Kellogg-Stedman Tags openshift javascript

In this article, a followup to my previous post regarding long-poll servers and Python, we investigate the code changes that were necessary to make the code work when deployed on OpenShift.

read more

A unified CLI for OpenStack

Fri 22 November 2013 by Lars Kellogg-Stedman Tags openstack

The python-openstackclient project, by Dean Troyer and others, is a new command line tool to replace the existing command line clients (including commands such as nova, keystone, cinder, etc).

This tool solves two problems I've encountered in the past:

  • Command line options between different command line clients are sometimes inconsistent …

read more