Automatically set distributed build's supportedFeatures based on that host's actual config.
Previously, we had two copies of the supported features for each host.
This commit is contained in:
parent
3bf912f3be
commit
eebbf9f4aa
@ -69,6 +69,8 @@
|
|||||||
|
|
||||||
this_nixos_config = self.nixosConfigurations."${hostname}";
|
this_nixos_config = self.nixosConfigurations."${hostname}";
|
||||||
|
|
||||||
|
all_nixos_configs = self.nixosConfigurations;
|
||||||
|
|
||||||
pkgs-unoptimized = import nixpkgs-unoptimized {
|
pkgs-unoptimized = import nixpkgs-unoptimized {
|
||||||
inherit (nodeConfig) system;
|
inherit (nodeConfig) system;
|
||||||
hostPlatform.gcc.arch = "default";
|
hostPlatform.gcc.arch = "default";
|
||||||
|
|||||||
@ -3,12 +3,6 @@
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
me.distributed_build.enable = true;
|
me.distributed_build.enable = true;
|
||||||
me.distributed_build.machines.hydra = {
|
|
||||||
enable = true;
|
|
||||||
additional_config = {
|
|
||||||
speedFactor = 2;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
me.distributed_build.machines.quark = {
|
me.distributed_build.machines.quark = {
|
||||||
enable = true;
|
enable = true;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
|
|||||||
@ -3,12 +3,6 @@
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
me.distributed_build.enable = true;
|
me.distributed_build.enable = true;
|
||||||
me.distributed_build.machines.hydra = {
|
|
||||||
enable = true;
|
|
||||||
additional_config = {
|
|
||||||
speedFactor = 2;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
me.distributed_build.machines.quark = {
|
me.distributed_build.machines.quark = {
|
||||||
enable = true;
|
enable = true;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
|
|||||||
@ -3,12 +3,6 @@
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
me.distributed_build.enable = true;
|
me.distributed_build.enable = true;
|
||||||
me.distributed_build.machines.hydra = {
|
|
||||||
enable = true;
|
|
||||||
additional_config = {
|
|
||||||
speedFactor = 2;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
me.distributed_build.machines.quark = {
|
me.distributed_build.machines.quark = {
|
||||||
enable = true;
|
enable = true;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
|
|||||||
@ -3,11 +3,5 @@
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
me.distributed_build.enable = true;
|
me.distributed_build.enable = true;
|
||||||
me.distributed_build.machines.hydra = {
|
|
||||||
enable = true;
|
|
||||||
additional_config = {
|
|
||||||
speedFactor = 2;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,12 +3,6 @@
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
me.distributed_build.enable = true;
|
me.distributed_build.enable = true;
|
||||||
me.distributed_build.machines.hydra = {
|
|
||||||
enable = true;
|
|
||||||
additional_config = {
|
|
||||||
speedFactor = 2;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
me.distributed_build.machines.quark = {
|
me.distributed_build.machines.quark = {
|
||||||
enable = true;
|
enable = true;
|
||||||
additional_config = {
|
additional_config = {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
all_nixos_configs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -24,6 +25,18 @@ let
|
|||||||
description = "Additional config values for the buildMachines entry. For example, speedFactor.";
|
description = "Additional config values for the buildMachines entry. For example, speedFactor.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static_host_configs = {
|
||||||
|
quark = {
|
||||||
|
# From: base64 -w0 /persist/ssh/ssh_host_ed25519_key.pub
|
||||||
|
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUx0alplYlVYTkRkU3Y1enVGbjM3eFNMZUN3S2hPKzFMdWovM2FYNFJRTEEgcm9vdEBxdWFyawo=";
|
||||||
|
systems = [
|
||||||
|
"i686-linux"
|
||||||
|
"x86_64-linux"
|
||||||
|
# "aarch64-linux"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
@ -36,8 +49,7 @@ in
|
|||||||
description = "Whether we want to use multiple machines to perform a nixos-rebuild.";
|
description = "Whether we want to use multiple machines to perform a nixos-rebuild.";
|
||||||
};
|
};
|
||||||
|
|
||||||
distributed_build.machines.hydra = make_machine_config "hydra";
|
distributed_build.machines = lib.mapAttrs (name: value: make_machine_config name) all_nixos_configs;
|
||||||
distributed_build.machines.quark = make_machine_config "quark";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.me.distributed_build.enable (
|
config = lib.mkIf config.me.distributed_build.enable (
|
||||||
@ -45,68 +57,26 @@ in
|
|||||||
{
|
{
|
||||||
nix.distributedBuilds = true;
|
nix.distributedBuilds = true;
|
||||||
}
|
}
|
||||||
(lib.mkIf config.me.distributed_build.machines.hydra.enable {
|
{
|
||||||
nix.buildMachines = [
|
nix.buildMachines = (
|
||||||
(
|
map (
|
||||||
{
|
hostname:
|
||||||
hostName = "hydra";
|
(lib.mkIf config.me.distributed_build.machines."${hostname}".enable (
|
||||||
sshUser = "nixworker";
|
lib.mkMerge [
|
||||||
# sshKey = "";
|
{
|
||||||
# publicHostKey = "";
|
hostName = hostname;
|
||||||
systems = [
|
sshUser = "nixworker";
|
||||||
"i686-linux"
|
sshKey = "/persist/manual/ssh/root/keys/id_ed25519";
|
||||||
"x86_64-linux"
|
maxJobs = 1;
|
||||||
# "aarch64-linux"
|
supportedFeatures = all_nixos_configs."${hostname}".config.me.optimizations.system_features;
|
||||||
];
|
}
|
||||||
maxJobs = 1;
|
static_host_configs."${hostname}"
|
||||||
supportedFeatures = [
|
config.me.distributed_build.machines."${hostname}".additional_config
|
||||||
"nixos-test"
|
]
|
||||||
"benchmark"
|
))
|
||||||
"big-parallel"
|
) (builtins.attrNames all_nixos_configs)
|
||||||
# "kvm"
|
);
|
||||||
"gccarch-x86-64-v3"
|
}
|
||||||
"gccarch-x86-64-v4"
|
|
||||||
"gccarch-skylake"
|
|
||||||
"gccarch-kabylake"
|
|
||||||
"gccarch-znver4"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
// config.me.distributed_build.machines.hydra.additional_config
|
|
||||||
)
|
|
||||||
];
|
|
||||||
})
|
|
||||||
(lib.mkIf config.me.distributed_build.machines.quark.enable {
|
|
||||||
nix.buildMachines = [
|
|
||||||
(
|
|
||||||
{
|
|
||||||
hostName = "quark";
|
|
||||||
sshUser = "nixworker";
|
|
||||||
sshKey = "/persist/manual/ssh/root/keys/id_ed25519";
|
|
||||||
# From: base64 -w0 /persist/ssh/ssh_host_ed25519_key.pub
|
|
||||||
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUx0alplYlVYTkRkU3Y1enVGbjM3eFNMZUN3S2hPKzFMdWovM2FYNFJRTEEgcm9vdEBxdWFyawo=";
|
|
||||||
systems = [
|
|
||||||
"i686-linux"
|
|
||||||
"x86_64-linux"
|
|
||||||
# "aarch64-linux"
|
|
||||||
];
|
|
||||||
maxJobs = 1;
|
|
||||||
supportedFeatures = [
|
|
||||||
"nixos-test"
|
|
||||||
"benchmark"
|
|
||||||
"big-parallel"
|
|
||||||
"kvm"
|
|
||||||
"gccarch-x86-64-v3"
|
|
||||||
"gccarch-x86-64-v4"
|
|
||||||
"gccarch-skylake"
|
|
||||||
"gccarch-kabylake"
|
|
||||||
"gccarch-znver4"
|
|
||||||
"gccarch-znver5"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
// config.me.distributed_build.machines.quark.additional_config
|
|
||||||
)
|
|
||||||
];
|
|
||||||
})
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user