OpenStack Rally is a benchmarking and testing project for OpenStack, it provides a framework for performance, scalability and stress tests. Rally can simulate different use-cases on an existing cloud.
Many OpenStack operation teams have Rally deployed in its own virtual machine and with all tests files in an external shared filesystem and versioned with git, which a totally valid and recommendable way of running your Rally tests. However running Rally from a Docker container has also unquestionable benefits:
Portability - If like me you are always on the road and like to have an immutable rally environment always at hand.
Integration with your CI/CD infrastructure, like Jenkins.
With the portability in mind I decided to do a learning exercise and dockerize my rally environment, which by the way was on a Centos 7 virtual machine running on VMware Fusion. Rally already provides a Dockerfile and building your own rally Docker container is as simple as:
However this container is built using Ubuntu 16.04 as the base image and I prefer to use CentOS or Fedora. I have created and published a Docker container with all the Rally bits from RDO Mitaka repositories, if you just want to test it run the following command.
To manually build the container clone my Github repo, change to rally-rdo-mitaka directory and edit the Dockerfile to make any modifications to suit your needs.
Build and run the container.
Once you are in the container bash prompt create a deployment file called deployment.json
Create the deployment with rally command line.
Test the connection between the rally container and your OpenStack installation by retrieving the configured flavors.
To run your first test create an execution file, you can grab one from the sample files in Rally repository. In my testing environment I am using the Nova scenario sample file nova-boot-delete.json. Launch the test with rally command line.
Export your report in HTML format and store on the Docker volume attached to the container.
Access the report from your browser.
As you can see running Rally from a Docker container is pretty easy, keep in mind that my Docker images are very opinionated towards RDO/Red Hat OpenStack releases although it should be valid to be used with any OpenStack distribution. Anyway if you want a more neutral container but still based on Fedora/CentOS I encourage you to use the one created by my colleague Juanma Parrilla, you can check his Github repo docker-osp-rally.