You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2026-10-23 21:28:56 +03:00
The definitions move out of common/vm.py into a vm section at the top of test/container.yaml, next to the container revisions that go with them, and are read and checked when the module is imported as they were before. The revisions move under a revision key to make room. The declaration is read with the loader the other declarations use, so a version keeps the text it was written as rather than arriving as a float. A new yaml_map_dict() reads a mapping as a dict where a key is looked up by name, which also reports a key that was written twice instead of silently keeping the last one. The constants that named each vm are gone. A vm is named by the string that --vm accepts, which is how the CI workflows and the documentation build already name them. A name used as a lookup is validated by vm_get(), and a name used in a comparison is protected by branch coverage since a comparison that can never match leaves a branch unhittable. VM_NONE, VM_ALL, and the os base and architecture constants remain because they name kinds rather than vms. VM_LIST is now the vms declared as default, so it is in declaration order. The container build no longer tests a vm by name. What a vm installs and configures is declared instead: valgrind, epel, powertools, python, coverage-python, pg-repo-key, pg-repo-release, dnf-module, and ssh-rsa. The three near identical blocks that added the PostgreSQL repo collapse into one, which removes the uncoverable branch annotation on the fedora branch. Every generated script is unchanged, so no image is rebuilt. The supported PostgreSQL versions are generated from build/postgres.yaml rather than declared a second time. A new bld_pg_version_list() reads just the versions, since a tool that only needs to know which ones are supported has no use for the interface that bld_pg_parse() scans the vendored headers for. The release flag comes with them, so the beta repository is added for whichever installed version has not been released rather than for a hardcoded vm and version. A vm with no container declares only default and coverage-c, since every other key says how a container is built. The os base declared for none was never read, and the os the tests run on with --vm=none is whatever the host is rather than the debian it claimed. The PostgreSQL versions declared for it were never read either, since only an integration test runs against a version and those need a container. A PostgreSQL version installed on a vm must now be one that build/postgres.yaml declares, and a version tested on a vm must be one installed there, both of which were only true by inspection before.
200 lines
5.9 KiB
YAML
200 lines
5.9 KiB
YAML
# **********************************************************************************************************************************
|
|
# Vm Definitions
|
|
#
|
|
# The vms tests can run on, the PostgreSQL versions each one provides, and what the container build needs to know about them. A vm
|
|
# name is what --vm accepts, e.g. u24 for Ubuntu 24.04. The definitions are declared here rather than in the code so that a vm and
|
|
# the container revision that goes with it are read from the same file.
|
|
#
|
|
# The definitions are checked when they are read: every supported PostgreSQL version must be tested on exactly one default vm and at
|
|
# least one default vm must collect C coverage. Without the check a new version could be added and silently never tested.
|
|
#
|
|
# - 'default' marks a vm that --vm=all selects
|
|
# - 'image' is the image the container is built from, and a vm without one has no container, i.e. it runs on the host
|
|
# - 'os-base' is the os the container is built on, which decides its package manager and where PostgreSQL is installed
|
|
# - 'db' is the PostgreSQL versions installed and 'db-test' the ones integration tests run against, which defaults to all of them
|
|
# - the rest is what the container build installs or configures, and each defaults to false or unset
|
|
#
|
|
# A vm with no container declares only 'default' and 'coverage-c'. Everything else says how a container is built, and the os the
|
|
# tests run on is then whatever the host is rather than anything that can be declared here.
|
|
# **********************************************************************************************************************************
|
|
vm:
|
|
# No container, i.e. run directly on the host
|
|
none:
|
|
coverage-c: true
|
|
|
|
# Alpine 3.21
|
|
a321:
|
|
default: true
|
|
os-base: alpine
|
|
image: alpine:3.21
|
|
db:
|
|
- 15
|
|
- 16
|
|
- 17
|
|
db-test:
|
|
- 16
|
|
pg-repo: false
|
|
ssh-rsa: true
|
|
|
|
# Alpine 3.24
|
|
a324:
|
|
default: true
|
|
os-base: alpine
|
|
image: alpine:3.24
|
|
db:
|
|
- 16
|
|
- 17
|
|
- 18
|
|
db-test:
|
|
- 17
|
|
pg-repo: false
|
|
|
|
# Debian 12
|
|
d12:
|
|
default: true
|
|
os-base: debian
|
|
image: debian:12
|
|
db:
|
|
- 15
|
|
pg-repo: false
|
|
valgrind: false
|
|
|
|
# RHEL 8
|
|
rh8:
|
|
default: true
|
|
os-base: rhel
|
|
image: rockylinux/rockylinux:8
|
|
db:
|
|
- 10
|
|
pg-repo: false
|
|
valgrind: false
|
|
epel: true
|
|
powertools: true
|
|
python: python3.12
|
|
|
|
# RHEL 9
|
|
rh9:
|
|
default: true
|
|
os-base: rhel
|
|
image: rockylinux/rockylinux:9
|
|
db:
|
|
- 14
|
|
- 15
|
|
- 16
|
|
- 17
|
|
- 18
|
|
db-test:
|
|
- 14
|
|
pg-repo-release: EL-9
|
|
dnf-module: true
|
|
coverage-python: pip
|
|
epel: true
|
|
|
|
# RHEL 10
|
|
rh10:
|
|
default: true
|
|
os-base: rhel
|
|
image: rockylinux/rockylinux:10
|
|
db:
|
|
- 14
|
|
- 15
|
|
- 16
|
|
- 17
|
|
- 18
|
|
db-test:
|
|
- 18
|
|
pg-repo-release: EL-10
|
|
pg-repo-key: false
|
|
coverage-python: package
|
|
epel: true
|
|
|
|
# Fedora 44
|
|
f44:
|
|
os-base: rhel
|
|
image: fedora:44
|
|
db:
|
|
- 14
|
|
- 15
|
|
- 16
|
|
- 17
|
|
- 18
|
|
db-test:
|
|
- 15
|
|
pg-repo-release: F-44
|
|
coverage-c: true
|
|
coverage-python: package
|
|
|
|
# Ubuntu 22.04
|
|
u22:
|
|
default: true
|
|
os-base: debian
|
|
image: ubuntu:22.04
|
|
db:
|
|
- 9.6
|
|
- 10
|
|
- 11
|
|
- 12
|
|
- 13
|
|
- 14
|
|
db-test:
|
|
- 9.6
|
|
- 11
|
|
coverage-c: true
|
|
ssh-rsa: true
|
|
|
|
# Ubuntu 24.04
|
|
u24:
|
|
default: true
|
|
os-base: debian
|
|
image: ubuntu:24.04
|
|
db:
|
|
- 9.6
|
|
- 10
|
|
- 11
|
|
- 12
|
|
- 13
|
|
- 14
|
|
- 15
|
|
- 16
|
|
- 17
|
|
- 18
|
|
- 19
|
|
db-test:
|
|
- 12
|
|
- 13
|
|
- 19
|
|
coverage-c: true
|
|
coverage-python: package
|
|
ssh-rsa: true
|
|
|
|
# **********************************************************************************************************************************
|
|
# Container Cache Revisions
|
|
#
|
|
# Base images are cached in the container registry (GHCR) keyed by a hash of the generated Dockerfile combined with the revision
|
|
# for the VM below. On a cache hit the image is pulled instead of being built locally, which saves a lot of time. Images are
|
|
# pushed automatically after a build when write access to the registry is available (i.e. from CI on the pgBackRest repository).
|
|
#
|
|
# A base image is built per VM and architecture, so a revision applies to a VM on a single architecture or on all of them,
|
|
# depending on how it is keyed below.
|
|
#
|
|
# The Dockerfile hash already forces a rebuild whenever the container definition changes. The revision here forces a rebuild when
|
|
# the Dockerfile is unchanged but the upstream packages have changed, e.g. a new PostgreSQL beta is released. Set values date-style
|
|
# (e.g. 20260710A) and commit to document the bump; this produces a new image tag so the next build misses the cache, rebuilds,
|
|
# and repushes.
|
|
#
|
|
# The "all" key is required and applies to every container that does not have a more specific revision, so it can only ever be
|
|
# bumped, never unset. A per-VM key overrides "all" for that container on every architecture, and a per-VM-and-architecture key
|
|
# overrides both for that container on that architecture only. Bumping "all" therefore rebuilds only the containers without a more
|
|
# specific revision; a container with a more specific revision is rebuilt by bumping that revision (or deleting its cached tag
|
|
# manually).
|
|
#
|
|
# Prefer a per-VM-and-architecture key when the packages only changed on some architectures. A per-VM key rebuilds every
|
|
# architecture the container is built for, including the emulated ones (ppc64le, s390x) that are very slow to build.
|
|
#
|
|
# Add overrides as needed, e.g.:
|
|
# rh10: 20260710A # rebuild rh10 on every architecture (independent of "all")
|
|
# rh10-x86_64: 20260710A # rebuild rh10 on x86_64 only (independent of "all" and "rh10")
|
|
# **********************************************************************************************************************************
|
|
revision:
|
|
all: 20260710A
|