Guix is a functional package manager and configuration management system for the GNU operating system. It enables the reproducible installation and management of software through immutable packages and declarative configuration descriptions.
Freedom for the user:
- to add software to the store
- to create their own profile from elements in the store
- to build a personalised version of software
What does Guix allow?
- Create your own environments in a highly flexible manner without the assistance of cluster administrators (i.e., without being root).
- Create different working contexts (profiles).
- Have a ‘recipe’ for your software, in order to share, install, and use your own library.
Getting started (each session)
source /opt/ohpc/pub/guix-start.sh
Updating the Guix repository
guix pull
Package management
Lister les paquets installés
guix package -I
Search for packages
https://packages.guix.gnu.org/ allows you to search for packages, as command-line searches are very verbose.
Command line search
guix search emacs -> faire une recherche d'emacs
Enter ‘q’ to exit the display.
Installation / Uninstallation
guix remove packet_name -> Remove packet guix install packet_name -> install guix install emacs python@3 python-tensorly -> install emacs python in version 3… which python3 -> To view where python3 is ~/.guix-profile/bin/python3
The common “store”
The following commands show that the installed programs do not clutter up your directory but are located in /gnu/store common to all! Installing a user can be very quick if another user has already done the installation. Only Unix links are created! What’s more, this means you don’t have to install the programme several times.
ls -l ~/.guix-profile/bin/python3 lrwxrwxrwx 1 root root 69 Jan 1 1970 ~/.guix-profile/bin/python3 -> /gnu/store/8s8k2v6b5b7lyf5y5n534cjd9sipgas6-python-3.10.7/bin/python3 ->
Profiles
Installing packages in a profile
Let’s install gcc version 8 and lapack in the profile named gcc8lapack
guix install -p $GUIX_USER_PROFILE_DIR/gcc8lapack gcc-toolchain@8 lapack -> Install softs in gcc8lapack profile guix package -p $GUIX_USER_PROFILE_DIR/gcc8lapack -I -> list profile's softs
Add vim to the profile
guix install -p $GUIX_USER_PROFILE_DIR/gcc8lapack vim guix package -p $GUIX_USER_PROFILE_DIR/gcc8lapack -I -> List the contents of the profile
Managing profiles
The list of profiles
guix package --list-profiles
Go to a profile
guix shell -p $GUIX_USER_PROFILE_DIR/"gcc8lapack" gcc --version -> gcc (GCC) 8.5.0 exit gcc --version -> System gcc version
Generations management
guix package --list-generations -> Lists the successive "generations"/stages of the guix environment. guix package --roll-back -> Returns to the previous generation. guix package --switch-generation=42 -> switch to gen 42 guix gc --delete-generations -> delete backuped's generations guix package -p $GUIX_USER_PROFILE_DIR/"gcc8lapack" --list-generations -> Lists the "generations" of the gcc8lapack profile.
Channels
Edit ~/.config/guix/channels.scm file to add some channels. Example :
(append
(list (channel
(name 'guix-hpc)
(url "https://gitlab.inria.fr/guix-hpc/guix-hpc.git")
(branch "master")))
%default-channels)
HPC and Guix
This article is an introduction, an invitation to experiment with guix. Numerous possibilities for exploiting HPC/slurm exist but have yet to be documented. This requires time that will be mobilised when we have users who want to try it out: they are welcome!