l.a.domination : module documentation

Part of lp.archivepublisher

Archive Domination class.

We call 'domination' the procedure used to identify and supersede all old versions for a given publication, source or binary, inside a suite (distroseries + pocket, for instance, gutsy or gutsy-updates).

It also processes the superseded publications and makes the ones with unnecessary files 'eligible for removal', which will then be considered for archive removal. See deathrow.py.

In order to judge if a source is 'eligible for removal' it also checks if its resulting binaries are not necessary any more in the archive, i.e., old binary publications can (and should) hold sources in the archive.

Source version life-cycle example:

Note that:

The 'domination' procedure is the 2nd step of the publication pipeline and it is performed for each suite using:

Function join_spph_spn Join condition: SourcePackagePublishingHistory/SourcePackageName.
Function join_spph_spr Join condition: SourcePackageRelease/SourcePackagePublishingHistory.
Class SourcePublicationTraits Basic generalized attributes for SourcePackagePublishingHistory.
Class BinaryPublicationTraits Basic generalized attributes for BinaryPackagePublishingHistory.
Class GeneralizedPublication Generalize handling of publication records.
Function find_live_source_versions Find versions out of Published publications that should stay live.
Function get_binary_versions List versions for sequence of BinaryPackagePublishingHistory.
Function find_live_binary_versions_pass_1 Find versions out of Published publications that should stay live.
Class ArchSpecificPublicationsCache Cache to track which releases have arch-specific publications.
Function find_live_binary_versions_pass_2 Find versions out of Published publications that should stay live.
Function contains_arch_indep Are any of the publications among bpphs architecture-independent?
Class Dominator Manage the process of marking packages as superseded.
def join_spph_spn():
Join condition: SourcePackagePublishingHistory/SourcePackageName.
def join_spph_spr():
Join condition: SourcePackageRelease/SourcePackagePublishingHistory.
def find_live_source_versions(sorted_pubs):
Find versions out of Published publications that should stay live.

This particular notion of liveness applies to source domination: the latest version stays live, and that's it.

Parameterssorted_pubsAn iterable of SourcePackagePublishingHistory sorted by descending package version.
ReturnsA list of live versions.
def get_binary_versions(binary_publications):
List versions for sequence of BinaryPackagePublishingHistory.
Parametersbinary_publicationsAn iterable of BinaryPackagePublishingHistory.
ReturnsA list of the publications' respective versions.
def find_live_binary_versions_pass_1(sorted_pubs):
Find versions out of Published publications that should stay live.

This particular notion of liveness applies to first-pass binary domination: the latest version stays live, and so do publications of binary packages for the "all" architecture.

Parameterssorted_pubsAn iterable of BinaryPackagePublishingHistory, sorted by descending package version.
ReturnsA list of live versions.
def find_live_binary_versions_pass_2(sorted_pubs, cache):
Find versions out of Published publications that should stay live.

This particular notion of liveness applies to second-pass binary domination: the latest version stays live, and architecture-specific publications stay live (i.e, ones that are not for the "all" architecture).

More importantly, any publication for binary packages of the "all" architecture stay live if any of the non-"all" binary packages from the same source package release are still active -- even if they are for other architectures.

This is the raison d'etre for the two-pass binary domination algorithm: to let us see which architecture-independent binary publications can be superseded without rendering any architecture-specific binaries from the same source package release uninstallable.

(Note that here, "active" includes Published publications but also Pending ones. This is standard nomenclature in Soyuz. Some of the domination code confuses matters by using the term "active" to mean only Published publications).

Parameterssorted_pubsAn iterable of BinaryPackagePublishingHistory, sorted by descending package version.
cacheAn ArchSpecificPublicationsCache to reduce the number of times we need to look up whether an spr/archive/distroseries/pocket has active arch-specific publications.
ReturnsA list of live versions.
def contains_arch_indep(bpphs):
Are any of the publications among bpphs architecture-independent?
API Documentation for Launchpad, generated by pydoctor at 2018-11-19 00:00:14.