Ian Wienand: Image building in OpenStack CI
The developer uploads their code to gerrit via the git-review tool. There is no further action required on their behalf and the developer simply waits for results.
Gerrit provides a JSON-encoded "firehose" output of everything happening to it. New reviews, votes, updates and more all get sent out over this pipe. Zuul is the overall scheduler that subscribes itself to this information and is responsible for managing the CI jobs appropriate for each change.
Zuul has a configuration that tells it what jobs to run for what projects. Zuul can do lots of interesting things, but for the purposes of this discussion we just consider that it puts the jobs it wants run into gearman for a Jenkins master to consume. gearman is a job-server; as they explain it "[gearman] provides a generic application framework to farm out work to other machines or processes that are better suited to do the work". Zuul puts into gearman basically a tuple (job-name, node-type) for each job it wants run, specifying the unique job name to run and what type of node it should be run on.
A group of Jenkins masters are subscribed to gearman as workers. It is these Jenkins masters that will consume the job requests from the queue and actually get the tests running. However, Jenkins needs two things to be able to run a job a job definition (what to actually do) and a slave node (somewhere to do it). The first part what to do is provided by job-definitions stored in external YAML files and processed by Jenkins Job Builder (jjb) in to job configurations for Jenkins. Each Jenkins master gets these definitions pushed to it constantly by Puppet, thus each Jenkins master instance knows about all the jobs it can run automatically. Zuul also knows about these job definitions; this is the job-name part of the tuple we said it put into gearman. The second part somewhere to run the test takes some more explaining. To the next point...
Several cloud companies donate capacity in their clouds for OpenStack to run CI tests. Overall, this capacity is managed by a customised orchestration tool called nodepool. Nodepool watches the gearman queue and sees what requests are coming out of Zuul. It looks at node-type of jobs in the queue and decides what types of nodes need to start and which cloud providers have capacity to satisfy demand. Nodepool will monitor the start-up of the virtual-machines and register the new nodes to the Jenkins master instances.
At this point, the Jenkins master has what it needs to actually get jobs started. When nodepool registers a host to a Jenkins master as a slave, the Jenkins master can now advertise its ability to consume jobs. For example, if a ubuntu-trusty node is provided to the Jenkins master instance by nodepool, Jenkins can now consume from gearman any job it knows about that is intended to run on an ubuntu-trusty slave. Jekins will run the job as defined in the job-definition on that host ssh-ing in, running scripts, copying the logs and waiting for the result. (It is a gross oversimplification, but for the purposes of OpenStack CI, Jenkins is pretty much used as a glorified ssh/scp wrapper. Zuul Version 3, under development, is working to remove the need for Jenkins to be involved at all).
Eventually, the test will finish. The Jenkins master will put the result back into gearman, which Zuul will consume. The slave will be released back to nodepool, which destroys it and starts all over again (slaves are not reused and also have no sensitive details on them, as they are essentially publicly accessible). Zuul will wait for the results of all jobs for the change and post the result back to Gerrit; it either gives a positive vote or the dreaded negative vote if required jobs failed (it also handles merges to git, but we'll ignore that bit for now).
- No two images, even for the same distribution or platform, are the same. Every provider seems to do something "helpful" to the images which requires some sort of workaround.
- Providers rarely leave these images alone. One day you would boot the image to find a bunch of Python libraries pip-installed, or a mount-point moved, or base packages removed (all happened).
- Even if the changes are helpful, it does not make for consistent and reproducible testing if every time you run, you're on a slightly different base system.
- Providers don't have some images you want (like a latest Fedora), or have different versions, or different point releases. All update asynchronously whenever they get around to it.
- You still really have no control over what does or does not go into the upstream base images. You don't notice a change until you deploy a new image based on an updated version and things break.
- The images still start with a fair amount of "stuff" on them. For example cloud-init is a rather large Python program and has a fair few dependencies. These dependencies can both conflict with parts of OpenStack or end up tacitly hiding real test requirements (the test doesn't specify it, but the package is there as part of another base dependency. Things then break when the base dependencies change). The whole idea of the CI is that (as much as possible) you're not making any assumptions about what is required to run your tests you want everything explicitly included.
- An image that "works everywhere" across multiple cloud-providers is quite a chore. cloud-init hasn't always had support for config-drive and Rackspace's DHCP-less environment, for example. Providers all have their various different networking schemes or configuration methods which needs to be handled consistently.
- Running with DevStack, which brings up a small, but fully-functional, OpenStack cloud with the change-under-test applied. Generally tempest is then used to ensure the big-picture things like creating VM's, networks and storage are all working.
- Unit-testing within the project; i.e. what you do when you type tox -e py27 in basically any OpenStack project.
- A bare node was made for unit-testing. While tox has plenty of information about installing required Python packages into the virtualenv for testing, it doesn't know anything about the system packages required to build those Python packages. This means things like gcc and library -devel packages which many Python packages use to build bindings. Thus the bare nodes had an ever-growing and not well-defined list of packages that were pre-installed during the image-build to support unit-testing. Worse still, projects didn't really know their dependencies but just relied on their testing working with this global list that was pre-installed on the image.
- In contrast to this, DevStack has always been able to bootstrap itself from a blank system to a working OpenStack deployment by ensuring it has the right dependencies installed. We don't want any packages pre-installed here because it hides actual dependencies that we want explicitly defined within DevStack otherwise, when a user goes to deploy DevStack for their development work, things break because their environment differs slightly to the CI one. If you look at all the job definitions in OpenStack, by convention any job running DevStack has a dsvm in the job name this referred to running on a "DevStack Virtual Machine" or a devstack node. As the CI environment has grown, we have more and more testing that isn't DevStack based (puppet apply tests, for example) that rather confusingly want to run on a devstack node because they do not want dependencies installed. While it's just a name, it can be difficult to explain!
There's a piece of software called
Firefox has had support for Google's
As my readers probably are well aware, I wrote my
In January and February of 2016 I ran an Obnam user survey. I'm not a
statistician, but here is my analysis of the results.
Executive summary: Obnam is slow, buggy, and the name is bad. But
they'd like to buy stickers and t-shirts.
Method
I wrote up a long list of questions about things I felt were of
interest to me. I used Google Forms to collect responses, and exported
them as a CSV file, and analysed based on that.
I used Google Forms, even though it is not free software, as it was
the easiest service I got to work that also seemed it'd be nice for
people to use. I could have run the survey using
Propellor was recently ported to FreeBSD, by Evan Cofsky. This new feature
led me down a two week long rabbit hole to make it type safe. In particular,
Propellor needed to be taught that some properties work on Debian, others on
FreeBSD, and others on both.
The user shouldn't need to worry about making a mistake like this;
the type checker should tell them they're asking for something that can't
fly.
What happened in the
Last night I got back from spending around 5 days in the Bay Area for
Spring Break. I stayed in a hostel in downtown SF for three nights
and then I stayed with a friend who is doing a PhD at Stanford. When
initially planning this trip my aim was just to visit somewhere
interesting on the west coast of the continental United States. I
chose the Bay Area because I wanted to get my PGP key signed by some
Debian Developers and that area has a high concentration of DDs, and
because I wanted to see my friend at Stanford. But in the end I liked
San Francisco a lot more than expected to and am very glad that I had an
opportunity to visit.
The first thing that I liked was how easy it seemed to be to find
people interested in the same kind of tech stuff that I am. I spent
my first afternoon in the city exploring the famous Mission district,
and at one point while sitting in the original Philz Coffee I found
that the person sitting next to me was running Debian on her laptop
and blogs about data privacy. We had an discussion about how viable
OpenPGP is as a component of a technically unsophisticated user s
attempts to stay safe online. Later that same day while riding the
subway train, someone next to me fired up Emacs on their laptop. And
over the course of my trip I met five Debian Developers doing all
sorts of different kinds of work both in and outside of Debian, and
some Debian users including one of Stanford s UNIX sysadmins. This is
a far cry from my day-to-day life down in the Sonoran Desert where new
releases of iOS are all anyone seems to be interested in.
Perhaps I should have expected this before my trip, but I think I had
assumed that most of the work being done in San Francisco was writing
web apps, so I was pleased to find people working on the same kind of
things that I am currently putting time into. And in saying the
above, I don t mean to demean the interests of the people around me in
Arizona for a moment (nor those writing web apps; I d like to learn
how to write good ones at some point). I m very grateful to be able
to discuss my philosophical interests with the other graduate
students. It s just that I miss being able to discuss tech stuff. I
guess you can t have everything you want!
One particular encouraging meeting I had was with a Debian Developer
employed by Google and working on Git. While my maths background sets
me up with the right thinking skills to write programs, I don t have
knowledge typically gained from an education in computer science that
enables one to work on the most interesting software. In particular,
low-level programming in C is something that I had thought it wouldn t
be possible for me to get started with. So it was encouraging to meet
the DD working on Git at Google because his situation was similar: his
undergraduate background is in maths and he was able to learn how to
code in C by himself and is now working on a exciting project at a
company that it is hard to get hired by. I don t mean that doing
exactly what he s doing is something that I aiming for, just that it
is very encouraging to know the field is more open to me than I had
thought. I was also reminded of how fortunate I am to have the
Internet to learn from and projects like Debian to get involved with.
Moving on from tech, I enjoyed the streets of San Francisco, and the
Stanford campus. San Francisco is fantastically multicultural though
with clear class and wealth divisions. A very few minutes walk from
the Twitter headquarters with its tech bros , as the maths PhD
students I met at Stanford call them, are legions of the un- and
barely-employed passing their time on the concrete. I enjoyed riding
one of the old cable cars through the aesthetically revealing and
stark combination of a west coast grid system on some very steep
hills. I was fortunate to be able to walk across the Golden Gate
Bridge on a perfectly clear and mist-free day.
Meeting people involved with Debian and meeting my old friend at
Stanford had me reflecting on and questioning my life in the desert
even more than usual. I try to remind myself that there is an end
date in sight and I will regret spending my time here just thinking
about leaving. I sometimes worry that I could easily find myself
moving to the big city London, San Francisco or elsewhere and
letting myself be carried by the imagined self-importance of that,
sidelining and procrastinating things that I should prize more highly.
I should remember that the world of writing software in big cities
isn t going away and my time in the desert is an opportunity to
prepare myself better for that, building my resistance to being swept
away by the tides of fashion.

