Browse Source

Partial remote builders on Hydra

Signed-off-by: Magic_RB <magic_rb@redalder.org>
master
Magic_RB 3 months ago
parent
commit
b7e324ae13
Signed by: Magic_RB GPG Key ID: 08D5287CC5DDCA0E
  1. 48
      containers/hydra.nix
  2. 3
      infrastructure/hydra/hydra-data.hcl
  3. 3
      infrastructure/hydra/hydra-db.hcl
  4. 3
      infrastructure/hydra/hydra-nix.hcl
  5. 11
      infrastructure/hydra/nomad.hcl

48
containers/hydra.nix

@ -40,7 +40,7 @@ in
hydra = makeSystem {
system = "x86_64-linux";
name = "nixng-hydra";
config = { pkgs, config, ... }:
config = { pkgs, config, lib, nglib, ... }:
{
config = {
dumb-init = {
@ -52,7 +52,7 @@ in
patches = [ ./0001-Add-ignored_acls-setting.patch ];
};
loadNixDb = true;
overlayNix = "/nix-persist";
persistNix = "/nix-persist";
config = {
experimental-features = [ "nix-command" "flakes" ];
sandbox = true;
@ -60,6 +60,9 @@ in
substituters = [ "https://cache.nixos.org/" ];
ignored-acls = [ "system.nfs4_acl" ];
allowed-uris = "https://gitea.redalder.org";
builders-use-substitutes = true;
builders = "@/etc/nix/machines";
};
};
services.hydra = {
@ -92,6 +95,47 @@ in
'';
enabled = true;
};
init.services.nix-daemon.environment.PATH = with pkgs;
lib.makeBinPath [ utillinux runit busybox openssh gzip ];
system.activation =
{ nix-machines =
let
machines = pkgs.writeText "machines"
''
eu.nixbuild.net x86_64-linux 100 5 benchmark,big-parallel
'';
in
nglib.dag.dagEntryAnywhere
''
export PATH=${pkgs.busybox}/bin
mkdir -p /etc/nix
ln -s ${machines} /etc/nix/machines
'';
ssh =
let
ssh_config = pkgs.writeText "ssh_config"
''
Host eu.nixbuild.net
PubkeyAcceptedKeyTypes ssh-ed25519
IdentityFile /ssh-key
'';
ssh_known_hosts = pkgs.writeText "ssh_known_hosts"
''
eu.nixbuild.net ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPIQCZc54poJ8vqawd8TraNryQeJnvH1eLpIDgbiqymM
'';
in
nglib.dag.dagEntryAnywhere
''
export PATH=${pkgs.busybox}/bin
mkdir -p /etc/ssh
ln -s ${ssh_config} /etc/ssh/ssh_config
ln -s ${ssh_known_hosts} /etc/ssh/ssh_known_hosts
'';
};
};
};
};

3
infrastructure/hydra/hydra-data.hcl

@ -10,9 +10,10 @@ capability {
context {
server = "blowhole.in.redalder.org"
share = "/hydra-data"
share = "/var/nfs/hydra-data"
}
mount_options {
fs_type = "nfs"
mount_flags = [ "nolock" ]
}

3
infrastructure/hydra/hydra-db.hcl

@ -10,9 +10,10 @@ capability {
context {
server = "blowhole.in.redalder.org"
share = "/hydra-db"
share = "/var/nfs/hydra-db"
}
mount_options {
fs_type = "nfs"
mount_flags = [ "nolock" ]
}

3
infrastructure/hydra/hydra-nix.hcl

@ -10,9 +10,10 @@ capability {
context {
server = "blowhole.in.redalder.org"
share = "/hydra-nix"
share = "/var/nfs/hydra-nix"
}
mount_options {
fs_type = "nfs"
mount_flags = [ "nolock" ]
}

11
infrastructure/hydra/nomad.hcl

@ -61,17 +61,6 @@ job "hydra" {
connect {
sidecar_service {}
sidecar_task {
resources {
cpu = 75
memory = 48
}
config {
memory_hard_limit = 96
}
}
}
}

Loading…
Cancel
Save