[Openstack] Using OpenStack in a CI/CD runway

Daniel Ellison daniel at syrinx.net
Fri Mar 21 11:32:51 UTC 2014


On Mar 20, 2014, at 5:33 PM, Clint Byrum <clint at fewbar.com> wrote:
> Excerpts from Daniel Ellison's message of 2014-03-20 12:10:52 -0700:
>> Hi all,
>> 
>> I've tried to look this up online but all I seem to get is information about continuous integration/distribution in the OpenStack project itself and not much of anything concerning using OpenStack as part of a CI/CD runway to production.
>> 
>> Maybe the answers are obvious to those already involved in these things. Please forgive the ignorance that is surely about to ensue.
>> 
>> One point I'm stuck on (and several online resources mention this only in passing) is how to build a new image on the fly based on an existing image, adding a new version of code from the repository. There seems to be many ways to do this and for someone coming at this as a newbie it's very hard to figure out a good path. Is there a tool that can produce a new image from an existing one plus some extra stuff? And if so, can it be automated?
>> 
> 
> In the TripleO project, we use this tool to automate building custom
> images:
> 
> https://git.openstack.org/cgit/openstack/diskimage-builder/tree/README.md
> 
> It downloads or bootstraps an existing image (Ubuntu, Fedora, RHEL,
> OpenSUSE, Debian), extracts it and chroots into the image, runs your
> "elements", and then saves the result as raw or qcow2.

That is EXACTLY what I was looking for but didn't think existed. Thanks for this!

>> Concerning the runway itself, do people use Jenkins (or its equivalent) to orchestrate the whole thing? Or can Heat handle it all on its own? Or maybe Puppet (or its equivalent) can do it all.
>> 
> 
> Heat would not be able to handle it, no. Jenkins is a fine choice, as you
> can drive your image build/test based on commits to multiple git repos.

It looks like we're going with Bamboo, but I assume it's just a capable as say, Jenkins for this stuff. (It seems my company has consumed the Atlassian Kool-Aid :))

> Pay close attention to the 'source-repositories' element in
> diskimage-builder, as you would likely use it to pull the specific
> commit jenkins wants to test and then build an image for that.

Perfect. I'll do that.

>> As you can see, I'm casting about for answers. I apologize if these questions are naive. This is an important project in my company; it will determine whether we go ahead with OpenStack or scrap it completely. I need to find a solution that incorporates OpenStack into a continuous integration/distribution system.
>> 
> 
> One thing, I would suggest this cycle:
> 
> * Commit to repo
> * Pull commit into new image
> * Run tests on new image
> * Deploy image
> 
> That last step is tricky.. you can do it various ways, either by nova
> rebuilding servers (involves downtime), or spinning up new ones. It kind
> of depends on how your application is made available.

Those steps sound reasonable. For the last step we'll likely spin up a new VM and then swap it with the currently running VM. How we do that is still up in the air: We could fiddle with DNS or we could move a floating IP between the VMs. I'm sure there are other ways as well.

Thanks so much for your considered answer, Clint. It is appreciated. I'll update this thread if and when I get something going.

+Dan



More information about the Openstack mailing list