Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preliminar support for RHEL 10 (Development Only) #94

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ needed.
* Adherence with best practices is done
with [gsl-lite](https://github.com/gsl-lite/gsl-lite).
* [newt](https://pagure.io/newt) for Terminal UI.
* [glibmm](https://developer.gnome.org/glibmm/stable/) for Glib bindings.
* [glibmm](https://developer.gnome.org/glibmm/stable/) for Glib bindings to interact with the OS.
* Testing framework provided by [doctest](https://github.com/doctest/doctest).
* [CLI11](https://github.com/CLIUtils/CLI11) to parse command line arguments.

Only [newt](https://pagure.io/newt) must be pre-installed for compilation. We
don't ship it. Everything else should be found and installed
Expand Down Expand Up @@ -115,7 +117,8 @@ nature and `root` execution requirements.

### Recommended VM settings

* EL8.9 or EL9.4 and higher based system with **minimal** package selection
* EL8.10 or EL9.5 and higher based system with **minimal** package selection
* EL10 Beta is supported only for development purposes
* Half of system CPU cores as vCPU
* At least 4GB of RAM
* 50GB of Disk
Expand Down Expand Up @@ -148,12 +151,6 @@ directory of the project.
As a final warning: running the software without **DUMMY** option will probably
damage the running OS if they run as **root**. Be advised.

You can run it by calling `./binary_name -t` (TUI - Terminal User Interface) or
by using a `answerfile` and CLI (Command Line Interface) with
`./binary_name -a /path/to/answerfile`.

If you require any further help, please use `./binary_name -h` (-h, --help).

### Running tests

To run tests you need to run `ctest` inside the build directory.
Expand Down
5 changes: 3 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ def requirements(self):
self.requires("magic_enum/[>=0.9.0 <0.10.0]")
self.requires("gsl-lite/[>=0.41.0 <0.42.0]")
self.requires("doctest/[>=2.4.0 <2.5.0]")
self.requires("cryptopp/[>=8.9.0 <8.10.0]")
self.requires("sdbus-cpp/[>=2.0.0 <2.1.0]")
self.requires("glibmm/[>=2.78.1 <2.79.0]")

# Override libmount to unify on 2.39.2.
# This prevents the conflict with glib and sdbus-cpp version requirements.
# This prevents the conflict with glib and sdbus-cpp requirements.
self.requires("libmount/2.39.2", override=True)
# Override libsystemd to fix compilation on RHEL 10.
self.requires("libsystemd/[>=255.10 <256.0]", override=True)

def layout(self):
cmake_layout(self)
Expand Down
4 changes: 2 additions & 2 deletions include/cloysterhpc/answerfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef CLOYSTERHPC_ANSWERFILE_H_
#define CLOYSTERHPC_ANSWERFILE_H_

#include "cloysterhpc/tools/ITool.h"
#include "os.h"
#include <cloysterhpc/tools/ITool.h>
#include <cloysterhpc/os.h>
#include <boost/asio.hpp>
#include <cloysterhpc/inifile.h>
#include <cloysterhpc/mailsystem/postfix.h>
Expand Down
2 changes: 1 addition & 1 deletion include/cloysterhpc/cloyster.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <cloysterhpc/services/log.h>
#include <fmt/format.h>
#include <magic_enum.hpp>
#include <magic_enum/magic_enum.hpp>
#include <string>

namespace cloyster {
Expand Down
2 changes: 1 addition & 1 deletion include/cloysterhpc/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <unordered_map>
#include <vector>

#include <magic_enum.hpp>
#include <magic_enum/magic_enum.hpp>

using boost::asio::ip::address;

Expand Down
2 changes: 1 addition & 1 deletion include/cloysterhpc/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class OS {
* @enum Platform
* @brief Enumeration representing different platforms of the OS.
*/
enum class Platform { el8, el9 };
enum class Platform { el8, el9, el10 };

/**
* @enum Distro
Expand Down
2 changes: 1 addition & 1 deletion include/cloysterhpc/presenter/PresenterInstall.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <cloysterhpc/presenter/Presenter.h>

#include <boost/lexical_cast.hpp>
#include <magic_enum.hpp>
#include <magic_enum/magic_enum.hpp>

class PresenterInstall : public Presenter {
public:
Expand Down
2 changes: 1 addition & 1 deletion include/cloysterhpc/presenter/PresenterNetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <cloysterhpc/services/log.h>
#include <cloysterhpc/view/newt.h>

#include <magic_enum.hpp>
#include <magic_enum/magic_enum.hpp>

#include <memory>
#include <utility>
Expand Down
113 changes: 113 additions & 0 deletions include/cloysterhpc/repos/el10/cloyster.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
R"([{0}-OL-BaseOS]
name=Oracle Linux 10 BaseOS Latest ($basearch)
baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL10/baseos/latest/$basearch/
enabled=0
gpgcheck=1
gpgkey=https://yum.oracle.com/RPM-GPG-KEY-oracle-ol10

[{0}-Rocky-BaseOS]
name=Rocky Linux $releasever - BaseOS
baseurl=http://dl.rockylinux.org/pub/rocky/$releasever/BaseOS/$basearch/os/
enabled=0
gpgcheck=1
gpgkey=https://mirror.versatushpc.com.br/rocky/linux/RPM-GPG-KEY-Rocky-10

[{0}-AlmaLinux-BaseOS]
name=AlmaLinux $releasever - BaseOS
baseurl=https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/
enabled=0
gpgcheck=1
gpgkey=https://mirror.versatushpc.com.br/almalinux/almalinux/RPM-GPG-KEY-AlmaLinux-10

[{0}-beegfs]
name=BeeGFS
baseurl=https://mirror.versatushpc.com.br/beegfs/beegfs_7.4.2/dists/rhel10/
enabled=0
gpgcheck=1
gpgkey=https://mirror.versatushpc.com.br/beegfs/beegfs_7.4.2/gpg/GPG-KEY-beegfs

[{0}-grafana]
name=grafana
baseurl=https://mirror.versatushpc.com.br/grafana/
enabled=0
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key

[{0}-influxdata]
name=InfluxData Repository - Stable
baseurl=https://mirror.versatushpc.com.br/influxdata/
enabled=0
gpgcheck=1
gpgkey=https://repos.influxdata.com/influxdata-archive_compat.key

[{0}-oneAPI]
name=Intel oneAPI repository
baseurl=https://mirror.versatushpc.com.br/oneAPI/
enabled=0
gpgcheck=1
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB

[{0}-zabbix]
name=zabbix
baseurl=https://mirror.versatushpc.com.br/zabbix/zabbix/6.5/rhel/10/x86_64/
enabled=0
gpgcheck=1
gpgkey=https://mirror.versatushpc.com.br/zabbix/RPM-GPG-KEY-ZABBIX

[{0}-elrepo]
name=elrepo
baseurl=https://mirror.versatushpc.com.br/elrepo/elrepo/el10/x86_64/
enabled=0
gpgcheck=1
gpgkey=https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

[{0}-rpmfusion-free-updates]
name=rpmfusion-free-updates
baseurl=https://mirror.versatushpc.com.br/rpmfusion/free/el/updates/10/x86_64/
enabled=0
gpgcheck=1
gpgkey=https://mirror.versatushpc.com.br/rpmfusion/free/el/RPM-GPG-KEY-rpmfusion-free-el-10

[{0}-epel]
name=Extra Packages for Enterprise Linux 10 - $basearch
baseurl=https://mirror.versatushpc.com.br/epel/10/Everything/x86_64/
enabled=0
gpgcheck=1
gpgkey=https://mirror.versatushpc.com.br/epel/RPM-GPG-KEY-EPEL-10

[{0}-epel-debuginfo]
name=Extra Packages for Enterprise Linux 10 - $basearch - Debug
baseurl=https://mirror.versatushpc.com.br/epel/10/Everything/x86_64/debug/
enabled=0
gpgcheck=1
gpgkey=https://mirror.versatushpc.com.br/epel/RPM-GPG-KEY-EPEL-10

[{0}-epel-source]
name=Extra Packages for Enterprise Linux 10 - $basearch - Source
baseurl=https://mirror.versatushpc.com.br/epel/10/Everything/source/tree/
enabled=0
gpgcheck=1
gpgkey=https://mirror.versatushpc.com.br/epel/RPM-GPG-KEY-EPEL-10

[{0}-openhpc]
name=OpenHPC
baseurl=https://mirror.versatushpc.com.br/openhpc/4/EL_10/
enabled=0
gpgcheck=1
gpgkey=https://obs.openhpc.community/projects/OpenHPC3/public_key

[{0}-openhpc-updates]
name=OpenHPC Updates
baseurl=https://mirror.versatushpc.com.br/openhpc/3/updates/EL_10/
enabled=0
gpgcheck=1
gpgkey=https://obs.openhpc.community/projects/OpenHPC3/public_key

[{0}-nvhpc]
name=NVIDIA HPC SDK
baseurl=https://developer.download.nvidia.com/hpc-sdk/rhel/$basearch
enabled=0
gpgcheck=1
gpgkey=https://developer.download.nvidia.com/hpc-sdk/rhel/RPM-GPG-KEY-NVIDIA-HPC-SDK

)"
7 changes: 4 additions & 3 deletions include/cloysterhpc/services/repo.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
#include <vector>

/**
* @brief This class represents an EL .repo file as it's found in /etc/yum.repos.d/
* @note This class is WIP, it was added as a PoC of glibmm integration
*/
* @brief This class represents an EL .repo file as it's found in
* /etc/yum.repos.d/
* @note This class is WIP, it was added as a PoC of glibmm integration
*/
class repo {

public:
Expand Down
2 changes: 1 addition & 1 deletion include/cloysterhpc/services/shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef CLOYSTERHPC_SHELL_H_
#define CLOYSTERHPC_SHELL_H_

#include <magic_enum.hpp>
#include <magic_enum/magic_enum.hpp>

#include <cloysterhpc/cluster.h>
#include <cloysterhpc/services/execution.h>
Expand Down
2 changes: 1 addition & 1 deletion include/cloysterhpc/services/xcat.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <cloysterhpc/services/provisioner.h>
#include <cloysterhpc/services/shell.h>

#include <magic_enum.hpp>
#include <magic_enum/magic_enum.hpp>

#include <filesystem>
#include <memory>
Expand Down
63 changes: 40 additions & 23 deletions setupDevEnvironment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,40 @@ redhat() {
sudo subscription-manager refresh
fi

dnf config-manager --set-enabled \
"codeready-builder-for-rhel-${os_version}-x86_64-rpms"
if [ "$os_version" -eq 10 ]; then
dnf config-manager --set-enabled \
"codeready-builder-beta-for-rhel-${os_version}-x86_64-rpms"
else
dnf config-manager --set-enabled \
"codeready-builder-for-rhel-${os_version}-x86_64-rpms"
fi

add_epel;
}

rocky() {
if [ "$os_version" = "8" ]; then
repo_name="powertools"
elif [ "$os_version" = "9" ]; then
repo_name="crb"
fi
case "$os_version" in
8)
repo_name="powertools"
;;
9|10)
repo_name="crb"
;;
esac

dnf config-manager --set-enabled "$repo_name"
dnf -y install epel-release
}

almalinux() {
if [ "$os_version" = "8" ]; then
repo_name="powertools"
elif [ "$os_version" = "9" ]; then
repo_name="crb"
fi
case "$os_version" in
8)
repo_name="powertools"
;;
9|10)
repo_name="crb"
;;
esac

dnf config-manager --set-enabled "$repo_name"
dnf -y install epel-release
Expand Down Expand Up @@ -101,17 +113,22 @@ case $(cut -f 3 -d : /etc/system-release-cpe) in
esac

# Build toolset, packages and utils
dnf -y install rsync git gcc-c++ gdb ninja-build cmake ccache cppcheck

if [ "$os_version" = "8" ]; then
dnf -y install python3 python3-pip\* llvm-toolset compiler-rt \
gcc-toolset-14 gcc-toolset-14-libubsan-devel gcc-toolset-14-libasan-devel \
lldb
elif [ "$os_version" = "9" ]; then
dnf -y install python pip libasan libubsan gcc-toolset-14 \
gcc-toolset-14-libubsan-devel gcc-toolset-14-libasan-devel llvm-toolset \
compiler-rt lldb
fi
dnf -y install rsync git gcc-c++ gdb cmake ccache ninja-build llvm-toolset \
lldb compiler-rt

case "$os_version" in
8)
dnf -y install python3 python3-pip\* gcc-toolset-14 \
gcc-toolset-14-libubsan-devel gcc-toolset-14-libasan-devel cppcheck
;;
9)
dnf -y install python pip libasan libubsan gcc-toolset-14 \
gcc-toolset-14-libubsan-devel gcc-toolset-14-libasan-devel cppcheck
;;
10)
dnf -y install python pip libubsan libasan liblsan libtsan libhwasan
;;
esac

# Install Conan as user
pip3 install --user conan
Expand Down
2 changes: 1 addition & 1 deletion src/answerfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <cloysterhpc/services/log.h>
#include <cloysterhpc/tools/nvhpc.h>
#include <iterator>
#include <magic_enum.hpp>
#include <magic_enum/magic_enum.hpp>
#include <ranges>

AnswerFile::AnswerFile(const std::filesystem::path& path)
Expand Down
20 changes: 9 additions & 11 deletions src/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <cloysterhpc/os.h>
#include <cloysterhpc/services/dnf.h>
#include <cloysterhpc/services/package_manager.h>
#include <magic_enum.hpp>
#include <magic_enum/magic_enum.hpp>

#ifndef NDEBUG
#include <cloysterhpc/services/log.h>
Expand Down Expand Up @@ -187,10 +187,6 @@ unsigned int OS::getMinorVersion() const { return m_minorVersion; }

void OS::setMinorVersion(unsigned int minorVersion)
{
if (minorVersion < 1)
throw std::runtime_error(
"Unsupported release: Minor version must be 1 or greater.");

m_minorVersion = minorVersion;
}

Expand Down Expand Up @@ -242,13 +238,15 @@ std::string OS::getValueFromKey(const std::string& line)
std::shared_ptr<package_manager> OS::factoryPackageManager(
OS::Platform platform)
{
if (platform == OS::Platform::el8 || platform == OS::Platform::el9) {
m_packageManager = std::make_shared<dnf>();
return m_packageManager;
} else {
throw std::runtime_error(fmt::format(
"Unsupported OS platform: {}", magic_enum::enum_name(platform)));
for (const auto& supportedPlatform : magic_enum::enum_values<Platform>()) {
if (platform == supportedPlatform) {
m_packageManager = std::make_shared<dnf>();
return m_packageManager;
}
}

throw std::runtime_error(fmt::format(
"Unsupported OS platform: {}", magic_enum::enum_name(platform)));
}

gsl::not_null<package_manager*> OS::packageManager() const
Expand Down
Loading
Loading