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

Add capability to utilize a custom repository file #53

Merged
merged 7 commits into from
Jun 18, 2024
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
106 changes: 106 additions & 0 deletions cloyster.repo.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Example repofile model to use with Cloyster.

[cloyster-OL-BaseOS]
name=Oracle Linux 8 BaseOS Latest ($basearch)
baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL9/baseos/latest/$basearch/
enabled=0
gpgcheck=1
gpgkey=https://yum.oracle.com/RPM-GPG-KEY-oracle-ol9

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

[cloyster-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-9

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

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

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

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

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

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

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

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

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

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

[cloyster-openhpc]
name=OpenHPC
baseurl=https://mirror.versatushpc.com.br/openhpc/3/EL_9/
enabled=1
gpgcheck=1
gpgkey=https://obs.openhpc.community/projects/OpenHPC3/public_key

[cloyster-openhpc-updates]
name=OpenHPC Updates
baseurl=https://mirror.versatushpc.com.br/openhpc/3/updates/EL_9/
enabled=1
gpgcheck=1
gpgkey=https://obs.openhpc.community/projects/OpenHPC3/public_key
1 change: 1 addition & 0 deletions include/cloysterhpc/cloyster.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ bool runAsDaemon = false;
std::string logLevelInput
= fmt::format("{}", magic_enum::enum_name(Log::Level::Info));
std::string answerfile;
std::string customRepofilePath;
}

#endif // CLOYSTERHPC_CLOYSTER_H_
3 changes: 3 additions & 0 deletions include/cloysterhpc/inifile.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ class inifile {
void loadFile(const std::string& filepath);
void loadFile(std::string_view filepath);
void loadFile(const std::filesystem::path& filepath);
void loadData(const std::string& data);
std::string getValue(const std::string& section, const std::string& key,
const bool optional = true, const bool canBeNull = true);
void setValue(const std::string& section, const std::string& key,
const std::string& newValue);
bool deleteValue(const std::string& section, const std::string& key);
void save(std::string& holder) const;
void saveFile(const std::string& filepath);
void saveFile(std::string_view filepath);
void saveFile(const std::filesystem::path& filepath);
bool exists(const std::string& section, const std::string& key);
bool exists(const std::string& section);
inifile(const std::string& file);
inifile();
};

Expand Down
42 changes: 33 additions & 9 deletions include/cloysterhpc/repos.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
#ifndef CLOYSTERHPC_REPOS_H_
#define CLOYSTERHPC_REPOS_H_

#include "inifile.h"
#include <cloysterhpc/os.h>
#include <string>
#include <cloysterhpc/repos/repoimport.h>

namespace cloyster {
extern std::string customRepofilePath;
};

struct repofile {
std::string id;
Expand All @@ -34,20 +38,40 @@ struct repofile {
};

class Repos {
public:
enum class AdditionalType {
beegfs,
ELRepo,
EPEL,
Grafana,
influxData,
oneAPI,
OpenHPC,
Zabbix,
RPMFusionUpdates
};

private:
void configureRHEL() const;
void configureRocky() const;
void configureOL() const;
void configureAlma() const;
void configureEL() const;
void configureEL8() const;
void configureEL9() const;
void configureXCAT() const;
void configureAdditionalRepos(const std::vector<AdditionalType>& additional) const;
void createGPGKeyFile(const std::string& filename, const std::string& key) const;
void createGPGKeyFile(const std::filesystem::path& path, const std::string& key)const;
void configureAdditionalRepos(
const std::vector<AdditionalType>& additional) const;
void createGPGKeyFile(
const std::string& filename, const std::string& key) const;
void createGPGKeyFile(
const std::filesystem::path& path, const std::string& key) const;
void createGPGKeyFile(const repofile& repo) const;
void createCloysterRepo() const;
OS m_os;
Family m_family;

inifile CLOYSTER_REPO_EL8 {
#include "cloysterhpc/repos/el8/cloyster.repo"
};
inifile CLOYSTER_REPO_EL9 = {
#include "cloysterhpc/repos/el9/cloyster.repo"
};

public:
explicit Repos(const OS& osinfo);
Expand Down
30 changes: 15 additions & 15 deletions include/cloysterhpc/repos/el8/cloyster.repo
Original file line number Diff line number Diff line change
Expand Up @@ -3,104 +3,104 @@ name=Oracle Linux 8 BaseOS Latest ($basearch)
baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL8/baseos/latest/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgkey=https://yum.oracle.com/RPM-GPG-KEY-oracle-ol8

[cloyster-Rocky-BaseOS]
name=Rocky Linux $releasever - BaseOS
baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
gpgkey=https://mirror.versatushpc.com.br/rocky/linux/RPM-GPG-KEY-Rocky-8

[cloyster-AlmaLinux-BaseOS]
name=AlmaLinux $releasever - BaseOS
baseurl=https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
gpgkey=https://mirror.versatushpc.com.br/almalinux/almalinux/RPM-GPG-KEY-AlmaLinux-8

[cloyster-beegfs]
name=BeeGFS
baseurl=https://mirror.versatushpc.com.br/beegfs/beegfs_7.3.3/dists/rhel8/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-beegfs
gpgkey=https://mirror.versatushpc.com.br/beegfs/beegfs_7.3.3/gpg/GPG-KEY-beegfs

[cloyster-grafana]
name=grafana
baseurl=https://mirror.versatushpc.com.br/grafana/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-grafana
gpgkey=https://rpm.grafana.com/gpg.key

[cloyster-influxdata]
name=InfluxData Repository - Stable
baseurl=https://mirror.versatushpc.com.br/influxdata/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-influxdata
gpgkey=https://repos.influxdata.com/influxdata-archive_compat.key

[cloyster-oneAPI]
name=Intel oneAPI repository
baseurl=https://mirror.versatushpc.com.br/oneAPI/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oneapi
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB

[cloyster-zabbix]
name=zabbix
baseurl=https://mirror.versatushpc.com.br/zabbix/zabbix/6.4/rhel/8/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-zabbix
gpgkey=https://mirror.versatushpc.com.br/zabbix/RPM-GPG-KEY-ZABBIX

[cloyster-elrepo]
name=elrepo
baseurl=https://mirror.versatushpc.com.br/elrepo/elrepo/el8/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo
gpgkey=https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

[cloyster-rpmfusion-free-updates]
name=rpmfusion-free-updates
baseurl=https://mirror.versatushpc.com.br/rpmfusion/free/el/updates/8/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-updates
gpgkey=https://mirror.versatushpc.com.br/rpmfusion/free/el/RPM-GPG-KEY-rpmfusion-free-el-8

[cloyster-epel]
name=Extra Packages for Enterprise Linux 8 - $basearch
baseurl=https://mirror.versatushpc.com.br/epel/8/Everything/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-epel
gpgkey=https://mirror.versatushpc.com.br/epel/RPM-GPG-KEY-EPEL-8

[cloyster-epel-debuginfo]
name=Extra Packages for Enterprise Linux 8 - $basearch - Debug
baseurl=https://mirror.versatushpc.com.br/epel/8/Everything/x86_64/debug/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-epel
gpgkey=https://mirror.versatushpc.com.br/epel/RPM-GPG-KEY-EPEL-8

[cloyster-epel-source]
name=Extra Packages for Enterprise Linux 8 - $basearch - Source
baseurl=https://mirror.versatushpc.com.br/epel/8/Everything/source/tree/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-epel
gpgkey=https://mirror.versatushpc.com.br/epel/RPM-GPG-KEY-EPEL-8

[cloyster-openhpc]
name=OpenHPC
baseurl=https://mirror.versatushpc.com.br/openhpc/2/EL_8/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-openhpc
gpgkey=https://obs.openhpc.community/projects/OpenHPC/public_key

[cloyster-openhpc-updates]
name=OpenHPC Updates
baseurl=https://mirror.versatushpc.com.br/openhpc/2/updates/EL_8/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-openhpc
gpgkey=https://obs.openhpc.community/projects/OpenHPC/public_key

)"
Loading
Loading