From c5bc86d45e003905ef411146e66b414d26fb1ff8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Aug 2020 20:16:11 +0200 Subject: Add support for Phased-Update-Percentage This adds support for Phased-Update-Percentage by pinning upgrades that are not to be installed down to 1. The output of policy has been changed to add the level of phasing, and documentation has been improved to document how phased updates work. The patch detects if it is running in a chroot, and if so, always includes phased updates, restoring classic apt behavior to avoid behavioral changes on buildd chroots. Various options are added to control this all: * APT::Get::{Always,Never}-Include-Phased-Updates and their legacy update-manager equivalents to always or never include phased updates * APT::Machine-ID can be set to a UUID string to have all machines in a fleet phase the same * Dir::Etc::Machine-ID is weird in that it's default is sort of like ../machine-id, but not really, as ../machine-id would look up $PWD/../machine-id and not relative to Dir::Etc; but it allows you to override the path to machine-id (as opposed to the value) * Dir::Bin::ischroot is the path to the ischroot(1) binary which is used to detect whether we are running in a chroot. --- doc/apt_preferences.5.xml | 19 ++++++++++++++++++- doc/examples/configure-index | 10 ++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index 4ef5282e7..23f2d2d6b 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -102,7 +102,8 @@ algorithm to set the priorities of the versions of a package. Assign: priority 1 to the versions coming from archives which in their Release files are marked as "NotAutomatic: yes" but not as "ButAutomaticUpgrades: yes" -like the Debian experimental archive. +like the Debian experimental archive., +as well as versions that are not phased on this systems. @@ -175,6 +176,22 @@ because at least one of the available versions has a higher priority than the installed version. +Phased Updates +APT understands a field called Phased-Update-Percentage +which can be used to control the rollout of a new version. It is an integer between +0 and 100. + +A system's eligibility to a phased update is determined by seeding +random number generator with the package source name, the version number, +and /etc/machine-id, and then calculating an integer in the range [0, 100]. +If this integer is larger than the Phased-Update-Percentage, +the version is pinned to 1, and thus held back. Otherwise, normal policy rules apply. + + +In case you have multiple systems that you want to receive the same set of updates, you can set +APT::Machine-ID to a UUID such that they all phase the same, or set APT::Get::Never-Include-Phased-Updates +or APT::Get::Always-Include-Phased-Updates to true such that APT will never/always consider phased updates. + The Effect of APT Preferences The APT preferences file allows the system administrator to control the diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 15b020198..5ddf4132c 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -101,6 +101,8 @@ APT Upgrade ""; Only-Upgrade ""; Upgrade-Allow-New ""; + Always-Include-Phased-Updates ""; + Never-Include-Phased-Updates ""; Purge ""; ReInstall ""; Compile ""; @@ -219,6 +221,8 @@ APT // control parameters for cron jobs by /etc/cron.daily/apt documented there Periodic {}; + + Machine-ID ""; // Value of /etc/machine-id }; // Options for the downloading routines @@ -417,6 +421,7 @@ Dir "" SourceParts ""; Trusted ""; TrustedParts ""; + Machine-ID ""; // by default points to ../machine-id effectively }; // Locations of binaries @@ -434,6 +439,7 @@ Dir "" bzip2 ""; lzma ""; uncompressed ""; + ischroot ""; solvers ""; // of directories planners ""; // of directories @@ -561,6 +567,7 @@ Debug APT::Progress::PackageManagerFd ""; SetupAPTPartialDirectory::AssumeGood ""; Locking ""; + Phasing ""; }; pkgCacheGen @@ -843,3 +850,6 @@ Rred::Compress ""; APT::Internal::OpProgress::Absolute ""; APT::Color ""; + +update-manager::always-include-phased-updates ""; +update-manager::never-include-phased-updates ""; -- cgit v1.2.3