@cryptotaxi247 / infra-1 / commits / a4766421

* Put the machines in a list instead of an attribute set because the order matters for distributed builds (the fast machines should come first).

* Put the machines in a list instead of an attribute set because the order matters for distributed builds (the fast machines should come first). svn path=/configurations/trunk/tud/; revision=15243

Eelco Dolstra committed Apr 22, 2009 at 12:28 UTC a47664211ef6671ec9f1aa560654ff2ff8a72c15
2 files changed +59 -27
cartman.nix
+4 -7
@@ -4,9 +4,6 @@ let
4
5 machines = import ./machines.nix;
6
7 - machineList = map (name: {hostName = name;} // builtins.getAttr name machines)
8 - (builtins.attrNames machines);
9 -
7 # Produce the list of Nix build machines in the format expected by
8 # the Nix daemon Upstart job.
9 buildMachines =
@@ -14,7 +11,7 @@ let
11 { sshKey = "/root/.ssh/id_buildfarm";
12 sshUser = machine.buildUser;
13 };
17 - in map addKey (pkgs.lib.filter (machine: machine ? buildUser) machineList);
14 + in map addKey (pkgs.lib.filter (machine: machine ? buildUser) machines);
15
16 supervisor = import ../../release/supervisor/supervisor.nix {
17 stateDir = "/home/buildfarm/buildfarm-state";
@@ -80,7 +77,7 @@ rec {
77 subnetMask = "255.255.254.0";
78 }
79 { name = "eth0";
83 - ipAddress = machines.cartman.ipAddress;
80 + ipAddress = (pkgs.lib.findSingle (m: m.hostName == "cartman") {} {} machines).ipAddress;
81 }
82 ];
83
@@ -90,7 +87,7 @@ rec {
87
88 extraHosts =
89 let toHosts = m: "${m.ipAddress} ${m.hostName} ${pkgs.lib.concatStringsSep " " (if m ? aliases then m.aliases else [])}\n"; in
93 - pkgs.lib.concatStrings (map toHosts machineList);
90 + pkgs.lib.concatStrings (map toHosts machines);
91
92 localCommands =
93 # Provide NATting for the build machines on 192.168.1.*.
@@ -157,7 +154,7 @@ rec {
154
155 use-host-decl-names on;
156 '';
160 - machines = pkgs.lib.filter (machine: machine ? ethernetAddress) machineList;
157 + machines = pkgs.lib.filter (machine: machine ? ethernetAddress) machines;
158 };
159
160 extraJobs = [
machines.nix
+55 -20
@@ -1,68 +1,103 @@
1 -{
2 - cartman = {
1 +[
2 + {
3 + hostName = "cartman";
4 ipAddress = "192.168.1.5";
5 system = "i686-linux";
6 aliases = ["main"];
7 maxJobs = 2;
7 - };
8 - garrison = {
8 + }
9 +
10 + {
11 + hostName = "kenny";
12 + ipAddress = "192.168.1.19";
13 + ethernetAddress = "00:22:19:55:cc:0d";
14 + system = "x86_64-linux";
15 + maxJobs = 8;
16 + buildUser = "buildfarm";
17 + }
18 +
19 + {
20 + hostName = "stan";
21 + ipAddress = "192.168.1.20";
22 + ethernetAddress = "00:22:19:55:bf:2e";
23 + system = "x86_64-linux";
24 + maxJobs = 8;
25 + buildUser = "buildfarm";
26 + }
27 +
28 + {
29 + hostName = "garrison";
30 ipAddress = "192.168.1.11";
31 ethernetAddress = "00:19:d1:10:37:54";
32 system = "i686-cygwin";
33 aliases = ["winxp32-1" "winxp32" "winxp"];
34 maxJobs = 2;
35 buildUser = "nix";
15 - };
16 - terrance = {
36 + }
37 +
38 + {
39 + hostName = "terrance";
40 ipAddress = "192.168.1.12";
41 ethernetAddress = "00:19:d1:10:37:49";
42 system = "x86_64-linux";
43 aliases = ["linux64-1" "linux64"];
44 maxJobs = 2;
45 buildUser = "buildfarm";
23 - };
24 - phillip = {
46 + }
47 +
48 + {
49 + hostName = "phillip";
50 ipAddress = "192.168.1.13";
51 ethernetAddress = "00:19:d1:19:2a:31";
52 system = "x86_64-linux";
53 aliases = ["linux64-2"];
54 maxJobs = 2;
55 buildUser = "buildfarm";
31 - };
32 - jimmy = {
56 + }
57 +
58 + {
59 + hostName = "jimmy";
60 ipAddress = "192.168.1.14";
61 ethernetAddress = "00:16:76:9a:32:1d";
62 system = "i686-linux";
63 aliases = ["linux32-1" "linux32" "linux"];
64 maxJobs = 2;
65 buildUser = "buildfarm";
39 - };
40 - timmy = {
66 + }
67 +
68 + {
69 + hostName = "timmy";
70 ipAddress = "192.168.1.15";
71 ethernetAddress = "00:19:d1:1d:c4:9a";
72 system = "i686-linux";
73 aliases = ["linux32-2"];
74 maxJobs = 2;
75 buildUser = "buildfarm";
47 - };
48 - token = {
76 + }
77 +
78 + {
79 + hostName = "token";
80 ipAddress = "192.168.1.16";
81 ethernetAddress = "00:16:cb:a6:13:28";
82 system = "i686-darwin";
83 aliases = ["mac86-1" "mac"];
84 maxJobs = 2;
85 buildUser = "nix";
55 - };
56 - black = {
86 + }
87 +
88 + {
89 + hostName = "black";
90 ipAddress = "192.168.1.17";
91 ethernetAddress = "00:16:cb:a6:13:d7";
92 system = "i686-darwin";
93 aliases = ["mac86-2"];
94 maxJobs = 2;
95 buildUser = "nix";
63 - };
64 - hydra = {
96 + }
97 +
98 + {
99 + hostName = "hydra";
100 ipAddress = "192.168.1.18";
101 ethernetAddress = "00:22:19:55:bf:24";
67 - };
68 -}
102 + }
103 +]