Yifei Sun
Inria, ENS de Lyon, Université Grenoble Alpes
I started a project
Environment setup and collboration
Development, deployment and benchmark
Peer review
NixOS VM tests
NixOS Compose
Pull packages from pinned nixpkgs
devShells.x86_64-linux.default = pkgs.mkShell {
inputsFrom = [ <locally defined derivations> ];
packages = with pkgs.llvmPackages; [ clang-unwrapped libllvm ];
};
pkgs.testers.runNixOSTest {
name = "one-machine-test";
nodes.machine1 = {
imports = [ nixosModules.kernel ];
services.scx.enable = true;
};
testScript = ''
machine1.wait_for_unit("default.target")
machine1.succeed("")
machine1.fail("")
'';
}
pkgs.testers.runNixOSTest {
name = "lots-of-machine-test";
nodes.machine1.imports = [ nixosModules.grafana ];
nodes.machine2.imports = with nixosModules; [
kernel exporter ebpf benchmark
];
testScript = ''
start_all()
machine1...
machine2...
'';
}
Say we want to troll ourselves:
SEC("ksyscall/statx")
int BPF_KSYSCALL(fsd_statx_entry, ... statx(2) args) {
// generate a map entry to collect start ts
// check path, if not match return
// else override with a static statx content
struct statx stx = { ... };
bpf_probe_write_user(statxbuf, &stx, sizeof(stx));
return bpf_override_return(ctx, 0);
}
And count how many times we can footgun ourselves
With a counter and a histogram
ebpf_exporter)For simplicity
We will be using a readily available userspace tool
Complication is fast
Debugging is easy
Build interactive driver closure
nom build .#checks.x86_64-linux.default.driverInteractive
Start the driver
$ ./result/bin/nixos-test-driver
start vlan
running vlan (pid 3859017; ctl /run/user/1000/vde1.ctl)
SSH backdoor enabled, the machines can be accessed like this:
collector: ssh -o User=root vsock/3
exporter: ssh -o User=root vsock/4
Bit-perfect reproducibility (*: for some store paths)
Everything is in closure
Build deployment closure (instrumented with NixOS test)
nxc build
Schedule couple machines and deploy the closure to cluster