Ported/merged properties from the TUD configuration's hydra-module
[?]
Mar 22, 2013, 12:58 PM
ZYEFL36QOB6KUR276RRT4PSAK7HWUJ6TLLZBEZM7SSGUX2WQTMZQCDependencies
- [2]
J3G4ZLOKhydra-module: Fix typo. - [3]
3FTM52B2hydra-module: Always GC to have at least 100 GiB available. - [4]
3PNG7NIBRemove trailing whitespace - [5]
QQU7AL7Ihydra-module.nix: Remove `.pl' extension for binaries. - [6]
INUGMXTGhydra-module: Add a `port' option. - [7]
WXW2GAJY_ -> - - [8]
D3MDJONY - [9]
ZVGQP2SXhydra-module: Add a `logo' option.
Change contents
- replacement in hydra-module.nix at line 16[4.355]→[5.276:451](∅→∅),[5.276]→[5.276:451](∅→∅),[5.451]→[5.0:47](∅→∅),[5.47]→[2.0:91](∅→∅),[5.47]→[5.451:498](∅→∅),[2.91]→[5.451:498](∅→∅),[5.94]→[5.451:498](∅→∅),[5.451]→[5.451:498](∅→∅)
env = ''export NIX_REMOTE=daemon ''+ ''HYDRA_DBI="${cfg.dbi}" ''+ ''HYDRA_CONFIG=${cfg.baseDir}/data/hydra.conf ''+ ''HYDRA_DATA=${cfg.baseDir}/data ''+ ''HYDRA_PORT="${toString cfg.port}" ''+ (if cfg.logo != nullthen ''HYDRA_LOGO="${cfg.logo}" ''else "")+ ''HYDRA_TRACKER="${cfg.tracker}" ;'';env ={ NIX_REMOTE = "daemon";HYDRA_DBI = cfg.dbi;HYDRA_CONFIG = "${cfg.baseDir}/data/hydra.conf";HYDRA_DATA = "${cfg.baseDir}/data";HYDRA_PORT = "${toString cfg.port}";OPENSSL_X509_CERT_FILE = "/etc/ssl/certs/ca-bundle.crt";};serverEnv = env //{ HYDRA_LOGO = if cfg.logo != null then cfg.logo else "";HYDRA_TRACKER = cfg.tracker;}; - replacement in hydra-module.nix at line 66
default = pkgs.hydra;#default = pkgs.hydra; - edit in hydra-module.nix at line 127
useWAL = mkOption {default = true;description = ''Whether to use SQLite's Write-Ahead Logging, which may improve performance.'';}; - edit in hydra-module.nix at line 169
# Online log compression makes it impossible to get the tail of# builds that are in progress.build-compress-log = false - replacement in hydra-module.nix at line 174
use-sqlite-wal = falseuse-sqlite-wal = ${if cfg.useWAL then "true" else "false"} - replacement in hydra-module.nix at line 177
jobs.hydra_init ={ description = "hydra-init";startOn = "started network-interfaces";preStart = ''jobs."hydra-init" ={ wantedBy = [ "multi-user.target" ];script = '' - replacement in hydra-module.nix at line 184
exec = ''echo done'';task = true;};systemd.services."hydra-server" ={ wantedBy = [ "multi-user.target" ];wants = [ "hydra-init.service" ];after = [ "hydra-init.service" ];environment = serverEnv;serviceConfig ={ ExecStart = "@${cfg.hydra}/bin/hydra-server hydra-server -f -h \* --max_spare_servers 5 --max_servers 25 --max_requests 100";User = cfg.user;Restart = "always";}; - replacement in hydra-module.nix at line 199[5.3959]→[5.3959:4133](∅→∅),[5.4133]→[5.0:122](∅→∅),[5.122]→[5.4258:4270](∅→∅),[5.125]→[5.4258:4270](∅→∅),[5.4258]→[5.4258:4270](∅→∅)
jobs.hydra_server ={ description = "hydra-server";startOn = if cfg.autoStart then "started network-interfaces hydra-init" else "never";exec = ''${pkgs.su}/bin/su - ${cfg.user} -c '${env} ${cfg.hydra}/bin/hydra-server > ${cfg.baseDir}/data/server.log 2>&1''';systemd.services."hydra-queue-runner" ={ wantedBy = [ "multi-user.target" ];wants = [ "hydra-init.service" ];after = [ "hydra-init.service" "network.target" ];path = [ pkgs.nettools pkgs.ssmtp ];environment = env;serviceConfig ={ ExecStartPre = "${cfg.hydra}/bin/hydra-queue-runner --unlock";ExecStart = "@${cfg.hydra}/bin/hydra-queue-runner hydra-queue-runner";User = cfg.user;Restart = "always";}; - replacement in hydra-module.nix at line 213[5.4280]→[5.4280:4448](∅→∅),[5.4448]→[5.123:234](∅→∅),[5.234]→[5.4562:4580](∅→∅),[5.240]→[5.4562:4580](∅→∅),[5.4562]→[5.4562:4580](∅→∅),[5.4580]→[5.235:379](∅→∅),[5.379]→[5.4727:4739](∅→∅),[5.388]→[5.4727:4739](∅→∅),[5.4727]→[5.4727:4739](∅→∅)
jobs.hydra_queue_runner ={ description = "hydra-queue-runner";startOn = if cfg.autoStart then "started network-interfaces hydra-init" else "never";preStart = "${pkgs.su}/bin/su - ${cfg.user} -c '${env} ${cfg.hydra}/bin/hydra-queue-runner --unlock'";exec = ''${pkgs.su}/bin/su - ${cfg.user} -c '${env} nice -n 8 ${cfg.hydra}/bin/hydra-queue-runner > ${cfg.baseDir}/data/queue-runner.log 2>&1''';systemd.services."hydra-evaluator" ={ wantedBy = [ "multi-user.target" ];wants = [ "hydra-init.service" ];after = [ "hydra-init.service" "network.target" ];path = [ pkgs.nettools pkgs.ssmtp ];environment = env;serviceConfig ={ ExecStart = "@${cfg.hydra}/bin/hydra-evaluator hydra-evaluator";User = cfg.user;Restart = "always";}; - replacement in hydra-module.nix at line 226[5.4749]→[5.4749:4929](∅→∅),[5.4929]→[5.380:518](∅→∅),[5.518]→[5.5070:5082](∅→∅),[5.530]→[5.5070:5082](∅→∅),[5.5070]→[5.5070:5082](∅→∅)
jobs.hydra_evaluator ={ description = "hydra-evaluator";startOn = if cfg.autoStart then "started network-interfaces hydra-init" else "never";exec = ''${pkgs.su}/bin/su - ${cfg.user} -c '${env} nice -n 5 ${cfg.hydra}/bin/hydra-evaluator > ${cfg.baseDir}/data/evaluator.log 2>&1''';systemd.services."hydra-update-gc-roots" ={ wants = [ "hydra-init.service" ];after = [ "hydra-init.service" ];environment = env;serviceConfig ={ ExecStart = "@${cfg.hydra}/bin/hydra-update-gc-roots hydra-update-gc-roots";User = cfg.user;}; - replacement in hydra-module.nix at line 244
stop hydra_queue_runnerstop hydra_queue_runner - replacement in hydra-module.nix at line 246[3.514]→[3.514:718](∅→∅),[3.718]→[5.6304:6305](∅→∅),[5.6304]→[5.6304:6305](∅→∅),[5.6305]→[3.719:1272](∅→∅)
if [ $(($(stat -f -c '%a' /nix/store) * $(stat -f -c '%S' /nix/store))) -lt $((${toString cfg.minimumDiskFreeEvaluator} * 1024**3)) ]; thenstop hydra_evaluatorfi'';collect = pkgs.writeScript "collect-some-garbage"# Arrange to always have at least 100 GiB free.'' #!/bin/sh -eavailable="$(df -B1 /nix/store | tail -n 1 | awk '{ print $4 }')"target="$((100 * 1024**3))"to_free="$(($available > $target ? 200 * 1024**2 : $target - $available))"echo "$available B available, and targeting $target B available"echo "thus, freeing $to_free B"exec "${pkgs.nix}/bin/nix-collect-garbage" --max-freed "$to_free"if [ $(($(stat -f -c '%a' /nix/store) * $(stat -f -c '%S' /nix/store))) -lt $((${toString cfg.minimumDiskFreeEvaluator} * 1024**3)) ]; thenstop hydra_evaluatorfi - replacement in hydra-module.nix at line 257[3.1520]→[3.1520:1662](∅→∅),[3.1662]→[5.6314:6315](∅→∅),[5.6314]→[5.6314:6315](∅→∅),[5.6315]→[3.1663:1746](∅→∅)
[ "15 03 * * * root ${collect} &> ${cfg.baseDir}/data/gc.log""15 13 * * * root ${collect} &> ${cfg.baseDir}/data/gc.log""*/5 * * * * root ${checkSpace} &> ${cfg.baseDir}/data/checkspace.log"[ "*/5 * * * * root ${checkSpace} &> ${cfg.baseDir}/data/checkspace.log" - replacement in hydra-module.nix at line 259
"15 02 * * * ${cfg.user} ${env} ${cfg.hydra}/bin/hydra-update-gc-roots &> ${cfg.baseDir}/data/gc-roots.log""15 2 * * * root ${pkgs.systemd}/bin/systemctl start hydra-update-gc-roots.service"