#236 Fix issues and performance with generating batches in Lightblue with complex deps between images.
Merged by jkaluza. Opened by jkaluza.
jkaluza/freshmaker lb-multiarch-nvr  into  master

Download 236.patch

This PR changes following:

  • Lightblue.find_images_to_rebuild now accepts list of SRPMs to look for in Lightblue. Previously, we was calling find_images_to_rebuild for each SRPM separately, which a) took long time to finish for advisories with multiple SRPMs and b) it was hard to merge multiple batches lists together and we actually never tried that to do it in some reproducible way.
  • Therefore, the LB queries changes to query for multiple SRPMs in the single LB calls.
  • Sorting by NVR in Lightblue was broken, because it just did string-based sorting, so foo-1-10 < foo-1-2 was True. The sorted_by_nvr is introduced to fix this.
    -Lightblue._deduplicate_images_to_rebuild was broken in case more than 1 duplicated image was in the list.
  • Batches generated by Lightblue.find_images_to_rebuild were broken in case we wanted to rebuild images A depends on B and also A. In this case, A was added to batches twice.

srpm_name is not used here, so I just removed it.

We used to just set nvr_to_coordinates["nvr"] = [0, 3], but this was not right. There might be multiple same NVRs in the to_rebuild list and in this case we would just overwrite previous nvr_to_coordinates["nvr"]. Instead, use nvr_to_coorinates["nvr"] = [] as a list and append coordinates to it.

This replaces the code originally in find_images_to_rebuild and moves it to separate method.

Since we now have multiple srpm_names as input, we need to lookup for parent images including the SRPM for each SRPM from srpm_names.

If srpm_name=["httpd", "glibc"], we know that the image here contains the httpd or glibc or both.

httpd can be just installed in the image, but glibc can be installed in some parent images. We therefore have to inspect the parent images separately for both SRPMs and return two rebuild_list lists.

rebased onto a86f3c7de9e12d22aa7a38c909cf251bedf678db

Pull-Request has been merged by jkaluza

Metadata