@cryptotaxi247 / infra-1 / commits / 53620e8b

Remove obsolete cartman config

Eelco Dolstra committed Jun 7, 2013 at 19:11 UTC 53620e8b90ed4daaad697ded9dd74d057b7ae978
2 files changed +4 -449
delft/cartman.nix
+2 -448
@@ -4,22 +4,6 @@ with pkgs.lib;
4
5 let
6
7 - zabbixMail = pkgs.writeScriptBin "zabbix-mail" ''
8 - #!/bin/sh
9 - set -e
10 -
11 - export zabbixemailto="$1"
12 - export zabbixsubject="$2"
13 - export zabbixbody="$3"
14 -
15 - ${pkgs.ssmtp}/sbin/sendmail -v $zabbixemailto <<EOF
16 - Subject: $zabbixsubject
17 - To: $zabbixemailto
18 -
19 - $zabbixbody
20 - EOF
21 - '';
22 -
7 duplicityBackup = pkgs.writeScript "backup-duplicity" ''
8 #! /bin/sh
9 echo "Starting backups"
@@ -39,56 +23,12 @@ let
23 echo Done
24 '';
25
42 - machines = import ./machines.nix pkgs.lib;
43 -
44 - # Produce the list of Nix build machines in the format expected by
45 - # the Nix daemon Upstart job.
46 - buildMachines =
47 - let addKey = machine: machine //
48 - { sshKey = "/root/.ssh/id_buildfarm";
49 - sshUser = machine.buildUser;
50 - };
51 - in map addKey (filter (machine: machine ? buildUser) machines);
52 -
53 - myIP = "130.161.158.181";
54 -
55 - releasesCSS = /etc/nixos/release/generic-dist/release-page/releases.css;
56 -
26 ZabbixApacheUpdater = pkgs.fetchsvn {
27 url = https://www.zulukilo.com/svn/pub/zabbix-apache-stats/trunk/fetch.py;
28 sha256 = "1q66x429wpqjqcmlsi3x37rkn95i55nj8ldzcrblnx6a0jnjgd2g";
29 rev = 94;
30 };
31
63 - strategoxtVHostConfig =
64 - { hostName = "strategoxt.org";
65 - servedFiles = [
66 - { urlPath = "/freenode.ver";
67 - file = "/data/pt-wiki/pub/freenode.ver";
68 - }
69 - ];
70 - extraSubservices = [
71 - { function = import /etc/nixos/services/twiki;
72 - startWeb = "Stratego/WebHome";
73 - dataDir = "/data/pt-wiki/data";
74 - pubDir = "/data/pt-wiki/pub";
75 - twikiName = "Stratego/XT Wiki";
76 - registrationDomain = "ewi.tudelft.nl";
77 - }
78 - ];
79 - };
80 -
81 - strategoxtSSLConfig =
82 - { enableSSL = true;
83 - sslServerCert = "/root/ssl-secrets/ssl-strategoxt-org.crt";
84 - sslServerKey = "/root/ssl-secrets/ssl-strategoxt-org.key";
85 - extraConfig =
86 - ''
87 - SSLCertificateChainFile /root/ssl-secrets/startssl-class1.pem
88 - SSLCACertificateFile /root/ssl-secrets/startssl-ca.pem
89 - '';
90 - };
91 -
32 in
33
34 rec {
@@ -114,98 +54,10 @@ rec {
54
55 #swapDevices = [ { label = "swap1"; } ];
56
117 - nix = {
118 - maxJobs = 2;
119 - distributedBuilds = true;
120 - inherit buildMachines;
121 - extraOptions = ''
122 - gc-keep-outputs = true
123 - '';
124 - };
125 -
126 - networking = {
127 - hostName = "cartman";
128 - domain = "buildfarm";
129 -
130 - interfaces.external =
131 - { ipAddress = myIP;
132 - prefixLength = 23;
133 - };
134 -
135 - interfaces.internal =
136 - { ipAddress = (findSingle (m: m.hostName == "cartman") {} {} machines).ipAddress;
137 - prefixLength = 22;
138 - };
139 -
140 - useDHCP = false;
141 -
142 - defaultGateway = "130.161.158.1";
143 -
144 - nameservers = [ "127.0.0.1" ];
145 -
146 - extraHosts = "192.168.1.5 cartman";
147 -
148 - firewall.allowedTCPPorts = [ 80 443 10051 5999 ];
149 - firewall.allowedUDPPorts = [ 53 67 ];
150 -
151 - nat.enable = true;
152 - nat.internalIPs = "192.168.1.0/22";
153 - nat.externalInterface = "external";
154 - nat.externalIP = myIP;
155 -
156 - localCommands =
157 - ''
158 - ${pkgs.iptables}/sbin/iptables -t nat -F PREROUTING
159 -
160 - # lucifer ssh (to give Karl/Armijn access for the BAT project)
161 - ${pkgs.iptables}/sbin/iptables -t nat -A PREROUTING -p tcp -d ${myIP} --dport 2222 -j DNAT --to 192.168.1.26:22
162 -
163 - # Cleanup.
164 - ip -6 route flush dev sixxs || true
165 - ip link set dev sixxs down || true
166 - ip tunnel del sixxs || true
167 -
168 - # Set up a SixXS tunnel for IPv6 connectivity.
169 - ip tunnel add sixxs mode sit local ${myIP} remote 192.87.102.107 ttl 64
170 - ip link set dev sixxs mtu 1280 up
171 - ip -6 addr add 2001:610:600:88d::2/64 dev sixxs
172 - ip -6 route add default via 2001:610:600:88d::1 dev sixxs
173 -
174 - # Discard all traffic to networks in our prefix that don't exist.
175 - ip -6 route add 2001:610:685::/48 dev lo || true
176 -
177 - # Create a local network (prefix:1::/64).
178 - ip -6 addr add 2001:610:685:1::1/64 dev internal || true
179 -
180 - # Forward traffic to our Nova cloud to "stan".
181 - ip -6 route add 2001:610:685:2::/64 via 2001:610:685:1:222:19ff:fe55:bf2e || true
182 -
183 - # Amazon MTurk experiment.
184 - #${pkgs.iptables}/sbin/iptables -t nat -A PREROUTING -p tcp -d ${myIP} --dport 5998 -j DNAT --to 192.168.1.26:5998
185 - #${pkgs.iptables}/sbin/iptables -t nat -A PREROUTING -p tcp -d ${myIP} --dport 5999 -j DNAT --to 192.168.1.26:5999
186 - '';
187 - };
57 + nix.maxJobs = 2;
58
59 services = {
60
191 - udev.extraRules =
192 - ''
193 - ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="00:19:d1:19:28:bf", NAME="external"
194 - ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="00:04:23:df:f7:bf", NAME="internal"
195 - '';
196 -
197 - radvd = {
198 - enable = true;
199 - config =
200 - ''
201 - interface internal {
202 - AdvSendAdvert on;
203 - prefix 2001:610:685:1::/64 { };
204 - RDNSS 2001:610:685:1::1 { };
205 - };
206 - '';
207 - };
208 -
61 cron = {
62 mailto = "rob.vermaas@gmail.com";
63 systemCronJobs =
@@ -222,305 +74,7 @@ rec {
74 ];
75 };
76
225 - httpd = {
226 - enable = true;
227 - multiProcessingModule = "worker";
228 - logPerVirtualHost = true;
229 - adminAddr = "e.dolstra@tudelft.nl";
230 - hostName = "localhost";
231 -
232 - extraModules = ["deflate"];
233 - extraConfig =
234 - ''
235 - AddType application/nix-package .nixpkg
236 -
237 - <Location /server-status>
238 - SetHandler server-status
239 - Allow from 127.0.0.1 # If using a remote host for monitoring replace 127.0.0.1 with its IP.
240 - Order deny,allow
241 - Deny from all
242 - </Location>
243 -
244 - ExtendedStatus On
245 -
246 - StartServers 15
247 - '';
248 -
249 - phpOptions =
250 - ''
251 - #max_execution_time = 2
252 - memory_limit = "32M"
253 - '';
254 -
255 - servedFiles =
256 - [ { urlPath = "/releases.css";
257 - file = releasesCSS;
258 - }
259 - { urlPath = "/css/releases.css"; # legacy; old releases point here
260 - file = releasesCSS;
261 - }
262 - { urlPath = "/releases/css/releases.css"; # legacy; old releases point here
263 - file = releasesCSS;
264 - }
265 - ];
266 -
267 - virtualHosts = [
268 -
269 - { # Catch-all site.
270 - hostName = "old.nixos.org";
271 - globalRedirect = "http://nixos.org/";
272 - }
273 -
274 - { hostName = "buildfarm.st.ewi.tudelft.nl";
275 - documentRoot = cleanSource ./webroot;
276 - enableUserDir = true;
277 - extraSubservices = [
278 - { function = import /etc/nixos/services/subversion;
279 - urlPrefix = "";
280 - toplevelRedirect = false;
281 - dataDir = "/data/subversion";
282 - notificationSender = "svn@buildfarm.st.ewi.tudelft.nl";
283 - organisation = {
284 - name = "Software Engineering Research Group, TU Delft";
285 - url = http://www.st.ewi.tudelft.nl/;
286 - logo = "/serg-logo.png";
287 - };
288 - }
289 - { function = import /etc/nixos/services/subversion;
290 - id = "ptg";
291 - urlPrefix = "/ptg";
292 - dataDir = "/data/subversion-ptg";
293 - notificationSender = "svn@buildfarm.st.ewi.tudelft.nl";
294 - organisation = {
295 - name = "Software Engineering Research Group, TU Delft";
296 - url = http://www.st.ewi.tudelft.nl/;
297 - logo = "/serg-logo.png";
298 - };
299 - }
300 - { serviceType = "zabbix";
301 - urlPrefix = "/zabbix";
302 - }
303 - ];
304 - servedDirs = [
305 - { urlPath = "/releases";
306 - dir = "/data/webserver/dist";
307 - }
308 - ];
309 - }
310 -
311 - strategoxtVHostConfig
312 -
313 - (strategoxtVHostConfig // strategoxtSSLConfig)
314 -
315 - { hostName = "www.strategoxt.org";
316 - serverAliases = ["www.stratego-language.org"];
317 - globalRedirect = "http://strategoxt.org/";
318 - }
319 -
320 - { hostName = "svn.strategoxt.org";
321 - globalRedirect = "https://svn.strategoxt.org/";
322 - }
323 -
324 - ( strategoxtSSLConfig //
325 - { hostName = "svn.strategoxt.org";
326 - extraSubservices = [
327 - { function = import /etc/nixos/services/subversion;
328 - id = "strategoxt";
329 - urlPrefix = "";
330 - dataDir = "/data/subversion-strategoxt";
331 - notificationSender = "svn@svn.strategoxt.org";
332 - organisation = {
333 - name = "Stratego/XT";
334 - url = http://strategoxt.org/;
335 - logo = http://strategoxt.org/pub/Stratego/StrategoLogo/StrategoLogoTextlessWhite-100px.png;
336 - };
337 - }
338 - ];
339 - })
340 -
341 - { hostName = "program-transformation.org";
342 - serverAliases = ["www.program-transformation.org"];
343 - extraSubservices = [
344 - { function = import /etc/nixos/services/twiki;
345 - startWeb = "Transform/WebHome";
346 - dataDir = "/data/pt-wiki/data";
347 - pubDir = "/data/pt-wiki/pub";
348 - twikiName = "Program Transformation Wiki";
349 - registrationDomain = "ewi.tudelft.nl";
350 - }
351 - ];
352 - }
353 -
354 - { hostName = "bugs.strategoxt.org";
355 - extraConfig = ''
356 - <Proxy *>
357 - Order deny,allow
358 - Allow from all
359 - </Proxy>
360 -
361 - ProxyRequests Off
362 - ProxyPreserveHost On
363 - ProxyPass / http://mrkitty:10080/
364 - ProxyPassReverse / http://mrkitty:10080/
365 - '';
366 - }
367 -
368 - { hostName = "releases.strategoxt.org";
369 - documentRoot = "/data/webserver/dist/strategoxt2";
370 - }
371 -
372 - { hostName = "syntax-definition.org";
373 - serverAliases = ["www.syntax-definition.org"];
374 - extraSubservices = [
375 - { function = import /etc/nixos/services/twiki;
376 - startWeb = "Sdf/WebHome";
377 - dataDir = "/data/pt-wiki/data";
378 - pubDir = "/data/pt-wiki/pub";
379 - twikiName = "Syntax Definition Wiki";
380 - registrationDomain = "ewi.tudelft.nl";
381 - }
382 - ];
383 - }
384 -
385 - { hostName = "hydra.nixos.org";
386 - logFormat = ''"%h %l %u %t \"%r\" %>s %b %D"'';
387 - extraConfig = ''
388 - TimeOut 900
389 -
390 - <Proxy *>
391 - Order deny,allow
392 - Allow from all
393 - </Proxy>
394 -
395 - ProxyRequests Off
396 - ProxyPreserveHost On
397 - ProxyPass / http://lucifer:3000/ retry=5 disablereuse=on
398 - ProxyPassReverse / http://lucifer:3000/
399 -
400 - <Location />
401 - SetOutputFilter DEFLATE
402 - BrowserMatch ^Mozilla/4\.0[678] no-gzip\
403 - BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
404 - SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
405 - SetEnvIfNoCase Request_URI /api/ no-gzip dont-vary
406 - SetEnvIfNoCase Request_URI /download/ no-gzip dont-vary
407 - </Location>
408 -
409 - '';
410 - }
411 -
412 - { hostName = "hydra-test.nixos.org";
413 - logFormat = ''"%h %l %u %t \"%r\" %>s %b %D"'';
414 - extraConfig = ''
415 - <Proxy *>
416 - Order deny,allow
417 - Allow from all
418 - </Proxy>
419 -
420 - ProxyRequests Off
421 - ProxyPreserveHost On
422 - ProxyPass / http://wendy:4000/ retry=5 disablereuse=off
423 - ProxyPassReverse / http://wendy:4000/
424 - '';
425 - }
426 -
427 - { hostName = "hydra-ubuntu.nixos.org";
428 - extraConfig = ''
429 - <Proxy *>
430 - Order deny,allow
431 - Allow from all
432 - </Proxy>
433 -
434 - ProxyRequests Off
435 - ProxyPreserveHost On
436 - ProxyPass / http://meerkat:3000/ retry=5
437 - ProxyPassReverse / http://meerkat:3000/
438 - '';
439 - }
440 -
441 - { hostName = "planet.strategoxt.org";
442 - serverAliases = ["planet.stratego.org"];
443 - documentRoot = "/home/karltk/public_html/planet";
444 - }
445 -
446 - { hostName = "mturk.nixos.org";
447 - extraConfig = ''
448 - <Proxy *>
449 - Order deny,allow
450 - Allow from all
451 - </Proxy>
452 -
453 - ProxyRequests Off
454 - ProxyPreserveHost On
455 - ProxyPass / http://wendy/~mturk/ retry=5
456 - ProxyPassReverse / http://wendy/~mturk/
457 - '';
458 - }
459 -
460 - { hostName = "mturk-view.nixos.org";
461 - extraConfig = ''
462 - Redirect permanent / http://nixos.org/mturk/
463 - '';
464 - }
465 -
466 - { hostName = "mturk-view-sandbox.nixos.org";
467 - extraConfig = ''
468 - Redirect permanent / http://nixos.org/mturk-sandbox/
469 - '';
470 - }
471 -
472 - ];
473 - };
474 -
475 - zabbixAgent.enable = true;
476 -
477 - zabbixServer.enable = true;
478 - zabbixServer.dbServer = "wendy";
479 - zabbixServer.dbPassword = import ./zabbix-password.nix;
480 -
77 };
78
483 - # Needed for the Nixpkgs mirror script.
484 - environment.pathsToLink = [ "/libexec" ];
485 -
486 - environment.systemPackages = [ pkgs.dnsmasq pkgs.duplicity zabbixMail ];
487 -
488 - jobs.dnsmasq =
489 - let
490 -
491 - confFile = pkgs.writeText "dnsmasq.conf"
492 - ''
493 - keep-in-foreground
494 - no-hosts
495 - addn-hosts=${hostsFile}
496 - expand-hosts
497 - domain=buildfarm
498 - interface=internal
499 -
500 - server=130.161.158.4
501 - server=130.161.33.17
502 - server=130.161.180.1
503 - server=8.8.8.8
504 - server=8.8.4.4
505 -
506 - dhcp-range=192.168.1.150,192.168.3.200
507 -
508 - ${flip concatMapStrings machines (m: optionalString (m ? ethernetAddress) ''
509 - dhcp-host=${m.ethernetAddress},${m.ipAddress},${m.hostName}
510 - '')}
511 - '';
512 -
513 - hostsFile = pkgs.writeText "extra-hosts"
514 - (flip concatMapStrings machines (m: "${m.ipAddress} ${m.hostName}\n"));
515 -
516 - in
517 - { startOn = "started network-interfaces";
518 - exec = "${pkgs.dnsmasq}/bin/dnsmasq --conf-file=${confFile}";
519 - };
520 -
521 - # Use cgroups to limit Apache's resources.
522 - systemd.services.httpd.serviceConfig.CPUShares = 1000;
523 - systemd.services.httpd.serviceConfig.MemoryLimit = "1500M";
524 - systemd.services.httpd.serviceConfig.ControlGroupAttribute = [ "memory.memsw.limit_in_bytes 1500M" ];
525 -
79 + environment.systemPackages = [ pkgs.duplicity ];
80 }
delft/machines.nix
+2 -1
@@ -5,7 +5,8 @@ lib: with lib;
5 { # Web frontend.
6 hostName = "cartman";
7 ipAddress = "192.168.1.5";
8 - system = "i686-linux";
8 + ethernetAddress = "00:19:d1:19:28:bf";
9 + systems = [ "x86_64-linux" "i686-linux" ];
10 aliases = ["main"];
11 maxJobs = 2;
12 }