about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authormarkuskowa <markus.kowalewski@gmail.com>2018-12-11 00:45:47 +0100
committerGitHub <noreply@github.com>2018-12-11 00:45:47 +0100
commit9fba490258e127b533c342562f008fb07f0fa960 (patch)
tree46fdac5cb9f63ae06cd2d3874cb6c64a91ac48b7 /nixos
parent86344b3a52b1f91f497ee171a6f7263552536fc4 (diff)
parent8eee1ec2a9f0925bcf9589b330faacd0255ae700 (diff)
downloadnixlib-9fba490258e127b533c342562f008fb07f0fa960.tar
nixlib-9fba490258e127b533c342562f008fb07f0fa960.tar.gz
nixlib-9fba490258e127b533c342562f008fb07f0fa960.tar.bz2
nixlib-9fba490258e127b533c342562f008fb07f0fa960.tar.lz
nixlib-9fba490258e127b533c342562f008fb07f0fa960.tar.xz
nixlib-9fba490258e127b533c342562f008fb07f0fa960.tar.zst
nixlib-9fba490258e127b533c342562f008fb07f0fa960.zip
Merge pull request #50862 from markuskowa/fix-slurm-module
 nixos/slurm: set slurmd KillMode and add extraConfigPaths
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/computing/slurm/slurm.nix14
-rw-r--r--nixos/tests/slurm.nix7
2 files changed, 20 insertions, 1 deletions
diff --git a/nixos/modules/services/computing/slurm/slurm.nix b/nixos/modules/services/computing/slurm/slurm.nix
index cd481212db2d..d1a1383e45b0 100644
--- a/nixos/modules/services/computing/slurm/slurm.nix
+++ b/nixos/modules/services/computing/slurm/slurm.nix
@@ -46,7 +46,7 @@ let
   # in the same directory as slurm.conf
   etcSlurm = pkgs.symlinkJoin {
     name = "etc-slurm";
-    paths = [ configFile cgroupConfig plugStackConfig ];
+    paths = [ configFile cgroupConfig plugStackConfig ] ++ cfg.extraConfigPaths;
   };
 
 in
@@ -239,6 +239,17 @@ in
         '';
       };
 
+      extraConfigPaths = mkOption {
+        type = with types; listOf path;
+        default = [];
+        description = ''
+          Slurm expects config files for plugins in the same path
+          as <literal>slurm.conf</literal>. Add extra nix store
+          paths that should be merged into same directory as
+          <literal>slurm.conf</literal>.
+        '';
+      };
+
 
     };
 
@@ -303,6 +314,7 @@ in
 
       serviceConfig = {
         Type = "forking";
+        KillMode = "process";
         ExecStart = "${wrappedSlurm}/bin/slurmd";
         PIDFile = "/run/slurmd.pid";
         ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
diff --git a/nixos/tests/slurm.nix b/nixos/tests/slurm.nix
index 7f9c266cbff6..b4458d8d0954 100644
--- a/nixos/tests/slurm.nix
+++ b/nixos/tests/slurm.nix
@@ -63,6 +63,12 @@ in {
             ensurePermissions = { "slurm_acct_db.*" = "ALL PRIVILEGES"; };
             name = "slurm";
           }];
+          extraOptions = ''
+            # recommendations from: https://slurm.schedmd.com/accounting.html#mysql-configuration
+            innodb_buffer_pool_size=1024M
+            innodb_log_file_size=64M
+            innodb_lock_wait_timeout=900
+          '';
         };
       };
 
@@ -95,6 +101,7 @@ in {
   subtest "can_start_slurmdbd", sub {
     $dbd->succeed("systemctl restart slurmdbd");
     $dbd->waitForUnit("slurmdbd.service");
+    $dbd->waitForOpenPort(6819);
   };
 
   # there needs to be an entry for the current