2024-07-18 16:57:05 +02:00
|
|
|
{ pkgs }:
|
|
|
|
let
|
|
|
|
#hello = pkgs.hello.overrideAttrs { pname = "custom-hello"; };
|
|
|
|
inherit (pkgs) hello;
|
|
|
|
references = pkgs.runCommandNoCC "hello-refs" {
|
|
|
|
exportReferencesGraph.hello = hello;
|
|
|
|
__structuredAttrs = true;
|
|
|
|
nativeBuildInputs = [ pkgs.jq ];
|
|
|
|
} "jq -r \"{closure : .hello}\" < .attrs.json > $out"; # "jq -r '.hello' < .attrs.json > $out";
|
|
|
|
in
|
|
|
|
pkgs.testers.runNixOSTest (_: {
|
2024-07-20 15:59:30 +02:00
|
|
|
name = "ingestion with tvix copy";
|
2024-07-18 16:57:05 +02:00
|
|
|
nodes = {
|
2024-07-19 10:51:57 +02:00
|
|
|
cache = {
|
|
|
|
imports = [
|
|
|
|
./common
|
|
|
|
../modules
|
|
|
|
];
|
2024-07-18 16:57:05 +02:00
|
|
|
|
2024-07-19 10:51:57 +02:00
|
|
|
system.extraDependencies = [
|
|
|
|
hello
|
|
|
|
references
|
|
|
|
];
|
2024-07-18 16:57:05 +02:00
|
|
|
|
2024-07-19 10:51:57 +02:00
|
|
|
services.tvix-binary-cache = {
|
|
|
|
enable = true;
|
|
|
|
enableNginx = true;
|
|
|
|
nginx = {
|
|
|
|
clientMaxBodySize = "50G";
|
|
|
|
host = "cache";
|
2024-07-18 16:57:05 +02:00
|
|
|
};
|
2024-07-19 10:51:57 +02:00
|
|
|
caches = {
|
|
|
|
cache.port = 8000;
|
2024-07-18 16:57:05 +02:00
|
|
|
};
|
|
|
|
};
|
2024-07-19 10:51:57 +02:00
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ 80 ];
|
|
|
|
};
|
2024-07-18 16:57:05 +02:00
|
|
|
};
|
|
|
|
testScript = ''
|
|
|
|
import time
|
|
|
|
start_all()
|
|
|
|
cache.wait_for_unit("nginx.service")
|
2024-07-20 18:22:43 +02:00
|
|
|
cache.wait_for_unit("tvix-store-cache.service")
|
2024-07-18 16:57:05 +02:00
|
|
|
time.sleep(1)
|
2024-07-20 15:59:30 +02:00
|
|
|
socket_addr = "grpc+unix:///run/tvix-store-cache/socket"
|
2024-07-18 16:57:05 +02:00
|
|
|
cache.succeed(f"BLOB_SERVICE_ADDR={socket_addr} DIRECTORY_SERVICE_ADDR={socket_addr} PATH_INFO_SERVICE_ADDR={socket_addr} tvix-store copy ${builtins.toString references}")
|
|
|
|
'';
|
|
|
|
})
|