diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2018-02-10 22:48:22 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2018-02-10 22:48:22 +0100 |
commit | 968b866dccf197ccf3a5153ec120fc9424f2f6ec (patch) | |
tree | 7a6546b7254f37a95c2d11048ac290cff72d1b81 /nixos | |
parent | 0db25ddac50a3942f9a22e57edbda94e8bff98dc (diff) | |
parent | 85ca8f121bdeab205658aa8e4f4b1932a8d4dc4f (diff) | |
download | nixlib-968b866dccf197ccf3a5153ec120fc9424f2f6ec.tar nixlib-968b866dccf197ccf3a5153ec120fc9424f2f6ec.tar.gz nixlib-968b866dccf197ccf3a5153ec120fc9424f2f6ec.tar.bz2 nixlib-968b866dccf197ccf3a5153ec120fc9424f2f6ec.tar.lz nixlib-968b866dccf197ccf3a5153ec120fc9424f2f6ec.tar.xz nixlib-968b866dccf197ccf3a5153ec120fc9424f2f6ec.tar.zst nixlib-968b866dccf197ccf3a5153ec120fc9424f2f6ec.zip |
Merge #32774: slurm-spank-x11: init at 0.2.5
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/computing/slurm/slurm.nix | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/nixos/modules/services/computing/slurm/slurm.nix b/nixos/modules/services/computing/slurm/slurm.nix index fb91a29a4000..45d34f5b76f5 100644 --- a/nixos/modules/services/computing/slurm/slurm.nix +++ b/nixos/modules/services/computing/slurm/slurm.nix @@ -6,14 +6,20 @@ let cfg = config.services.slurm; # configuration file can be generated by http://slurm.schedmd.com/configurator.html - configFile = pkgs.writeText "slurm.conf" + configFile = pkgs.writeText "slurm.conf" '' ${optionalString (cfg.controlMachine != null) ''controlMachine=${cfg.controlMachine}''} ${optionalString (cfg.controlAddr != null) ''controlAddr=${cfg.controlAddr}''} ${optionalString (cfg.nodeName != null) ''nodeName=${cfg.nodeName}''} ${optionalString (cfg.partitionName != null) ''partitionName=${cfg.partitionName}''} + PlugStackConfig=${plugStackConfig} ${cfg.extraConfig} ''; + + plugStackConfig = pkgs.writeText "plugstack.conf" + '' + ${optionalString cfg.enableSrunX11 ''optional ${pkgs.slurm-spank-x11}/lib/x11.so''} + ''; in { @@ -28,7 +34,7 @@ in enable = mkEnableOption "slurm control daemon"; }; - + client = { enable = mkEnableOption "slurm rlient daemon"; @@ -86,8 +92,19 @@ in ''; }; + enableSrunX11 = mkOption { + default = false; + type = types.bool; + description = '' + If enabled srun will accept the option "--x11" to allow for X11 forwarding + from within an interactive session or a batch job. This activates the + slurm-spank-x11 module. Note that this requires 'services.openssh.forwardX11' + to be enabled on the compute nodes. + ''; + }; + extraConfig = mkOption { - default = ""; + default = ""; type = types.lines; description = '' Extra configuration options that will be added verbatim at @@ -134,7 +151,8 @@ in environment.systemPackages = [ wrappedSlurm ]; systemd.services.slurmd = mkIf (cfg.client.enable) { - path = with pkgs; [ wrappedSlurm coreutils ]; + path = with pkgs; [ wrappedSlurm coreutils ] + ++ lib.optional cfg.enableSrunX11 slurm-spank-x11; wantedBy = [ "multi-user.target" ]; after = [ "systemd-tmpfiles-clean.service" ]; @@ -152,8 +170,9 @@ in }; systemd.services.slurmctld = mkIf (cfg.server.enable) { - path = with pkgs; [ wrappedSlurm munge coreutils ]; - + path = with pkgs; [ wrappedSlurm munge coreutils ] + ++ lib.optional cfg.enableSrunX11 slurm-spank-x11; + wantedBy = [ "multi-user.target" ]; after = [ "network.target" "munged.service" ]; requires = [ "munged.service" ]; |