Upgrade CentOS 7 to Alma 8 While Keeping SingularityCE Updated

By Staff

Nov 2, 2023 | News

Overview

On June 30th, 2024, CentOS 7 will reach end of life. Red Hat has already discontinued CentOS 8, replacing it with CentOS Stream. Going forward, organizations currently on either operating system should plan to transition to alternative open-source options such as Red Hat Enterprise Linux 8, AlmaLinux, or Rocky Linux.
AlmaLinux is an ideal option for HPC environments because it offers proven stability along with assured long-term support. This blog post will guide you through the process of migrating to the AlmaLinux 8 distribution. We will use Alma’s Elevate tool to ensure a smooth transition, and also make sure that SingularityCE is properly updated with the corresponding package.

Step 1: Patch and Update

In CentOS 7, make sure you have installed the latest SingularityCE version and updated it with the most recent patches. If you need to install SingularityCE, please read this blog post which includes detailed instructions.

To install the latest patches, run the following command:

$ sudo yum update
Once the update has finished, verify the CentOS and SingularityCE versions:
$ source /etc/os-release && echo $PRETTY_NAME
CentOS Linux 7 (Core)
$ singularity --version
singularity-ce version 3.11.5-1.el7
Note that the last characters of SingularityCE version line correspond to the current operating system version, so they should indicate “el7” for Enterprise Linux 7.

Step 2: Install the Elevate Repository

To enable the Alma ELevate migration tool, let’s enable the Elevate repository by running the following command:
$ sudo yum install -y \ http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm

Step 3: Install Leapp Utility

Leapp is a helper utility that assists with the migration of any previous version of Red Hat Enterprise Linux distribution to version 8. To migrate from CentOS 7 to AlmaLinux 8, install the following packages:
$ sudo yum install -y leapp-upgrade leapp-data-almalinux yum-utils

Step 4: Migrate to AlmaLinux 8

Once the leapp utility is installed, run a pre-flight upgrade by issuing the following command:
$ sudo leapp upgrade
The utility will assess if the system is ready. In our experience, CentOS 7 needs some additional adjustments to the system for a seamless migration procedure; failure to make these adjustments may lead to an unstable system.
For example, if you have multiple Kernels installed, or if the latest installed kernel does not correspond to the current one, you need to reboot the system and then clean up old kernels.
$ sudo package-cleanup --oldkernels --count=1
You can fix other issues by running the following command (note that you can revert them back after the upgrade, if needed):
$ sudo echo PermitRootLogin yes | sudo tee -a /etc/ssh/sshd_config
Next, the following command will remove the pam_pkcs11 module in the PAM configuration:
$ sudo leapp answer --section remove_pam_pkcs11_module_check.confirm=True

After fixing all the issues, we can return to the migration process:

$ sudo leapp upgrade
The process will inevitably take time, varying based on your system’s resource configuration:
Once the process finishes, reboot the system.
$ reboot
Once the system is booting up, you will see a new entry on the GRUB menu. Select “Elevate-Upgrade-Initramfs” and press Enter. This will install the remaining packages and will reconfigure your system. You can expect more reboots during this step.
Once the upgrade is complete, you may see a login screen. Type a username and password to log in. To confirm the update is complete, we need to a look at the operating system and SingularityCE version:
$ source /etc/os-release && echo $PRETTY_NAME
AlmaLinux 8.8 (Sapphire Caracal)
$ singularity --version
Singularity-ce version 3.11.5-1.el7

Step 5: Update the SingularityCE Package

Although SingularityCE 3.11 is verified, the “el7” package is still installed. To install the proper package for your operating system, upgrade the SingularityCE package with the following command:
$ sudo yum update -y singularity-ce
$ singularity --version
singularity-ce version 3.11.5-1.el8
Now we have the latest and a fully functional AlmaLinux 8 operating system with the corresponding SingularityCE package.

Conclusion

Migrating from CentOS 7 to AlmaLinux 8 is crucial for organizations seeking a reliable and secure open-source alternative. AlmaLinux 8 promises long-term stability and support, making it a sound choice for your HPC infrastructure. Proper planning and a clear understanding of the migration process and resources can make this transition smooth and beneficial, ensuring your systems remain updated and secure. With awareness of the essential steps and important considerations above, you can ensure a successful transition.
If you are new to Singularity containers or need a refresher on them, be sure to check out our Singularity Container 101 course.
For a deeper dive into SingularityCE 4.0, please see our latest SingularityCE documentation.

Join Our Mailing List

Related Posts

OCI Basics using Singularity Enterprise Registry

Overview Singularity Enterprise comes with a fully compliant Open Container Initiative (OCI) registry. The following is a collection of typical registry operations within your workflow. Assuming the Singularity Enterprise registry address is registry.sylabs.io, please...

read more