From bc62e28ca3f73e23c5c8313a970a96fbbf5c4ea4 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Sun, 17 Sep 2023 22:27:51 +0200 Subject: [PATCH 1/3] Enable direnv integration --- m/common/main.nix | 2 ++ m/common/zsh.nix | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/m/common/main.nix b/m/common/main.nix index 025a7c5..999f043 100644 --- a/m/common/main.nix +++ b/m/common/main.nix @@ -45,6 +45,8 @@ bsc.osumb ]; + programs.direnv.enable = true; + systemd.services."serial-getty@ttyS0" = { enable = true; wantedBy = [ "getty.target" ]; diff --git a/m/common/zsh.nix b/m/common/zsh.nix index 666e34b..5cfcb7f 100644 --- a/m/common/zsh.nix +++ b/m/common/zsh.nix @@ -2,7 +2,6 @@ { environment.systemPackages = with pkgs; [ - direnv zsh-completions nix-zsh-completions ]; -- GitLab From 8de3d2b149dff53de62aa8bca40d4b99718abb53 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 20 Sep 2023 18:26:48 +0200 Subject: [PATCH 2/3] Mount the hut nix store for SLURM jobs --- m/module/slurm-hut-nix-store.nix | 19 +++++++++++++++++++ m/owl1/configuration.nix | 1 + m/owl2/configuration.nix | 1 + 3 files changed, 21 insertions(+) create mode 100644 m/module/slurm-hut-nix-store.nix diff --git a/m/module/slurm-hut-nix-store.nix b/m/module/slurm-hut-nix-store.nix new file mode 100644 index 0000000..2ec8e2f --- /dev/null +++ b/m/module/slurm-hut-nix-store.nix @@ -0,0 +1,19 @@ +{ ... }: + +{ + # Mount the hut nix store via NFS + fileSystems."/mnt/hut-nix-store" = { + device = "hut:/nix/store"; + fsType = "nfs"; + options = [ "ro" ]; + }; + + systemd.services.slurmd.serviceConfig = { + # When running a job, bind the hut store in /nix/store so the paths are + # available too. + # FIXME: This doesn't keep the programs in /run/current-system/sw/bin + # available in the store. Ideally they should be merged but the overlay FS + # doesn't work when the underlying directories change. + BindReadOnlyPaths = "/mnt/hut-nix-store:/nix/store"; + }; +} diff --git a/m/owl1/configuration.nix b/m/owl1/configuration.nix index 5afda72..d21ccfd 100644 --- a/m/owl1/configuration.nix +++ b/m/owl1/configuration.nix @@ -5,6 +5,7 @@ ../common/main.nix ../module/ceph.nix ../module/slurm-firewall.nix + ../module/slurm-hut-nix-store.nix ]; # Select the this using the ID to avoid mismatches diff --git a/m/owl2/configuration.nix b/m/owl2/configuration.nix index 9636760..5fdabbe 100644 --- a/m/owl2/configuration.nix +++ b/m/owl2/configuration.nix @@ -5,6 +5,7 @@ ../common/main.nix ../module/ceph.nix ../module/slurm-firewall.nix + ../module/slurm-hut-nix-store.nix ]; # Select the this using the ID to avoid mismatches -- GitLab From 9ee71114537023d0cb2edfe895b71e3cff644026 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Thu, 21 Sep 2023 13:51:42 +0200 Subject: [PATCH 3/3] Document the hut shared nix store for SLURM --- web/content/owl/_index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/content/owl/_index.md b/web/content/owl/_index.md index d6fbb1b..a994329 100644 --- a/web/content/owl/_index.md +++ b/web/content/owl/_index.md @@ -8,3 +8,11 @@ description: "Low system noise" Much like the silent flight of an owl at night, these nodes are configured to minimize the system noise and let programs run undisturbed. The list of nodes is `owl[1-2]` and are available for jobs with SLURM. + +The contents of the nix store of the hut node is made available in the owl nodes +when a job is running. This allows jobs to access the same paths that are on hut +to load dependencies. + +For now, only the hut node can be used to build new derivations so that they +appear in the compute nodes. This applies to the `nix build`, `nix develop` and +`nix shell` commands. -- GitLab