In our previous article, we explained that OpenStack is an open source Infrastructure-as-a-Service (IaaS) platform composed of many individual software services and tools—almost entirely written in Python—which brings flexibility, scalability, and interoperability to cloud-deployed software. OpenStack gives organizations a pathway into the benefits of the cloud without vendor lock-in or a closed ecosystem of tools and APIs.
In this post, we’ll take a closer look at how OpenStack relies on Python to deliver IaaS.
How Python Powers OpenStack’s Interfaces
Let’s start with the fact the much of the software parts that make up OpenStack are written in Python. Those “parts” not only include services like Nova and Cinder, but also the tools which can be used directly or via shell scripts to automate the creation, configuration, and tear-down of infrastructure services like VMs. Furthermore, the fact that Python is an interpreted language enables to the OpenStack project to run lots of Continuous Integration (CI) jobs, which would be impractical or even impossible with a compiled language.
Among the OpenStack tools written in Python is the OpenStackClient (OSC), which is “a command-line client for OpenStack that brings the command set for Compute, Identity, Image, Object Storage and Block Storage APIs together in a single shell with a uniform command structure”. The OSC is in fact, OpenStack’s own mini-shell, which can be installed via PyPi, like almost all other Python third-party modules.
While the OSC is definitely a great way to create and manage an OpenStack instance, there’s an argument to be made for using the Python bindings for the OpenStack APIs directly. For starters, since those bindings are Python code, developers already proficient in the language will probably find using those bindings much easier than picking up the command set and syntax of the OSC (or for that matter, dealing with OpenStack’s RESTful API).
Python and OpenStack are Intertwined Projects
Since Python is easy learn and has a large and very active community, OpenStack is able to draw from a large and ever-refreshed pool of contributors, thus driving OpenStack’s ongoing development and continuous improvement. OpenStack’s heavy use of Python benefits all users of language. OpenStack regularly makes upstream contributions to the Python codebase, like testing libraries and documentation.
OpenStack also supports Python by employing developers who are dedicated to open source libraries which OpenStack users. Thus, Python gets paid, professional contributors for free.
The Future
According to this interview with an OpenStack developer, the project is increasingly leveraging other technologies like Javascript, Puppet and Ansible, but if the current release (Pike) is any indication, Python will be indispensable to the platform for years to come, especially given Pike’s support for Python 3.5, a release that—as readers of this blog already know—includes many performance improvements. For OpenStack, Python 3.5 support gives its developers not only faster and more memory-efficient code, but also new features, less technical debt, and a solid, supported code foundation given that the 2.7 series will reach end-of-life (EOL) status in two years.
OpenStack is a powerful, scalable, and flexible IaaS software project that organizations can use to rapidly spin up, configure, re-configure, and tear down their cloud-deployed resources. The scalability, readability, performance, and large, vibrant ecosystem of Python makes it all possible.
Copyright © Python People