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

RFE Remove explicit package installs #32

Open trown opened 8 years ago

trown commented 8 years ago

In the current method of building up images, we pre-install all of the packages we might need in the base image, then feed this image to DIB to do the overcloud image builds, and finally modify the installed packages slightly to create the undercloud image.

This has the benefit of efficiency since we only download the packages once, but the drawback that we need to maintain a list of the packages to install. We recently updated our image building YAML to include the right upstream elements so that we will always get the right packages installed. However, as new packages are added to those elements, we will gradually lose our efficiency gain if we don't also update the package list.

Instead of maintaining a list of packages to install, we can instead pre-download every package from the delorean and delorean-deps repos without installing any of them. This will give us the same efficiency gain, without having to maintain any lists of packages.

There is another issue open #20, that would benefit from this approach. By using locally snapshot repos like this, we would be guaranteed to get the same content at run time as passed CI.

There is a WIP patch up to add the reposync to the build here. Beyond what is in that patch the other work items would be:

  1. update tripleo-quickstart to explicitly install python-tripleoclient prior to running openstack undercloud install
  2. remove all package lists from this project
halcyondude commented 8 years ago

I think this is the right direction and makes sense. It allows us to keep the time/bandwidth savings of having the packages pre-downloaded, while allowing upstream tooling to define the content and perform the (local rpm) install.

Regarding removing "all" package lists, I like the idea of retaining the capability to augment the package lists (defaulting lists to empty). While making the default / normative behavior to be a pass thru for upstream tooling, this will continue to allow developers and/or test to quickly add packages as part of the build process. #22 and #7 touch on this in different ways.

It would also enable scenarios/workflows around:

halcyondude commented 8 years ago

@trown you had asked for file sizes, etc. I'm still making this work (WIP should turn to actual patch shortly) but here's the details: https://da.gd/skq67

114M delorean 562M delorean-mitaka-testing


A brief note on implementation, there are really 2 variants of specifying repositories being used. They are:

  1. simple URI to .repo file (like delorean and delorean-deps)
  2. an invocation of a tool installed by an rpm, that emits/places .repo files in /etc/yum.repos.d. Examples of this are the ceph hammer/jewel files, centos-release itself, downstream rhos-release tool (for OSP repos), etc.

The current patch addresses the first case, however we still have a jinja'd bash script that invokes ceph-hammer (in the default case). In addition the downstream / RDO on RHEL internal cases use an analogous tool. A complete implementation satisfies both cases, and removes the variability that these runtime tools introduce (vs. declarative+static inputs).

Supporting scenario 2 might come in a later patch (hoping to not need this). I have a few alternate implementations I'm kicking around now.

stage on buildhost

reposync directly to the qcow

Neither is a slam dunk. Experimenting with both. Updates to come.