NIX usage on HPC clusters
GriCAD feedback
Pierre-Antoine Bouttier
Workshop Software deployement for HPC - 05/31/2018
Nix overview
Nix concepts
Nix In Real Life (on our clusters)
Nix, the package manager
Nixpgs, the main package repository
NixOS exists
Package definition
A package is described in an functional language (Haskell-like)
{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "cutee";
version = "0.4.2";
name = "${pname}-${version}";
src = fetchurl {
url = "http://www.codesink.org/download/${pname}-${version}.tar.gz";
sha256 = "18bzvhzx8k24mpcim5669n3wg9hd0sfsxj8zjpbr24hywrlppgc2";
};
buildFlags = "cutee";
installPhase = ''
mkdir -p $out/bin
cp cutee $out/bin
'';
meta = with stdenv.lib; {
description = "C++ Unit Testing Easy Environment";
homepage = http://www.codesink.org/cutee_unit_testing.html;
license = licenses.gpl2Plus;
maintainers = with maintainers; [ leenaars];
platforms = platforms.linux;
};
}
Packages storage in one directory
=> Independant from the system
/nix/store
/nix/store/an9dli66ng2jzvqf13b2i230mm9fq7qk-cdo-1.7.2
# Hash = mix(sources + deps + flags, ...)
# Compilation + nouvelle option → nouveau hash
/nix/store/srf6grrfy9vkc9fsplk8xk292lm8jvz5-cdo-1.7.2
Packages identification through Hash;
Package construction = One sub-directory
=> Dependancies tree conserved
=> packages unicity
Profiles (1/3)
export PATH=~/.nix-profile/bin:$PATH
Profiles (2/3)
Profiles (3/3)
Channels
Binary-cache
nix-env -i -A nixpkgs-unstable.openmpi
nix-env -i -A ciment-channel.openmpi
HPC cluster
A set of interconnected Linux computing nodes and one or several head nodes sharing some common network filesystems
The /nix store
# fstab entry for NIX
head1:/home/nix /nix nfs defaults 0 0
Nix installation on the cluster - Main steps
Multi-user profile script
source /applis/site/nix.sh
The CIMENT channel
Shared binary cache
Our workflow
Pros
Cons