fix hydra hosts

This commit is contained in:
Charlotte 🦝 Delenk 2022-04-30 09:39:45 +01:00
parent 1ec0b04fd7
commit 874b4d0280
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122

View file

@ -6,8 +6,7 @@ let
'';
clean-cache = pkgs.callPackage ../../packages/clean-s3-cache.nix { };
machines = pkgs.writeText "machines" ''
localhost armv7l-linux,aarch64-linux,powerpc-linux,powerpc64-linux,powerpc64le-linux,riscv32-linux,riscv64-linux,wasm32-wasi,x86_64-linux,i686-linux - 12 2 kvm,nixos-test,big-parallel,benchmark,gccarch-znver2,gccarch-znver1,gccarch-skylake,ca-derivations -
build-pc armv7l-linux,aarch64-linux,powerpc-linux,powerpc64-linux,powerpc64le-linux,riscv32-linux,riscv64-linux,wasm32-wasi,x86_64-linux,i686-linux - 16 1 kvm,nixos-test,big-parallel,benchmark,gccarch-znver2,gccarch-znver1,gccarch-skylake,ca-derivations -
localhost armv7l-linux,aarch64-linux,powerpc-linux,powerpc64-linux,powerpc64le-linux,riscv32-linux,riscv64-linux,wasm32-wasi,x86_64-linux,i686-linux - 12 1 kvm,nixos-test,big-parallel,benchmark,gccarch-znver1,gccarch-skylake,ca-derivations -
'';
in
{
@ -34,6 +33,10 @@ in
'';
giteaTokenFile = "/run/secrets/services/hydra/gitea_token";
githubTokenFile = "/run/secrets/services/hydra/github_token";
buildMachineFiles = [
"${machines}"
"/run/hydra-machines"
];
};
nix.settings.allowed-uris = [ "https://github.com/" "https://git.chir.rs/" "https://darkkirb.de/" "https://git.neo-layout.org/" "https://static.darkkirb.de/" ];
sops.secrets."services/hydra/gitea_token" = { };
@ -83,4 +86,26 @@ in
path = "/var/lib/hydra/queue-runner/.aws/credentials";
restartUnits = [ "hydra-queue-runner.service" ];
};
systemd.services.update-hydra-hosts = {
description = "Update hydra hosts";
serviceConfig = {
Type = "oneshot";
};
script = ''
rm /run/hydra-machines
if ping -c 1 nutty-noon.int.chir.rs; then
echo "build-pc armv7l-linux,aarch64-linux,powerpc-linux,powerpc64-linux,powerpc64le-linux,riscv32-linux,riscv64-linux,wasm32-wasi,x86_64-linux,i686-linux - 16 2 kvm,nixos-test,big-parallel,benchmark,gccarch-znver2,gccarch-znver1,gccarch-skylake,ca-derivations -" > /run/hydra-machines
fi
'';
};
systemd.timers.update-hydra-hosts = {
enable = true;
description = "Update hydra hosts";
requires = [ "update-hydra-hosts.service" ];
wantedBy = [ "multi-user.target" ];
timerConfig = {
OnBootSec = 300;
OnUnitActiveSec = 300;
};
};
}