1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-10-23 21:28:56 +03:00

Reduce RHEL documentation build exposure to slow package mirrors.

The RHEL documentation builds have been slow and intermittently failing. The mirrors are not down: three consecutive full metadata refreshes from the same host measured 73, 124, and 157 seconds with a full mirror list and no dead mirrors, so the variance is mirror throughput rather than availability. Every documentation container pays this cost because Rocky sets metadata_expire to six hours and the cached base image is normally older than that by the time it is used.

Tune dnf to fail over from a slow mirror. By default a mirror is only abandoned when it delivers less than 1000 bytes per second for 30 seconds, so a mirror that is crawling rather than failing is retried instead of dropped. Raise the rate floor to 50k, shorten the timeout, sort mirrors by latency, and fetch in parallel.

Disable repositories the documentation does not use so their metadata is not refreshed in every container. The epel-release package adds an openh264 repository and the PGDG repository enables one repository per PostgreSQL version, of which only the documented version and the upgrade version are needed. This takes the enabled repository count from twelve to eight. The enable list is driven from the existing version variables so it follows a version bump.

After both changes the same three-run measurement was 81, 53, and 51 seconds, though the mirror variance being addressed also makes that comparison noisy.

The container revision is left alone since the cache key hashes the generated Dockerfile and these edits invalidate it on their own.
This commit is contained in:
David Steele
2026-07-29 12:32:04 +07:00
parent ef0fdc99ff
commit dd2e0ce8c1

View File

@@ -371,6 +371,12 @@
VOLUME [ "/sys/fs/cgroup" ]
# Tune dnf to fail over from a slow mirror. By default a mirror is only abandoned when it delivers less than 1000 bytes
# per second for 30 seconds, so a mirror that has not failed but is crawling is retried rather than dropped. Raise the
# rate floor well above that, shorten the timeout, sort mirrors by latency, and fetch in parallel.
RUN { echo minrate=50k; echo timeout=20; echo retries=5; echo max_parallel_downloads=10; \
echo fastestmirror=True; } >> /etc/dnf/dnf.conf
# Install packages
RUN yum install -y openssh-server openssh-clients sudo vim openssl findutils dnf-plugins-core awscli2 git 2>&1
@@ -378,6 +384,9 @@
RUN dnf -y install epel-release
RUN crb enable
# Disable the openh264 repository added by epel-release since the documentation does not use it
RUN dnf config-manager --disable epel-cisco-openh264
# Install packages that require epel
RUN dnf install -y azure-cli
@@ -396,6 +405,11 @@
# Install PGDG PostgreSQL repository
RUN rpm -ivh https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-`uname -m`/pgdg-redhat-repo-latest.noarch.rpm
# The PGDG repository enables a repository per PostgreSQL version. Disable all but the versions the documentation uses so
# their metadata is not refreshed in every documentation container.
RUN dnf config-manager --disable "pgdg*" && \
dnf config-manager --enable pgdg-common pgdg{[pg-version]} pgdg{[pg-version-upgrade]}
# Disable default PostgreSQL repository
RUN command -v dnf >/dev/null 2>&1 && dnf -qy module disable postgresql || true