Use podman everywhere, get ride of extra runner

This commit is contained in:
Greg Hellings
2024-10-10 17:19:16 -05:00
parent 38899afeb3
commit a5dc463c93
+4 -43
View File
@@ -41,41 +41,6 @@ in
builder = (import ./container-git.nix); builder = (import ./container-git.nix);
}; };
systemd.services = {
"gitlab-runner" = {
after = [ "container@github.service" ];
preStart = builtins.concatStringsSep "\n" [
"${pkgs.kmod}/bin/modprobe kvm"
"${pkgs.kmod}/bin/modprobe kvm_amd"
];
postStop = builtins.concatStringsSep "\n" [
"${pkgs.kmod}/bin/rmmod -f kvm_amd kvm"
];
serviceConfig = {
DevicePolicy = lib.mkForce "auto";
DevicesAllow = [ "/dev/kvm" "/dev/mem" ];
EnvironmentFile = config.age.secrets.docker-auth.path;
PermissionsStartOnly = "true";
PrivateDevices = false;
ProtectKernelModules = false;
};
};
};
#####################################################################################
#################### Container Podman Runner ########################################
#####################################################################################
containers.gitlab-runner-shell = container {
autoStart = true;
hostAddress = "192.168.203.1";
localAddress = "192.168.203.2";
config = ((import ./container-runner.nix) {
inherit inputs overlays;
name = "shell";
extra.virtualisation.podman.enable = true;
});
};
##################################################################################### #####################################################################################
#################### Local Podman/Docker Runner ##################################### #################### Local Podman/Docker Runner #####################################
##################################################################################### #####################################################################################
@@ -90,7 +55,7 @@ in
services = { services = {
default = { default = {
executor = "docker"; executor = "docker";
authenticationTokenConfigFile = config.age.secrets.runner-reg.path; registrationConfigFile = config.age.secrets.runner-reg.path;
dockerImage = "gitlab.shire-zebra.ts.net:5000/greg/ci-images/fedora:latest"; dockerImage = "gitlab.shire-zebra.ts.net:5000/greg/ci-images/fedora:latest";
dockerAllowedImages = [ dockerAllowedImages = [
"alpine:*" "alpine:*"
@@ -99,10 +64,6 @@ in
"fedora:*" "fedora:*"
"python:*" "python:*"
"ubuntu:*" "ubuntu:*"
"hashicorp/*:*"
"koalaman/shellcheck:*"
"registry.gitlab.com/gitlab-org/*" "registry.gitlab.com/gitlab-org/*"
"registry.thehellings.com/*/*/*:*" "registry.thehellings.com/*/*/*:*"
"gitlab.shire-zebra.ts.net:5000/*/*/*:*" "gitlab.shire-zebra.ts.net:5000/*/*/*:*"
@@ -121,7 +82,7 @@ in
qemu = { qemu = {
executor = "shell"; executor = "shell";
limit = 5; limit = 5;
authenticationTokenConfigFile = config.age.secrets.runner-qemu.path; registrationConfigFile = config.age.secrets.runner-qemu.path;
environmentVariables = { environmentVariables = {
EFI_DIR = "${pkgs.OVMF.fd}/FV/"; EFI_DIR = "${pkgs.OVMF.fd}/FV/";
STORAGE_URL = "http://s3.thehellings.lan:9000"; STORAGE_URL = "http://s3.thehellings.lan:9000";
@@ -130,8 +91,8 @@ in
}; };
}; };
virtualisation = { virtualisation = {
docker.enable = true; podman.enable = true;
oci-containers.backend = "docker"; oci-containers.backend = "podman";
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
curl curl