redhat-openstack / ansible-role-tripleo-image-build

An ansible role used to create and publish quickstart built images
Apache License 2.0
5 stars 3 forks source link

Use tripleo-common library to build images instead of direct DIB invocation #17

Closed trown closed 8 years ago

trown commented 8 years ago

When I started on tripleo-quickstart, I had a chicken/egg problem in that I wanted to work on a tool that consumed an undercloud image, but there was no undercloud image produced. At the time, the only abstraction of DIB available was python-tripleoclient. However, this was not a good abstraction, as it made lots of assumptions that were difficult to override. This is all to explain why there is direct usage of DIB in this role.

The problem with using DIB with no abstraction on top, is that we have different images we would like to support. Right now, all of the upstream images can be produced with the same set of elements, however that is not guaranteed to be true in the future. Also, building images with a different distro, or even trying to use a different base element for the same distro (centos-minimal vs centos7) can not be easily done without some abstraction on top of DIB.

We could write that abstraction layer ourselves, since we are already using jinja templated bash to call DIB. However, that means that any improvements we would need to make over time to that layer would be locked away in this role. It turns out that there is now a better way. Since https://github.com/openstack/tripleo-common/commit/981c084014226cad725bdf4929608373bc848ef7 we are able to pass yaml definitions for images into the tripleo-common library.

That commit adds a handy python script for interacting with the image building library. https://github.com/openstack/tripleo-common/blob/981c084014226cad725bdf4929608373bc848ef7/scripts/tripleo-build-images

We can use that script as a guide to create an image build module in this role that similarly passes arbitrary yaml configs to the tripleo-common image building library.

trown commented 8 years ago

put up a WIP at https://review.gerrithub.io/#/c/274691

halcyondude commented 8 years ago

I like where this is going. using tripleo-common to build images makes a mountain of sense. Addressing WIP in gerrit directly for specifics, but at a high level I would like to incorporate a few aspects of https://review.gerrithub.io/#/c/273340/ into this.