Skip to content

Commit 9ddaaeb

Browse files
committed
imp: adjust buildkite nix properties
1 parent adcc3b5 commit 9ddaaeb

File tree

3 files changed

+56
-47
lines changed

3 files changed

+56
-47
lines changed

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nix/metal/bitteProfile/buildkite/common.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ in {
6161
cron.enable = true;
6262
};
6363

64-
nix = rec {
64+
nix = lib.mkForce rec {
6565
# Use nix sandboxing for greater determinism
6666
useSandbox = true;
6767

@@ -70,6 +70,7 @@ in {
7070

7171
# If our cache is down, don't wait forever
7272
extraOptions = ''
73+
max-jobs = auto
7374
connect-timeout = 10
7475
http2 = true
7576
show-trace = true

nix/metal/bitteProfile/default.nix

Lines changed: 51 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -492,57 +492,65 @@ in {
492492
})
493493
];
494494

495-
buildkiteOnly = [
496-
({lib, ...}: {
497-
# Temporarily disable nomad to avoid conflict with buildkite resource consumption
495+
buildkiteOnly = queue: count: [
496+
({
497+
lib,
498+
config,
499+
...
500+
}: let
501+
cfg = config.services.buildkite-containers;
502+
in {
503+
# Temporarily disable nomad to avoid conflict with buildkite resource consumption.
498504
services.nomad.enable = lib.mkForce false;
505+
506+
# We don't need to purge 10 MB daily from the nix store by default.
507+
nix.gc.automatic = lib.mkForce false;
508+
509+
services.auto-gc = {
510+
# Apply some auto and hourly gc thresholds
511+
nixAutoMaxFreedGB = 150;
512+
nixAutoMinFreeGB = 90;
513+
nixHourlyMaxFreedGB = 600;
514+
nixHourlyMinFreeGB = 150;
515+
516+
# The auto and hourly gc should negate the need for a weekly full gc.
517+
nixWeeklyGcFull = false;
518+
};
519+
520+
services.buildkite-containers = {
521+
# There should be enough space on these machines to cache dir purges.
522+
weeklyCachePurge = false;
523+
524+
containerList = let
525+
mkContainer = n: prio: {
526+
containerName = "ci${cfg.hostIdSuffix}-${toString n}";
527+
guestIp = "10.254.1.1${toString n}";
528+
inherit prio;
529+
tags = {
530+
inherit queue;
531+
system = "x86_64-linux";
532+
};
533+
};
534+
in
535+
map (n: mkContainer n (toString (10 - n))) (lib.range 1 count);
536+
};
499537
})
500538
];
501-
in {
502-
equinix-1 = {
503-
inherit deployType node_class primaryInterface role;
539+
540+
mkEquinixBuildkite = name: privateIP: queue: count: {
541+
inherit deployType node_class primaryInterface role privateIP;
504542
equinix = {inherit plan project;};
505-
privateIP = "147.75.85.17";
506543

507544
modules =
508545
baseEquinixModuleConfig
509-
++ (baseEquinixMachineConfig "equinix-1")
510-
++ buildkiteOnly
511-
++ [
512-
./buildkite/buildkite-agent-containers.nix
513-
(
514-
{
515-
config,
516-
lib,
517-
...
518-
}: let
519-
cfg = config.services.buildkite-containers;
520-
in {
521-
services.auto-gc = {
522-
nixAutoMaxFreedGB = 150;
523-
nixAutoMinFreeGB = 90;
524-
nixHourlyMaxFreedGB = 600;
525-
nixHourlyMinFreeGB = 150;
526-
nixWeeklyGcFull = true;
527-
nixWeeklyGcOnCalendar = "Sat *-*-* 20:00:00";
528-
};
529-
530-
services.buildkite-containers.containerList = let
531-
mkContainer = n: prio: {
532-
containerName = "ci${cfg.hostIdSuffix}-${toString n}";
533-
guestIp = "10.254.1.1${toString n}";
534-
inherit prio;
535-
tags = {
536-
system = "x86_64-linux";
537-
queue = "test";
538-
};
539-
};
540-
in
541-
map (n: mkContainer n (toString (10 - n))) (lib.range 1 5);
542-
}
543-
)
544-
];
546+
++ (baseEquinixMachineConfig name)
547+
++ (buildkiteOnly queue count)
548+
++ [./buildkite/buildkite-agent-containers.nix];
545549
};
550+
in {
551+
equinix-1 = mkEquinixBuildkite "equinix-1" "10.12.10.1" "default" 5;
552+
equinix-2 = mkEquinixBuildkite "equinix-2" "10.12.10.3" "default" 5;
553+
equinix-3 = mkEquinixBuildkite "equinix-3" "10.12.10.5" "benchmark" 1;
546554
};
547555
};
548556
};

0 commit comments

Comments
 (0)