@cryptotaxi247 / infra-1 / commits / 92f40f2d

* Upstart jobs for Hydra.

svn path=/configurations/trunk/tud/; revision=20187

Eelco Dolstra committed Feb 23, 2010 at 11:02 UTC 92f40f2d4c44bea79ebfc2b8b65bd2968a79ad42
1 file changed +32 -20
hydra.nix
+32 -20
@@ -19,24 +19,20 @@ in
19 require = [ ./common.nix ];
20
21 boot = {
22 - initrd = {
23 - extraKernelModules = [ "uhci_hcd" "ehci_hcd" "ata_piix" "mptsas" "usbhid" "ext4" ];
24 - };
22 + initrd.kernelModules = [ "uhci_hcd" "ehci_hcd" "ata_piix" "mptsas" "usbhid" "ext4" ];
23 kernelModules = [ "acpi-cpufreq" "kvm-intel" ];
24 kernelPackages = pkgs.linuxPackages_2_6_32;
27 - grubDevice = "/dev/sda";
28 - copyKernels = true;
25 + loader.grub.device = "/dev/sda";
26 + loader.grub.copyKernels = true;
27 };
28
31 - fileSystems = [
32 - { mountPoint = "/";
33 - label = "nixos";
34 - }
35 - ];
29 + fileSystems =
30 + [ { mountPoint = "/";
31 + label = "nixos";
32 + }
33 + ];
34
37 - swapDevices = [
38 - { label = "swap" ; }
39 - ];
35 + swapDevices = [ { label = "swap" ; } ];
36
37 nix = {
38 maxJobs = 0;
@@ -74,12 +70,28 @@ in
70 };
71 };
72
77 - services = {
78 - cron.systemCronJobs =
79 - [ "15 02 * * * hydra source /home/hydra/.bashrc; /nix/var/nix/profiles/per-user/hydra/profile/bin/hydra_update_gc_roots.pl > /home/hydra/gc-roots.log 2>&1"
80 - # Make sure that at least 100 GiB of disk space is available.
81 - "15 03 * * * root nix-store --gc --max-freed \"$((250 * 1024**3 - 1024 * $(df /nix/store | tail -n 1 | awk '{ print $4 }')))\" > /var/log/gc.log 2>&1"
82 - ];
73 + services.cron.systemCronJobs =
74 + [ "15 02 * * * hydra source /home/hydra/.bashrc; /nix/var/nix/profiles/per-user/hydra/profile/bin/hydra_update_gc_roots.pl > /home/hydra/gc-roots.log 2>&1"
75 + # Make sure that at least 100 GiB of disk space is available.
76 + "15 03 * * * root nix-store --gc --max-freed \"$((250 * 1024**3 - 1024 * $(df /nix/store | tail -n 1 | awk '{ print $4 }')))\" > /var/log/gc.log 2>&1"
77 + ];
78 +
79 + jobs.hydra_server =
80 + { name = "hydra-server";
81 + startOn = "started network-interfaces";
82 + exec = "${pkgs.su}/bin/su - hydra -c 'hydra_server.pl > /home/hydra/data/server.log 2>&1'";
83 + };
84 +
85 + jobs.hydra_scheduler =
86 + { name = "hydra-scheduler";
87 + startOn = "started network-interfaces";
88 + exec = "${pkgs.su}/bin/su - hydra -c 'hydra_scheduler.pl > /home/hydra/data/scheduler.log 2>&1'";
89 + };
90 +
91 + jobs.hydra_queue_runner =
92 + { name = "hydra-queue-runner";
93 + startOn = "started network-interfaces";
94 + exec = "${pkgs.su}/bin/su - hydra -c 'hydra_queue_runner.pl > /home/hydra/data/queue_runner.log 2>&1'";
95 + };
96
84 - };
97 }