Skip to content

Commit

Permalink
Use Rocky Linux for documentation builds instead of CentOS.
Browse files Browse the repository at this point in the history
Since CentOS 8 will be EOL at the end of the year it makes sense to do this now. The centos:8 image is still used in documentation.xml because changes there require manual testing, which will need to be done at a later date. The changes are not user-facing, however, and can be done at any time.

Also update CentOS references to RHEL since that is what we are emulating for testing purposes.
  • Loading branch information
dwsteele committed Oct 28, 2021
1 parent 30c589a commit c32e000
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 58 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Expand Up @@ -40,11 +40,11 @@ jobs:
# All unit tests (with coverage) on the newest gcc available
- param: test --vm=f33 --param=c-only --param=tz=America/New_York

# RHEL/CentOS 8 documentation
- param: doc --vm=co8
# RHEL documentation
- param: doc --vm=rh8

# All integration tests
- param: test --vm=co7 --param=module=mock --param=module=real
- param: test --vm=rh7 --param=module=mock --param=module=real

steps:
- name: Checkout Code
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -51,7 +51,7 @@ pgbackrest-dev => Clone pgBackRest repository
git clone https://github.com/pgbackrest/pgbackrest.git
```

If using a RHEL-based system, the CPAN XML parser is required to run `test.pl` and `doc.pl`. Instructions for installing Docker and the XML parser can be found in the `README.md` file of the pgBackRest [doc](https://github.com/pgbackrest/pgbackrest/blob/main/doc) directory in the section "The following is a sample RHEL/CentOS 7 configuration that can be used for building the documentation". NOTE that the "Install latex (for building PDF)" section is not required since testing of the docs need only be run for HTML output.
If using a RHEL-based system, the CPAN XML parser is required to run `test.pl` and `doc.pl`. Instructions for installing Docker and the XML parser can be found in the `README.md` file of the pgBackRest [doc](https://github.com/pgbackrest/pgbackrest/blob/main/doc) directory in the section "The following is a sample RHEL 7 configuration that can be used for building the documentation". NOTE that the "Install latex (for building PDF)" section is not required since testing of the docs need only be run for HTML output.

## Coding

Expand Down
10 changes: 5 additions & 5 deletions doc/README.md
Expand Up @@ -8,7 +8,7 @@ This will build all documentation with defaults:
```bash
./doc.pl
```
The user guide can be built for `rhel` and `debian`. This will build the HTML user guide for RHEL/CentOS:
The user guide can be built for `rhel` and `debian`. This will build the HTML user guide for RHEL:
```bash
./doc.pl --out=html --include=user-guide --var=os-type=rhel
```
Expand All @@ -21,7 +21,7 @@ Each `os-type` has a default container image that will be used as a base for cre
./doc.pl --out=html --include=user-guide --var=os-type=debian --var=os-image=debian:9
./doc.pl --out=html --include=user-guide --var=os-type=rhel --var=os-image=centos:7
```
The following is a sample RHEL/CentOS 7 configuration that can be used for building the documentation.
The following is a sample RHEL 7 configuration that can be used for building the documentation.
```bash
# Install docker
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Expand All @@ -35,7 +35,7 @@ sudo yum install -y git wget
# Install latex (for building PDF)
sudo yum install -y texlive texlive-titlesec texlive-sectsty texlive-framed texlive-epstopdf ghostscript

# Install Perl modules that do not have CentOS packages via CPAN
# Install Perl modules via CPAN that do not have packages
sudo yum install -y yum cpanminus
sudo yum groupinstall -y "Development Tools" "Development Libraries"
sudo cpanm install --force XML::Checker::Parser
Expand All @@ -56,11 +56,11 @@ Ubuntu 16.04:
```bash
./doc.pl --out=html --include=user-guide --no-cache --var=os-type=debian --var=os-image=ubuntu:16.04 --var=package=test/package/pgbackrest_2.08-0_amd64.deb
```
RHEL/CentOS 7:
RHEL 7:
```bash
./doc.pl --out=html --include=user-guide --no-cache --var=os-type=rhel --var=os-image=centos:7 --var=package=test/package/pgbackrest-2.08-1.el7.x86_64.rpm
```
RHEL/CentOS 8:
RHEL 8:
```bash
./doc.pl --out=html --include=user-guide --no-cache --var=os-type=rhel --var=os-image=centos:8 --var=package=test/package/pgbackrest-2.08-1.el8.x86_64.rpm
```
Expand Down
4 changes: 2 additions & 2 deletions doc/RELEASE.md
Expand Up @@ -111,7 +111,7 @@ Improvements:
Documentation Features:
* Add user guide for RHEL/CentOS 7.
* Add user guide for Debian.
```

Commit to integration with the above message and push to CI.
Expand All @@ -137,7 +137,7 @@ v2.14: Bug Fix and Improvements
**Documentation Features**:
- Add user guide for RHEL/CentOS 7.
- Add user guide for Debian.
```

The first line will be the release title and the rest will be the body. The tag field should be updated with the current version so a tag is created from main. **Be sure to select the release commit explicitly rather than auto-tagging the last commit in main!**
Expand Down
6 changes: 3 additions & 3 deletions doc/release.pl
Expand Up @@ -234,10 +234,10 @@ =head1 SYNOPSIS
# Remove all docker containers to get consistent IP address assignments
executeTest('docker rm -f $(docker ps -a -q)', {bSuppressError => true});

# Generate deployment docs for RHEL/Centos
if (!defined($strVm) || $strVm eq VM_CO8)
# Generate deployment docs for RHEL
if (!defined($strVm) || $strVm eq VM_RH8)
{
&log(INFO, "Generate RHEL/CentOS documentation");
&log(INFO, "Generate RHEL documentation");

executeTest("${strDocExe} --deploy --key-var=os-type=rhel --out=pdf", {bShowOutputAsync => true});

Expand Down
2 changes: 1 addition & 1 deletion doc/xml/contributing.xml
Expand Up @@ -142,7 +142,7 @@
</execute>
</execute-list>

<p>If using a RHEL-based system, the CPAN XML parser is required to run <file>test.pl</file> and <file>doc.pl</file>. Instructions for installing Docker and the XML parser can be found in the <file>README.md</file> file of the <backrest/> <link url="{[github-url-main]}/doc">doc</link> directory in the section <quote>The following is a sample RHEL/CentOS 7 configuration that can be used for building the documentation</quote>. NOTE that the <quote>Install latex (for building PDF)</quote> section is not required since testing of the docs need only be run for HTML output.</p>
<p>If using a RHEL-based system, the CPAN XML parser is required to run <file>test.pl</file> and <file>doc.pl</file>. Instructions for installing Docker and the XML parser can be found in the <file>README.md</file> file of the <backrest/> <link url="{[github-url-main]}/doc">doc</link> directory in the section <quote>The following is a sample RHEL 7 configuration that can be used for building the documentation</quote>. NOTE that the <quote>Install latex (for building PDF)</quote> section is not required since testing of the docs need only be run for HTML output.</p>
</section>

<section id="coding">
Expand Down
10 changes: 5 additions & 5 deletions doc/xml/documentation.xml
Expand Up @@ -14,7 +14,7 @@
./doc.pl
</code-block>

<p>The user guide can be built for <id>rhel</id> and <id>debian</id>. This will build the HTML user guide for RHEL/CentOS:</p>
<p>The user guide can be built for <id>rhel</id> and <id>debian</id>. This will build the HTML user guide for RHEL:</p>

<code-block type="bash">
./doc.pl --out=html --include=user-guide --var=os-type=rhel
Expand All @@ -33,7 +33,7 @@
./doc.pl --out=html --include=user-guide --var=os-type=rhel --var=os-image=centos:7
</code-block>

<p>The following is a sample RHEL/CentOS 7 configuration that can be used for building the documentation.</p>
<p>The following is a sample RHEL 7 configuration that can be used for building the documentation.</p>

<code-block type="bash">
# Install docker
Expand All @@ -48,7 +48,7 @@ sudo yum install -y git wget
# Install latex (for building PDF)
sudo yum install -y texlive texlive-titlesec texlive-sectsty texlive-framed texlive-epstopdf ghostscript

# Install Perl modules that do not have CentOS packages via CPAN
# Install Perl modules via CPAN that do not have packages
sudo yum install -y yum cpanminus
sudo yum groupinstall -y "Development Tools" "Development Libraries"
sudo cpanm install --force XML::Checker::Parser
Expand All @@ -73,13 +73,13 @@ sudo usermod -aG docker testdoc
./doc.pl --out=html --include=user-guide --no-cache --var=os-type=debian --var=os-image=ubuntu:16.04 --var=package=test/package/pgbackrest_2.08-0_amd64.deb
</code-block>

<p>RHEL/CentOS 7:</p>
<p>RHEL 7:</p>

<code-block type="bash">
./doc.pl --out=html --include=user-guide --no-cache --var=os-type=rhel --var=os-image=centos:7 --var=package=test/package/pgbackrest-2.08-1.el7.x86_64.rpm
</code-block>

<p>RHEL/CentOS 8:</p>
<p>RHEL 8:</p>

<code-block type="bash">
./doc.pl --out=html --include=user-guide --no-cache --var=os-type=rhel --var=os-image=centos:8 --var=package=test/package/pgbackrest-2.08-1.el8.x86_64.rpm
Expand Down
6 changes: 3 additions & 3 deletions doc/xml/user-guide.xml
Expand Up @@ -11,7 +11,7 @@

<!-- OS titles -->
<variable key="os-debian-title">Debian &amp; Ubuntu</variable>
<variable key="os-rhel-title">RHEL &amp; CentOS 7-8</variable>
<variable key="os-rhel-title">RHEL 7-8</variable>

<!-- Base PostgreSQL versions -->
<variable key="os-debian-pg-version">12</variable>
Expand Down Expand Up @@ -42,13 +42,13 @@

<!-- Defines the container image that will be used to build the host -->
<variable key="os-image" if="{[os-type-is-debian]}">ubuntu:18.04</variable>
<variable key="os-image" if="{[os-type-is-rhel]}">centos:8</variable>
<variable key="os-image" if="{[os-type-is-rhel]}">rockylinux/rockylinux:8</variable>

<variable key="user-guide-subtitle" if="{[os-type-is-debian]}">{[os-debian-title]}</variable>
<variable key="user-guide-subtitle" if="{[os-type-is-rhel]}">{[os-rhel-title]}</variable>

<variable key="user-guide-os" if="{[os-type-is-debian]}">Debian/Ubuntu</variable>
<variable key="user-guide-os" if="{[os-type-is-rhel]}">RHEL/CentOS 7-8</variable>
<variable key="user-guide-os" if="{[os-type-is-rhel]}">RHEL 7-8</variable>

<variable key="pgbackrest-repo-path">/pgbackrest</variable>

Expand Down
2 changes: 1 addition & 1 deletion test/ci.pl
Expand Up @@ -156,7 +156,7 @@ sub processEnd

if ($ARGV[0] eq 'doc')
{
if ($strVm eq VM_CO7 || $strVm eq VM_CO8)
if ($strVm eq VM_RH7 || $strVm eq VM_RH8)
{
processBegin('LaTeX install');
processExec(
Expand Down
4 changes: 2 additions & 2 deletions test/container.yaml
Expand Up @@ -22,10 +22,10 @@

20210902A:
x86_64:
co7: c4d02428812374ab6a22efa437499592ae9c5f08
rh7: c4d02428812374ab6a22efa437499592ae9c5f08
f33: 04b3353c5fcc859c9df528e2fa78e6ed73c6390b

20210901A:
aarch64:
u20: d81b5a7e496290710c4dbef7a7f07ae60ae9619f
co7: a590bc38a94217b3bc9fe00a1051850c9deef145
rh7: a590bc38a94217b3bc9fe00a1051850c9deef145
4 changes: 2 additions & 2 deletions test/lib/pgBackRestTest/Common/ContainerTest.pm
Expand Up @@ -373,7 +373,7 @@ sub containerBuild

if ($$oVm{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_RHEL)
{
if ($strOS eq VM_CO7)
if ($strOS eq VM_RH7)
{
$strScript .=
" yum -y install centos-release-scl-rh epel-release && \\\n";
Expand Down Expand Up @@ -476,7 +476,7 @@ sub containerBuild
$strScript .=
" rpm --import http://yum.postgresql.org/RPM-GPG-KEY-PGDG && \\\n";

if ($strOS eq VM_CO7)
if ($strOS eq VM_RH7)
{
$strScript .=
" rpm -ivh \\\n" .
Expand Down
2 changes: 1 addition & 1 deletion test/lib/pgBackRestTest/Common/JobTest.pm
Expand Up @@ -293,7 +293,7 @@ sub run
($self->{bProfile} ? " \\\n\t-pg" : '') .
(vmArchBits($self->{oTest}->{&TEST_VM}) == 32 ? " \\\n\t-D_FILE_OFFSET_BITS=64" : '') .
($self->{bDebug} ? '' : " \\\n\t-DNDEBUG") .
($self->{oTest}->{&TEST_VM} eq VM_CO7 ? " \\\n\t-DDEBUG_EXEC_TIME" : '') .
($self->{oTest}->{&TEST_VM} eq VM_RH7 ? " \\\n\t-DDEBUG_EXEC_TIME" : '') .
($bCoverage ? " \\\n\t-DDEBUG_COVERAGE" : '') .
($self->{bDebugTestTrace} && $self->{bDebug} ? " \\\n\t-DDEBUG_TEST_TRACE" : '') .
(vmWithBackTrace($self->{oTest}->{&TEST_VM}) && $self->{bBackTrace} ? " \\\n\t-DWITH_BACKTRACE" : '') .
Expand Down
34 changes: 8 additions & 26 deletions test/lib/pgBackRestTest/Common/VmTest.pm
Expand Up @@ -38,8 +38,6 @@ use constant VM_DEPRECATED => 'deprecat
push @EXPORT, qw(VM_DEPRECATED);
use constant VM_IMAGE => 'image';
push @EXPORT, qw(VM_IMAGE);
use constant VM_OS => 'os';
push @EXPORT, qw(VM_OS);
use constant VM_OS_BASE => 'os-base';
push @EXPORT, qw(VM_OS_BASE);
use constant VM_OS_REPO => 'os-repo';
Expand All @@ -63,16 +61,6 @@ use constant VM_OS_BASE_DEBIAN => 'debian';
use constant VM_OS_BASE_RHEL => 'rhel';
push @EXPORT, qw(VM_OS_BASE_RHEL);

####################################################################################################################################
# Valid OS list
####################################################################################################################################
use constant VM_OS_CENTOS => 'centos';
push @EXPORT, qw(VM_OS_CENTOS);
use constant VM_OS_DEBIAN => 'debian';
push @EXPORT, qw(VM_OS_DEBIAN);
use constant VM_OS_UBUNTU => 'ubuntu';
push @EXPORT, qw(VM_OS_DEBIAN);

####################################################################################################################################
# Valid architecture list
####################################################################################################################################
Expand All @@ -90,10 +78,10 @@ use constant VM_ALL => 'all';
use constant VM_NONE => 'none';
push @EXPORT, qw(VM_NONE);

use constant VM_CO7 => 'co7';
push @EXPORT, qw(VM_CO7);
use constant VM_CO8 => 'co8';
push @EXPORT, qw(VM_CO8);
use constant VM_RH7 => 'rh7';
push @EXPORT, qw(VM_RH7);
use constant VM_RH8 => 'rh8';
push @EXPORT, qw(VM_RH8);
use constant VM_F33 => 'f33';
push @EXPORT, qw(VM_F33);
use constant VM_U18 => 'u18';
Expand All @@ -104,13 +92,13 @@ use constant VM_D9 => 'd9';
push @EXPORT, qw(VM_D9);

# Defines the vm that will be used for expect testing
use constant VM_EXPECT => VM_CO7;
use constant VM_EXPECT => VM_RH7;
push @EXPORT, qw(VM_EXPECT);

# VM aliases for run matrices (numbered oldest to newest)
use constant VM2 => VM_D9;
push @EXPORT, qw(VM2);
use constant VM3 => VM_CO7;
use constant VM3 => VM_RH7;
push @EXPORT, qw(VM3);
use constant VM4 => VM_U20;
push @EXPORT, qw(VM4);
Expand All @@ -125,7 +113,6 @@ my $oyVm =
&VM_NONE =>
{
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
&VM_OS => VM_OS_UBUNTU,
&VM_ARCH => VM_ARCH_AMD64,
&VMDEF_COVERAGE_C => true,
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
Expand All @@ -143,11 +130,10 @@ my $oyVm =
],
},

# CentOS 7
&VM_CO7 =>
# RHEL 7
&VM_RH7 =>
{
&VM_OS_BASE => VM_OS_BASE_RHEL,
&VM_OS => VM_OS_CENTOS,
&VM_IMAGE => 'centos:7',
&VM_ARCH => VM_ARCH_AMD64,
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
Expand Down Expand Up @@ -175,7 +161,6 @@ my $oyVm =
&VM_F33 =>
{
&VM_OS_BASE => VM_OS_BASE_RHEL,
&VM_OS => VM_OS_CENTOS,
&VM_IMAGE => 'fedora:33',
&VM_ARCH => VM_ARCH_AMD64,
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
Expand Down Expand Up @@ -203,7 +188,6 @@ my $oyVm =
&VM_D9 =>
{
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
&VM_OS => VM_OS_DEBIAN,
&VM_OS_REPO => 'stretch',
&VM_IMAGE => 'i386/debian:9',
&VM_ARCH => VM_ARCH_I386,
Expand All @@ -230,7 +214,6 @@ my $oyVm =
&VM_U18 =>
{
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
&VM_OS => VM_OS_UBUNTU,
&VM_OS_REPO => 'bionic',
&VM_IMAGE => 'ubuntu:18.04',
&VM_ARCH => VM_ARCH_AMD64,
Expand Down Expand Up @@ -273,7 +256,6 @@ my $oyVm =
&VM_U20 =>
{
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
&VM_OS => VM_OS_UBUNTU,
&VM_OS_REPO => 'focal',
&VM_IMAGE => 'ubuntu:20.04',
&VM_ARCH => VM_ARCH_AMD64,
Expand Down
6 changes: 3 additions & 3 deletions test/test.pl
Expand Up @@ -81,7 +81,7 @@ =head1 SYNOPSIS
--no-gen do not run code generation
--gen-check check that auto-generated files are correct (used in CI to detect changes)
--code-count generate code counts
--expect --vm=co7 --pg-version=9.6 --log-force
--expect --vm=rh7 --pg-version=9.6 --log-force
--no-valgrind don't run valgrind on C unit tests (saves time)
--no-coverage don't run coverage on C unit tests (saves time)
--no-coverage-report run coverage but don't generate coverage report (saves time)
Expand All @@ -108,7 +108,7 @@ =head1 SYNOPSIS
--quiet, -q equivalent to --log-level=off
VM Options:
--vm docker container to build/test (e.g. co7)
--vm docker container to build/test (e.g. rh7)
--vm-build build Docker containers
--vm-force force a rebuild of Docker containers
--vm-out Show VM output (default false)
Expand Down Expand Up @@ -901,7 +901,7 @@ =head1 SYNOPSIS
# Patch files in RHEL package builds
#
# Use these commands to create a new patch (may need to modify first line):
# BRDIR=/backrest;BRVM=co7;BRPATCHFILE=${BRDIR?}/test/patch/rhel-package.patch
# BRDIR=/backrest;BRVM=rh7;BRPATCHFILE=${BRDIR?}/test/patch/rhel-package.patch
# PKDIR=${BRDIR?}/test/result/package/${BRVM}/SPECS
# diff -Naur ${PKDIR?}.old ${PKDIR}.new > ${BRPATCHFILE?}
my $strPackagePatch = "${strBackRestBase}/test/patch/rhel-package.patch";
Expand Down

0 comments on commit c32e000

Please sign in to comment.