NLnetLabs / ploutos

Reusable packaging workflow for Rust projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Verify / add support for RHEL 9 (and derivatives)

ximon18 opened this issue · comments

Currently Ploutos has some special logic for 7 and 8, we should extend the test suite with a test case for RHEL/CentOS/RockyLinux/AlmaLinux/etc v9.

If os is set to centos:8 or rockylinux:8 in the build rules then it defaults to rockylinux:8 as the LXC test container to use which causes a glibc failure in the "Install the newly built package" test step:

Run case ${OS_NAME} in
+ case ${OS_NAME} in
+ sg lxd -c 'lxc exec testcon -- yum install -y /tmp/mytest-0.1.1-1.x86_64.rpm'
+ tee install.log
Last metadata expiration check: 0:00:32 ago on Tue Feb 28 21:43:04 2023.
Error: 
 Problem: conflicting requests
  - nothing provides libc.so.6(GLIBC_2.32)(64bit) needed by mytest-0.1.1-1.x86_64
  - nothing provides libc.so.6(GLIBC_2.33)(64bit) needed by mytest-0.1.1-1.x86_64
  - nothing provides libc.so.6(GLIBC_2.34)(64bit) needed by mytest-0.1.1-1.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
Error: Process completed with exit code 1.

If instead os is NOT set then the build fails in the "Set vars" step with error:

Run # Get the operating system and release name (e.g. ubuntu and xenial) from the image name (e.g. ubuntu:xenial) by
Error: This workflow only supports 'debian', 'ubuntu' or 'centos' operating systems: 'rockylinux:9' is not supported.
Error: Process completed with exit code 1.

NLnetLabs/ploutos-testing#46 shows that changes made in the branch associated with this issue enable creation of RHEL 9 (and derivative) compatible packages can now be created, using Rocky Linux 9 as the build and test environment.

The package publication script will also need updating as it currently doesn't handle packages whose GitHub Actions zip artifact file name contains rockylinux rather than centos, nor does it know in which repo to publish them. The simplest would be to add a centos/9/ repo but that's a bit of a lie.

Why? Well there is no such thing as CentOS 9, there is CentOS 7 and 8 and then after that it became EoL and was replaced by CentOS Stream 9. Rocky Linux isn't technically the same as CentOS Stream 9, but I believe is based on CentOS Stream 9 and is led by a co-founder of CentOS so could be argued to be the true spiritual successor to CentOS.

But we need to publish these packages under some URL... /centos/N was always a handy alias for hopefully-RHEL-compatible, maybe we should just continue using /centos/N even if we build it on Rocky Linux. A quick test of the package built using Rocky Linux 9 shows that it seems to work in a CentOS 9 Stream Docker container:

$ docker run -it quay.io/centos/centos:stream9
Unable to find image 'quay.io/centos/centos:stream9' locally
stream9: Pulling from centos/centos
0ac3d84c3441: Pull complete 
Digest: sha256:1f6b2e46a49fe61aac5d60f2ada8d0fcd4c92416a17c20123e1666887fd7b37d
Status: Downloaded newer image for quay.io/centos/centos:stream9

[root@8b7a325388a7 /]# cat /etc/redhat-release 
CentOS Stream release 9

[root@8b7a325388a7 /]# yum install -y unzip
...snip...

[root@8b7a325388a7 tmp]# unzip routinator_rockylinux_9_x86_64.zip 
Archive:  routinator_rockylinux_9_x86_64.zip
   creating: generate-rpm/
  inflating: generate-rpm/routinator-0.12.2-dev-1.x86_64.rpm  
[root@8b7a325388a7 tmp]# cd generate-rpm/
[root@8b7a325388a7 generate-rpm]# ls -la
total 2848
drwxr-xr-x 1 root root      68 Feb 28 23:22 .
drwxrwxrwt 1 root root      92 Mar  1 09:18 ..
-rw-r--r-- 1 root root 2913461 Feb 28 23:22 routinator-0.12.2-dev-1.x86_64.rpm
[root@8b7a325388a7 generate-rpm]# yum install ./routinator-0.12.2-dev-1.x86_64.rpm 
Last metadata expiration check: 0:00:17 ago on Wed Mar  1 09:18:26 2023.
Dependencies resolved.
===============================================================================================================================================================================================================================================
 Package                                                   Architecture                                          Version                                                     Repository                                                   Size
===============================================================================================================================================================================================================================================
Installing:
 routinator                                                x86_64                                                0.12.2-dev-1                                                @commandline                                                2.8 M
Installing dependencies:
 rsync                                                     x86_64                                                3.2.3-19.el9                                                baseos                                                      398 k

Transaction Summary
===============================================================================================================================================================================================================================================
Install  2 Packages

Total size: 3.2 M
Total download size: 398 k
Installed size: 9.8 M
Is this ok [y/N]: y
Downloading Packages:
rsync-3.2.3-19.el9.x86_64.rpm                                                                                                                                                                                  3.2 MB/s | 398 kB     00:00    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                          501 kB/s | 398 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                       1/1 
  Installing       : rsync-3.2.3-19.el9.x86_64                                                                                                                                                                                             1/2 
  Installing       : routinator-0.12.2-dev-1.x86_64                                                                                                                                                                                        2/2 
  Running scriptlet: routinator-0.12.2-dev-1.x86_64                                                                                                                                                                                        2/2 
  Verifying        : rsync-3.2.3-19.el9.x86_64                                                                                                                                                                                             1/2 
  Verifying        : routinator-0.12.2-dev-1.x86_64                                                                                                                                                                                        2/2 

Installed:
  routinator-0.12.2-dev-1.x86_64                                                                                           rsync-3.2.3-19.el9.x86_64                                                                                          

Complete!

[root@8b7a325388a7 generate-rpm]# routinator -V
Routinator 0.12.2-dev

Nothing in the package itself says whether it's for RHEL or Stream or Rocky or ...

# dnf repoquery -i ./routinator-0.12.2-dev-1.x86_64.rpm 
Last metadata expiration check: 0:02:28 ago on Wed Mar  1 09:54:21 2023.
Name         : routinator
Version      : 0.12.2
Release      : dev-1
Architecture : x86_64
Size         : 2.8 M
Source       : None
Repository   : @commandline
Summary      : An RPKI relying party software.
License      : BSD
Description  : An RPKI relying party software.