@@ -27,32 +27,6 @@ gpgkey=https://linux.mellanox.com/public/repo/doca/{0}/{1}/{2}/GPG-KEY-Mellanox.
2727 return data;
2828}
2929
30- // Return distro to match repositories at
31- // https://linux.mellanox.com/public/repo/doca/latest/
32- std::string headnodeDistroName ()
33- {
34- using cloyster::models::Cluster;
35- auto cluster = cloyster::Singleton<Cluster>::get ();
36- switch (cluster->getHeadnode ().getOS ().getDistro ()) {
37- // Assuming we'll be using the last distro version
38- case cloyster::OS::Distro::RHEL:
39- return " rhel9.5" ;
40- case cloyster::OS::Distro::OL:
41- return " ol9.4" ;
42- case cloyster::OS::Distro::Rocky:
43- return " rockylinux9.2" ;
44- case cloyster::OS::Distro::AlmaLinux:
45- return " alinux3.2" ;
46- default :
47- std::unreachable ();
48- };
49-
50- std::unreachable ();
51- }
52-
53- void installMellanoxDoca (const OFED& ofed)
54- {
55- }
5630};
5731
5832void OFED::setKind (Kind kind) { m_kind = kind; }
@@ -99,12 +73,23 @@ void OFED::install() const
9973 case OFED::Kind::Mellanox:
10074 {
10175 auto cluster = cloyster::Singleton<cloyster::models::Cluster>::get ();
76+ auto hnOs = cluster->getHeadnode ().getOS ();
10277 auto runner = cloyster::Singleton<cloyster::services::BaseRunner>::get ();
10378 auto repoManager = cloyster::Singleton<cloyster::services::repos::RepoManager>::get ();
79+ // distroName denotes a folder in the remote repository:
80+ // https://linux.mellanox.com/public/repo/doca/latest/. All
81+ // distributions except Oracle Linux use rhelX.Y folder. Oracle
82+ // Linux does not uses rhelX.Y package because it uses a distinct
83+ // kernel
84+ auto distroName = fmt::format (
85+ " {}{}" ,
86+ (hnOs.getDistro () == cloyster::OS::Distro::OL ? " ol" : " rhel" ),
87+ hnOs.getVersion ());
10488
10589 auto repoData = docaRepoTemplate (
106- getVersion (), headnodeDistroName (),
107- cloyster::utils::enumToString (cluster->getHeadnode ().getOS ().getArch ()));
90+ getVersion (),
91+ distroName,
92+ cloyster::utils::enumToString (hnOs.getArch ()));
10893 std::filesystem::path path = " /etc/yum.repos.d/mlx-doca.repo" ;
10994
11095 // Install the repository and enable it
@@ -126,20 +111,21 @@ void OFED::install() const
126111 // The driver may support weak updates modules and load without
127112 // need for reboot.
128113 if (cloyster::getEnvironmentVariable (" CATTUS_SKIP_INFINIBAND_COMPILE_DOCA_DRIVER" ) != " 1" ) {
129- runner->checkCommand (" bash -c \" /opt/mellanox/doca/tools/doca-kernel-support -k $(rpm -q --qf \" %{VERSION}-%{RELEASE}.%{ARCH}\n\" kernel-devel)\" " );
114+ runner->checkCommand (
115+ " bash -c \" /opt/mellanox/doca/tools/doca-kernel-support -k "
116+ " $(rpm -q --qf \" %{VERSION}-%{RELEASE}.%{ARCH}\n\" kernel-devel)\" " );
130117 }
131118
132119 // Get the last rpm in /tmp/DOCA*/ folder
133120 auto rpm = runner->checkOutput (" bash -c \" find /tmp/DOCA*/ -name '*.rpm' -printf '%T@ %p\n ' | sort -nk1 | tail -1 | awk '{print $2}'\" " );
134121 assert (rpm.size () > 0 ); // at last one line
135122
136123 // Install the (last) generated rpm
137- runner->executeCommand (fmt::format (" rpm -vih {}" , rpm[0 ]));
124+ runner->executeCommand (fmt::format (" dnf install -y {}" , rpm[0 ]));
138125
139126 runner->checkCommand (" dnf makecache" );
140- // @NOTE: Are these packages correct/good default?
141127 runner->checkCommand (" dnf install -y doca-ofed mlnx-fw-updater" );
142- runner->checkCommand (" modprobe mlx5_core " );
128+ runner->checkCommand (" systemctl restart openibd " );
143129 }
144130 break ;
145131
0 commit comments