Author SHA1 Message Date
Floweynt 9db09ba9d6 Merge branch 'master' into frcc-kvm
diff-pr / dix (pull_request) Successful in 6m50s
flake-check / flake-check (pull_request) Failing after 2m0s
lint / lint (pull_request) Failing after 1m51s
2026-09-10 11:33:34 -05:00
Floweynt 3e5e4cfc1d try fixing gitea ci: v15
diff-tag / dix (push) Successful in 6m9s
flake-check / flake-check (push) Failing after 1m56s
lint / lint (push) Failing after 1m42s
2026-09-10 11:29:01 -05:00
Floweynt 8c20c5850d try fixing gitea ci: v14
diff-tag / dix (push) Successful in 7m27s
flake-check / flake-check (push) Failing after 1m30s
lint / lint (push) Canceled after 1m37s
2026-09-10 11:18:31 -05:00
Floweynt df615ba3c1 try fixing gitea ci: v14
diff-tag / dix (push) Canceled after 1m4s
flake-check / flake-check (push) Canceled after 10s
lint / lint (push) Canceled after 3m44s
2026-09-10 11:13:32 -05:00
Floweynt b8d64efc11 try fixing gitea ci: v13
diff-tag / dix (push) Canceled after 15m6s
flake-check / flake-check (push) Failing after 23m52s
lint / lint (push) Canceled after 18m24s
2026-09-10 10:28:40 -05:00
Floweynt 7f3068f51c try fixing gitea ci: v12
diff-tag / dix (push) Failing after 6s
flake-check / flake-check (push) Failing after 6s
lint / lint (push) Failing after 4m51s
2026-09-10 10:09:33 -05:00
Floweynt fded1cd233 try fixing gitea ci: v11
diff-tag / dix (push) Failing after 6s
flake-check / flake-check (push) Failing after 6s
lint / lint (push) Failing after 6s
2026-09-10 10:06:23 -05:00
Floweynt b62ecdd957 try fixing gitea ci: v10
diff-tag / dix (push) Failing after 6s
flake-check / flake-check (push) Failing after 6s
lint / lint (push) Failing after 6s
2026-09-10 10:00:15 -05:00
Floweynt 0d08a1a521 try fixing gitea ci: v9
diff-tag / dix (push) Failing after 7s
flake-check / flake-check (push) Failing after 7s
lint / lint (push) Failing after 6s
2026-09-10 09:47:48 -05:00
Floweynt ea4fa7c55c try fixing gitea ci: v8
diff-tag / dix (push) Failing after 2s
flake-check / flake-check (push) Failing after 2s
lint / lint (push) Failing after 1s
2026-09-10 09:33:51 -05:00
Floweynt 7df803484d try fixing gitea ci: v7
diff-tag / dix (push) Failing after 2s
flake-check / flake-check (push) Failing after 1s
lint / lint (push) Failing after 2s
2026-09-10 09:21:05 -05:00
Floweynt 83a84fd0f4 try fixing gitea ci: v6
diff-tag / dix (push) Failing after 1s
flake-check / flake-check (push) Failing after 1s
lint / lint (push) Failing after 1s
2026-09-10 08:57:25 -05:00
Floweynt 15cae9a40d try fixing gitea ci: v5
diff-tag / dix (push) Failing after 0s
flake-check / flake-check (push) Failing after 0s
lint / lint (push) Failing after 0s
2026-09-09 23:48:01 -05:00
Floweynt 780bdb7c13 try fixing gitea ci: v4
diff-tag / dix (push) Failing after 1s
flake-check / flake-check (push) Failing after 0s
lint / lint (push) Failing after 0s
2026-09-09 23:19:28 -05:00
Floweynt 6e4c303ade try fixing gitea ci: v3
diff-tag / dix (push) Failing after 0s
flake-check / flake-check (push) Failing after 1s
lint / lint (push) Failing after 0s
2026-09-09 23:10:34 -05:00
Floweynt ed244dd9f3 try fixing gitea ci: v2
flake-check / flake-check (push) Canceled after 0s
lint / lint (push) Canceled after 0s
diff-tag / dix (push) Failing after 0s
2026-09-09 22:37:36 -05:00
Floweynt 8d61167757 try fixing gitea ci
flake-check / flake-check (push) Canceled after 0s
lint / lint (push) Canceled after 0s
diff-tag / dix (push) Failing after 1s
2026-09-09 22:22:17 -05:00
Floweynt 73187bcc9b test something
flake-check / flake-check (push) Canceled after 0s
lint / lint (push) Canceled after 0s
diff-tag / dix (push) Failing after 0s
2026-09-09 22:12:37 -05:00
Floweynt d3b1db7836 try and get CI workflow to work
flake-check / flake-check (push) Canceled after 0s
lint / lint (push) Canceled after 0s
diff-tag / dix (push) Failing after 0s
2026-09-09 20:11:43 -05:00
Autumn Liu 33ccab9ad4 frcc experiments
diff-pr / dix (pull_request) Canceled after 0s
flake-check / flake-check (pull_request) Canceled after 0s
lint / lint (pull_request) Canceled after 0s
2026-09-09 17:58:14 -05:00
12 changed files with 170 additions and 266 deletions
+10 -10
View File
@@ -19,18 +19,18 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: pick reporter
run: |
if [ "${{ github.event_name }}" = pull_request ]; then
echo "REPORTER=github-pr-review" >> "$GITHUB_ENV"
else
echo "REPORTER=local" >> "$GITHUB_ENV"
fi
- name: run linters
run: nix run -L .#ci -- lint . "$RUNNER_TEMP/findings"
- name: report findings
if: always()
env:
REVIEWDOG_GITEA_API_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_ADDRESS: ${{ github.server_url }}
run: |
if [ "${{ github.event_name }}" = pull_request ]; then
nix run -L .#ci -- lint-report gitea-pr-review "$RUNNER_TEMP/findings"
else
nix run -L .#ci -- lint-summary "$RUNNER_TEMP/findings" \
| tee -a "$GITHUB_STEP_SUMMARY"
fi
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: nix run -L .#ci -- lint-report "$REPORTER" "$RUNNER_TEMP/findings"
+5 -1
View File
@@ -5,6 +5,10 @@ on:
- cron: "0 6 * * 1"
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
scan:
runs-on: nix
@@ -21,7 +25,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API: ${{ github.api_url }}
REPO: ${{ github.repository }}
run: 'nix run -L .#ci -- upsert-issue vulnix "vulnix: known vulnerabilities in system closure" "$RUNNER_TEMP/issue.md"'
run: nix run -L .#ci -- upsert-issue vulnix "vulnix: known vulnerabilities in system closure" "$RUNNER_TEMP/issue.md"
- name: close resolved issue
if: steps.scan.outputs.count == '0'
-8
View File
@@ -1,17 +1,9 @@
{ lib, pkgs }:
let
# vulnix's bundled nix-2.34 broke its own --experimental-features detection
nixConf = pkgs.writeText "ci-nix.conf" "experimental-features = nix-command flakes";
in
# tools must track ci.py's subprocess calls; nix stays ambient (uses the
# runner's own nix, not a pinned one).
pkgs.writers.writePython3Bin "ci" {
flakeIgnore = [ "E501" ];
libraries = [ pkgs.python3Packages.subprocess-tee ];
makeWrapperArgs = [
"--set-default"
"NIX_USER_CONF_FILES"
(toString nixConf)
"--prefix"
"PATH"
":"
+6 -65
View File
@@ -6,7 +6,6 @@ import json
import os
import re
import subprocess
import subprocess_tee
import sys
import urllib.request
from collections import Counter
@@ -18,8 +17,7 @@ def run(*args, **kw):
def nix(*args):
# tee to stderr - stdout leaks into GITHUB_OUTPUT $() captures
return subprocess_tee.run(("nix", "--extra-experimental-features", "nix-command flakes", "-L", *args), check=True, text=True, stdout=sys.stderr).stdout
return run("nix", "--extra-experimental-features", "nix-command flakes", "-L", *args, check=True, stdout=subprocess.PIPE).stdout
def git(*args, check=True):
@@ -33,16 +31,13 @@ def gitea(method, path, body=None):
req.add_header("Authorization", f'token {os.environ["GH_TOKEN"]}')
if data is not None:
req.add_header("Content-Type", "application/json")
try:
with urllib.request.urlopen(req) as resp:
raw = resp.read()
except urllib.error.HTTPError as e:
sys.exit(f"gitea {method} {path}: {e.code} {e.reason}\n{e.read().decode()}")
with urllib.request.urlopen(req) as resp:
raw = resp.read()
return json.loads(raw) if raw else None
def find_open_issue(label):
issues = gitea("GET", f"/issues?state=open&type=issues&labels={label}")
issues = gitea("GET", f"/issues?state=open&labels={label}")
return issues[0] if issues else None
@@ -239,7 +234,7 @@ def format_vulnix(vulns):
for v in vulns:
for cve in v["affected_by"]:
score = v.get("cvssv3_basescore", {}).get(cve)
desc = v.get("description", {}).get(cve, "").replace("\n", " ").replace("|", "∣")
desc = v.get("description", {}).get(cve, "")
if len(desc) > 120:
desc = desc[:117] + "..."
rows.append((v["pname"], v["version"], cve, score, desc))
@@ -367,63 +362,10 @@ def lint_report(args):
codes = [reviewdog(f"{args.dir}/{name}", flags)
for name, flags in LINTERS
if os.path.isfile(f"{args.dir}/{name}") and os.path.getsize(f"{args.dir}/{name}") > 0]
if os.path.getsize(f"{args.dir}/{name}") > 0]
sys.exit(1 if any(codes) else 0)
def has_findings(path):
return os.path.isfile(path) and os.path.getsize(path) > 0
def fmt_rdjsonl(path):
lines = []
with open(path) as f:
for raw in f:
rec = json.loads(raw)
loc = rec["location"]
r = loc.get("range", {}).get("start")
pos = f"{loc['path']}:{r['line']}:{r['column']}" if r else loc["path"]
lines.append(f"- `{pos}`: {rec['message']}")
return "\n".join(lines)
def fmt_errfmt(path):
lines = []
with open(path) as f:
for raw in f:
parts = raw.strip().split(">", 1)
if len(parts) == 2:
lines.append(f"- `{parts[0]}:{parts[1].split(':', 3)[-1].strip()}`" if ":" in parts[1] else f"- `{raw.strip()}`")
elif raw.strip():
lines.append(f"- `{raw.strip()}`")
return "\n".join(lines)
def lint_summary(args):
sections = []
d = args.dir
if has_findings(f"{d}/nixfmt.diff"):
with open(f"{d}/nixfmt.diff") as f:
sections.append(f"## nixfmt\n\n```diff\n{f.read().rstrip()}\n```")
if has_findings(f"{d}/statix.errfmt"):
sections.append(f"## statix\n\n{fmt_errfmt(f'{d}/statix.errfmt')}")
if has_findings(f"{d}/deadnix.rdjsonl"):
sections.append(f"## deadnix\n\n{fmt_rdjsonl(f'{d}/deadnix.rdjsonl')}")
if has_findings(f"{d}/cycles.rdjsonl"):
sections.append(f"## systemd ordering cycles\n\n{fmt_rdjsonl(f'{d}/cycles.rdjsonl')}")
if sections:
print("\n\n".join(["# Lint findings"] + sections))
sys.exit(1)
else:
print("No lint findings.")
sys.exit(0)
def post_comment(args):
body = args.marker + "\n" + Path(args.body_file).read_text()
pr = os.environ["PR"]
@@ -496,7 +438,6 @@ def main():
command("vulnix", vulnix, "ref", "body_out")
command("lint", lint, "target", "out")
command("lint-report", lint_report, "reporter", "dir")
command("lint-summary", lint_summary, "dir")
command("post-comment", post_comment, "marker", "body_file")
command("upsert-issue", upsert_issue, "label", "title", "body_file")
command("close-issue", close_issue, "label")
+1 -1
View File
@@ -381,6 +381,6 @@ let
};
};
};
inherit (c) hostAddr;
hostAddr = c.hostAddr;
in
c
+131 -165
View File
@@ -55,179 +55,145 @@ in
net.expose.tcp = [ 3000 ];
};
ci-runner =
mkVm {
name = "ci-runner";
includedInTests = false;
net.access = [
{
to = "git";
tcp = [ 3000 ];
}
{ to = "@internet"; }
];
svc.autoStart = true;
resources.cpu = 4;
resources.mem = "32G";
resources.fs = [
{
proto = "virtiofs";
tag = "nix-rw-store";
source = "${ciRunnerData}/nix-rw-store";
mountPoint = "/nix/.rw-store";
}
{
proto = "virtiofs";
tag = "nix-db";
source = "${ciRunnerData}/nix-db";
mountPoint = "/nix/var/nix/db";
}
{
proto = "virtiofs";
tag = "docker-data";
source = "${ciRunnerData}/docker";
mountPoint = "/var/lib/docker";
}
{
proto = "virtiofs";
tag = "runner-state";
source = "${ciRunnerData}/runner-state";
mountPoint = "/var/lib/private/gitea-runner";
}
{
proto = "virtiofs";
tag = "runner-token";
source = ciRunnerSecrets;
mountPoint = "/run/ci-runner-secrets";
readOnly = true;
}
{
proto = "virtiofs";
tag = "tmp";
source = "/tmp";
mountPoint = "/tmp";
}
];
guestConfig =
{
pkgs,
utils,
lib,
...
}:
let
runnerInstanceName = "ci-runner";
ci-runner = mkVm {
name = "ci-runner";
includedInTests = false;
net.access = [
{
to = "git";
tcp = [ 3000 ];
}
{ to = "@internet"; }
];
svc.autoStart = true;
resources.cpu = 4;
resources.mem = "32G";
resources.fs = [
{
proto = "virtiofs";
tag = "nix-rw-store";
source = "${ciRunnerData}/nix-rw-store";
mountPoint = "/nix/.rw-store";
}
{
proto = "virtiofs";
tag = "docker-data";
source = "${ciRunnerData}/docker";
mountPoint = "/var/lib/docker";
}
{
proto = "virtiofs";
tag = "runner-state";
source = "${ciRunnerData}/runner-state";
mountPoint = "/var/lib/private/gitea-runner";
}
{
proto = "virtiofs";
tag = "runner-token";
source = ciRunnerSecrets;
mountPoint = "/run/ci-runner-secrets";
readOnly = true;
}
];
guestConfig =
{
pkgs,
utils,
lib,
...
}:
let
runnerInstanceName = "ci-runner";
ciJobContents = with pkgs; [
bashInteractive
coreutils
gitMinimal
nixVersions.latest
nodejs
cacert
(writeTextDir "etc/nix/nix.conf" "experimental-features = nix-command flakes\n")
];
ciJobContents = with pkgs; [
bashInteractive
coreutils
gitMinimal
nixVersions.latest
nodejs
cacert
(writeTextDir "etc/nix/nix.conf" "experimental-features = nix-command flakes\n")
];
ciJobImage = pkgs.dockerTools.buildLayeredImage {
name = "ci-job-image";
tag = "latest";
contents = ciJobContents;
config = {
Cmd = [ "/bin/sh" ];
Env = [
"PATH=${lib.makeBinPath ciJobContents}"
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
"NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
"NIX_REMOTE=daemon"
];
};
ciJobImage = pkgs.dockerTools.buildLayeredImage {
name = "ci-job-image";
tag = "latest";
contents = ciJobContents;
config = {
Cmd = [ "/bin/sh" ];
Env = [
"PATH=${lib.makeBinPath ciJobContents}"
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
"NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
"NIX_REMOTE=daemon"
];
};
in
{
boot.kernelModules = [ "kvm-intel" ];
boot.extraModprobeConfig = "options kvm_intel nested=1";
};
in
{
boot.kernelModules = [ "kvm-intel" ];
boot.extraModprobeConfig = "options kvm_intel nested=1";
# volume-mounted into CI containers; must be in VM's store so
# image symlinks (/bin/node etc.) resolve through the mount
system.extraDependencies = ciJobContents;
# volume-mounted into CI containers; must be in VM's store so
# image symlinks (/bin/node etc.) resolve through the mount
system.extraDependencies = ciJobContents;
microvm.writableStoreOverlay = "/nix/.rw-store";
microvm.writableStoreOverlay = "/nix/.rw-store";
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
max-jobs = "auto";
};
nix.gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 14d";
};
# nix.optimise.automatic = true; - doesn't work with microvm.writableStoreOverlay
services.journald.extraConfig = "ForwardToConsole=yes";
virtualisation.containerd.enable = true;
virtualisation.containerd.settings.plugins."io.containerd.snapshotter.v1.overlayfs".mount_options = [ "userxattr" ];
virtualisation.docker.enable = true;
virtualisation.docker.extraOptions = "--containerd /run/containerd/containerd.sock";
systemd.services.docker.wants = [ "containerd.service" ];
systemd.services.docker.after = [ "containerd.service" ];
systemd.services.load-ci-job-image = {
description = "Load the CI job Docker image";
wantedBy = [ "multi-user.target" ];
after = [ "docker.service" ];
requires = [ "docker.service" ];
before = [ "gitea-runner-${utils.escapeSystemdPath runnerInstanceName}.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${lib.getExe' pkgs.docker "docker"} load -i ${ciJobImage}";
};
};
services.gitea-actions-runner.instances.${runnerInstanceName} = {
enable = true;
name = runnerInstanceName;
url = "http://git:3000/";
tokenFile = "/run/ci-runner-secrets/token";
labels = [
"nix:docker://ci-job-image:latest"
];
settings.container = {
options = "--device=/dev/kvm --volume=/nix/store:/nix/store:ro --volume=/nix/var/nix/daemon-socket:/nix/var/nix/daemon-socket";
valid_volumes = [
"/nix/store"
"/nix/var/nix/daemon-socket"
];
max-jobs = "auto";
substituters = [ "https://microvm.cachix.org" ];
trusted-public-keys = [ "microvm.cachix.org-1:oXnBc6hRE3eX5rSYdRyMYXnfzcCxC7yKPTbZXALsqys=" ];
};
nix.settings = {
min-free = 5 * 1024 * 1024 * 1024;
max-free = 10 * 1024 * 1024 * 1024;
};
# nix.optimise.automatic = true; - doesn't work with microvm.writableStoreOverlay
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "yes";
PermitEmptyPasswords = "yes";
};
};
users.users.root.initialHashedPassword = "";
services.journald.extraConfig = "ForwardToConsole=yes";
virtualisation.containerd.enable = true;
virtualisation.containerd.settings.plugins."io.containerd.snapshotter.v1.overlayfs".mount_options =
[ "userxattr" ];
virtualisation.docker.enable = true;
virtualisation.docker.extraOptions = "--containerd /run/containerd/containerd.sock";
virtualisation.docker.daemon.settings.exec-opts = [ "native.cgroupdriver=cgroupfs" ];
systemd.services.docker.wants = [ "containerd.service" ];
systemd.services.docker.after = [ "containerd.service" ];
systemd.services.load-ci-job-image = {
description = "Load the CI job Docker image";
wantedBy = [ "multi-user.target" ];
after = [ "docker.service" ];
requires = [ "docker.service" ];
before = [ "gitea-runner-${utils.escapeSystemdPath runnerInstanceName}.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${lib.getExe' pkgs.docker "docker"} load -i ${ciJobImage}";
};
};
services.gitea-actions-runner.instances.${runnerInstanceName} = {
enable = true;
name = runnerInstanceName;
url = "http://git:3000/";
tokenFile = "/run/ci-runner-secrets/token";
labels = [
"nix:docker://ci-job-image:latest"
];
settings.container = {
options = "--device=/dev/kvm --volume=/nix/store:/nix/store:ro --volume=/nix/var/nix/daemon-socket:/nix/var/nix/daemon-socket";
valid_volumes = [
"/nix/store"
"/nix/var/nix/daemon-socket"
];
};
};
};
}
// {
hostConfig = {
systemd.tmpfiles.rules = [
"d ${ciRunnerData}/nix-rw-store 0755 server server -"
"d ${ciRunnerData}/nix-db 0755 server server -"
"d ${ciRunnerData}/docker 0755 server server -"
"d ${ciRunnerData}/runner-state 0755 server server -"
];
};
};
};
}
+1 -1
View File
@@ -210,6 +210,6 @@ let
};
inherit (setup) containerConfig;
};
inherit (c) hostAddr;
hostAddr = c.hostAddr;
in
c
+3 -5
View File
@@ -67,10 +67,7 @@ let
inherit name;
inherit net resources;
svc.autoStart = true;
isolation = {
inherit nixDaemon;
}
// isolation;
isolation = { nixDaemon = nixDaemon; } // isolation;
traits = [ sshTrait ] ++ traits;
packages = with pkgs; [ tmux ] ++ packages;
miscProperties = self._sshpiperRegister routingInfo;
@@ -80,7 +77,8 @@ let
containerConfig =
{ pkgs, ... }:
{
users.users.runner.extraGroups = [ "kvm" ];
users.users.runner.extraGroups = [ "wheel" ];
security.sudo.wheelNeedsPassword = false;
environment.systemPackages = [ pkgs.qemu_kvm ];
};
};
+1 -4
View File
@@ -572,10 +572,7 @@ rec {
Gateway = hostAddr;
};
networkConfig.DNS = [ hostAddr ];
networkConfig.Domains = [
"~."
"containers"
];
networkConfig.Domains = [ "~." "containers" ];
linkConfig.RequiredForOnline = if allowInternet then "routable" else "degraded";
};
networking.enableIPv6 = false;
+5 -4
View File
@@ -129,10 +129,11 @@
{
nixosConfigurations = lib.mapAttrs (_: host: host.hostCfg) allHosts;
inspect = lib.mapAttrs (
name: host:
pkgs.writeText "inspect-${name}.json" (builtins.toJSON (introspect.hostReport { inherit host; }))
) allHosts;
inspect = lib.mapAttrs
(name: host:
pkgs.writeText "inspect-${name}.json"
(builtins.toJSON (introspect.hostReport { inherit host; })))
allHosts;
packages.${system} = customPkgs // {
inherit ci;
+6 -1
View File
@@ -205,7 +205,12 @@ with subtest("(isolation): edges are one-way"):
server.fail(ct_connect("git", ADDR["nginx"], 443, timeout=2))
with subtest("(isolation): host access allowlist"):
server.succeed(ct_connect("overseer", HOST_ADDR["overseer"], HOST_EXPORTER_PORT))
server.succeed(
net_cmd(
"overseer",
f"{CURL} -sf --max-time 5 http://{HOST_ADDR['overseer']}:{HOST_EXPORTER_PORT}/metrics >&2",
)
)
for port in (HOST_EXPORTER_PORT, HOST_CADVISOR_PORT):
server.fail(ct_connect("git", HOST_ADDR["git"], port, timeout=2))
server.fail(ct_connect("git", HOST_ADDR["overseer"], port, timeout=2))