Skip to content

Commit

Permalink
RockyLinux 9 and Redhat/ubi9 support (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
alonre24 authored Oct 1, 2023
1 parent 7bd043a commit 54ecd52
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/redhat-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
platforms:
description: 'Platforms'
default: '["centos:7", "quay.io/centos/centos:stream8", "quay.io/centos/centos:stream9",
"redhat/ubi9:latest",
"rockylinux:8", "rockylinux:9",
"oraclelinux:7", "oraclelinux:8", "oraclelinux:9",
"amazonlinux:2", "amazonlinux:2022", "amazonlinux:2023",
Expand Down
122 changes: 114 additions & 8 deletions bin/getepel
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,20 @@ READIES=$(cd $HERE/.. && pwd)
# https://developers.redhat.com/products/red-hat-software-collections/overview
# SCL/ol https://docs.oracle.com/en/operating-systems/oracle-linux/scl-user/#Oracle-Linux

# centos7 centos8 centos9 rocky8 rocky9 ol7 ol8 ol9 amzn2 amzn2022 amzn2023
# EPEL v v v v v v v v v - -
# raven - v v v v - v v - v v
# powertools v v - v - - - - - - -
# crb - - v - v - - - - - -
# REMI v v v v v v v v v - -
# SCL v - - - - v* - - v - -
# centos7 centos8 centos9 rocky8 rocky9 ubi9 ol7 ol8 ol9 amzn2 amzn2022 amzn2023
# EPEL v v v v v v v v v v - -
# raven - v v v v v - v v - v v
# powertools v v - v - - - - - - - -
# crb - - v - v v* - - - - - -
# REMI v v v v v v v v v v - -
# SCL v - - - - - v* - - v - -

# Notes:
# - rockylinux and almalinux are compatible
# - Rocky Linux repos (https://wiki.rockylinux.org/rocky/repo):
# baseos, appstream, powertools(8), crb(9), highavailibility, resilientstorage
# - for Oracle Linux 7. SCL/ol should be used instead of SCL
# - ubi9 uses rocky9's repos (baseos, appstream, crb)

# Useful commands and locations:
# dnf repolist [--all]
Expand Down Expand Up @@ -116,6 +117,108 @@ install_remi() {
fi
}

# As redhat/ubi lack full non-commercial package repos, we use the ones provided by rocky linux
# Rocky epo configuration is from rockylinux:9 image (/etc/yum.repos.d/rocky.repo, rocky-extras.repo),
# with slight modifications (esp. adding rocky- prefix).
# Repo priority is set to 100 in hope to avoid collisions with ubi9 repos, not sure it is effective.
# Repo signature file is also taken from rockylinux:9.

install_rocky_repos() {
if [[ $osver != rhel9* ]]; then
return
fi
# check whether rhel repos are in place
if dnf info bison &> /dev/null; then
return
fi

tmp_yumd=$(mktemp -d)
cat <<-'END' > $tmp_yumd/rocky.repo
[rocky-baseos]
name=Rocky Linux $releasever - BaseOS
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
priority=100
[rocky-appstream]
name=Rocky Linux $releasever - AppStream
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
priority=100
[crb]
name=Rocky Linux $releasever - CRB
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=CRB-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/CRB/$basearch/os/
gpgcheck=1
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
priority=100
[rocky-extras]
name=Rocky Linux $releasever - Extras
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-$releasever
#baseurl=http://dl.rockylinux.org/$contentdir/$releasever/extras/$basearch/os/
gpgcheck=1
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
priority=100
END

cat <<-'END' > $tmp_yumd/RPM-GPG-KEY-Rocky-9
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: resf.keykeeper.v1
Comment: Keykeeper
xsFNBGJ5RksBEADF/Lzssm7uryV6+VHAgL36klyCVcHwvx9Bk853LBOuHVEZWsme
kbJF3fQG7i7gfCKGuV5XW15xINToe4fBThZteGJziboSZRpkEQ2z3lYcbg34X7+d
co833lkBNgz1v6QO7PmAdY/x76Q6Hx0J9yiJWd+4j+vRi4hbWuh64vUtTd7rPwk8
0y3g4oK1YT0NR0Xm/QUO9vWmkSTVflQ6y82HhHIUrG+1vQnSOrWaC0O1lqUI3Nuo
b6jTARCmbaPsi+XVQnBbsnPPq6Tblwc+NYJSqj5d9nT0uEXT7Zovj4Je5oWVFXp9
P1OWkbo2z5XkKjoeobM/zKDESJR78h+YQAN9IOKFjL/u/Gzrk1oEgByCABXOX+H5
hfucrq5U3bbcKy4e5tYgnnZxqpELv3fN/2l8iZknHEh5aYNT5WXVHpD/8u2rMmwm
I9YTEMueEtmVy0ZV3opUzOlC+3ZUwjmvAJtdfJyeVW/VMy3Hw3Ih0Fij91rO613V
7n72ggVlJiX25jYyT4AXlaGfAOMndJNVgBps0RArOBYsJRPnvfHlLi5cfjVd7vYx
QhGX9ODYuvyJ/rW70dMVikeSjlBDKS08tvdqOgtiYy4yhtY4ijQC9BmCE9H9gOxU
FN297iLimAxr0EVsED96fP96TbDGILWsfJuxAvoqmpkElv8J+P1/F7to2QARAQAB
zU9Sb2NreSBFbnRlcnByaXNlIFNvZnR3YXJlIEZvdW5kYXRpb24gLSBSZWxlYXNl
IGtleSAyMDIyIDxyZWxlbmdAcm9ja3lsaW51eC5vcmc+wsGKBBMBCAA0BQJieUZL
FiEEIcslauFvxUxuZSlJcC1CbTUNJ10CGwMCHgECGQEDCwkHAhUIAxYAAgIiAQAK
CRBwLUJtNQ0nXWQ5D/9472seOyRO6//bQ2ns3w9lE+aTLlJ5CY0GSTb4xNuyv+AD
IXpgvLSMtTR0fp9GV3vMw6QIWsehDqt7O5xKWi+3tYdaXRpb1cvnh8r/oCcvI4uL
k8kImNgsx+Cj+drKeQo03vFxBTDi1BTQFkfEt32fA2Aw5gYcGElM717sNMAMQFEH
P+OW5hYDH4kcLbtUypPXFbcXUbaf6jUjfiEp5lLjqquzAyDPLlkzMr5RVa9n3/rI
R6OQp5loPVzCRZMgDLALBU2TcFXLVP+6hAW8qM77c+q/rOysP+Yd+N7GAd0fvEvA
mfeA4Y6dP0mMRu96EEAJ1qSKFWUul6K6nuqy+JTxktpw8F/IBAz44na17Tf02MJH
GCUWyM0n5vuO5kK+Ykkkwd+v43ZlqDnwG7akDkLwgj6O0QNx2TGkdgt3+C6aHN5S
MiF0pi0qYbiN9LO0e05Ai2r3zTFC/pCaBWlG1ph2jx1pDy4yUVPfswWFNfe5I+4i
CMHPRFsZNYxQnIA2Prtgt2YMwz3VIGI6DT/Z56Joqw4eOfaJTTQSXCANts/gD7qW
D3SZXPc7wQD63TpDEjJdqhmepaTECbxN7x/p+GwIZYWJN+AYhvrfGXfjud3eDu8/
i+YIbPKH1TAOMwiyxC106mIL705p+ORf5zATZMyB8Y0OvRIz5aKkBDFZM2QN6A==
=PzIf
-----END PGP PUBLIC KEY BLOCK-----
END

runn $SUDO mv $tmp_yumd/rocky.repo /etc/yum.repos.d/
runn $SUDO mv $tmp_yumd/RPM-GPG-KEY-Rocky-9 /etc/pki/rpm-gpg/
runn rm -rf $tmp_yumd
runn $SUDO dnf makecache
}

install_centos_stream_repos() {
if [[ $osver != rocky8* && $osver != alamlinux8* ]]; then
return
Expand Down Expand Up @@ -234,8 +337,11 @@ if is_command dnf; then

if [[ $os != amzn* ]]; then
(( EPEL < 9 )) && runn $SUDO dnf config-manager -y --set-enabled powertools
(( EPEL > 8 )) && runn $SUDO dnf config-manager -y --set-enabled crb
(( EPEL > 8 )) && [[ $os != rhel ]] && runn $SUDO dnf config-manager -y --set-enabled crb

if [[ $os == rhel* ]]; then
install_rocky_repos
fi
xinstall epel-release
# xinstall --allowerasing https://dl.fedoraproject.org/pub/epel/epel-release-latest-${EPEL}.noarch.rpm
fi
Expand Down
7 changes: 5 additions & 2 deletions bin/getget
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ elif is_command yum; then
elif is_command brew; then
packs=${packs/ca-certificates/}
fi
if [[ $os == rocky && $(echo "$osver >= 9.0" | bc -l) ]]; then
packs=${packs/curl/}
if [[ $os == rocky || $os == almalinux || $os == rhel ]]; then
# has curl-minimal which conflicts with curl
if [[ $(echo "$osver >= 9.0" | bc -l) ]]; then
packs=${packs/curl/}
fi
fi

if [[ $FORCE != 1 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion bin/getrmpytools
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class RMPyToolsSetup(paella.Setup):

def _install_ramp(self):
if self.ramp_version is None:
self.pip_install(f"--no-cache-dir ramp-packer~=2.5.5")
self.pip_install(f"--no-cache-dir ramp-packer~=2.5.6")
else:
(source, version) = self.get_version(self.ramp_version)
if source == 'pypi':
Expand Down
1 change: 1 addition & 0 deletions mk/osnick.defs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ OS.alma8=almalinux:8
OS.alma9=almalinux:9
OS.rocky8=rockylinux:8
OS.rocky9=rockylinux:9
OS.rhel9=redhat/ubi9:latest
OS.jammy=ubuntu:jammy
OS.amzn2=amazonlinux:2
OS.amzn2022=amazonlinux:2022
Expand Down
3 changes: 2 additions & 1 deletion paella/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ def pip_uninstall(self, cmd, output="on_error", _try=False):
def install_downloaders(self, _try=False):
if self.os == 'linux':
self.install("ca-certificates", _try=_try)
if self.platform.is_redhat_compat() and self.platform.os_version[0] < 9:
if not (self.platform.is_redhat_compat() and self.platform.os_version[0] >= 9):
# has curl-minimal which conflicts with curl
self.install("curl", _try=_try)
self.install("wget unzip", _try=_try)

Expand Down

0 comments on commit 54ecd52

Please sign in to comment.