feat(ebook-search): set up uv cache management and pruning service
treefmt / nix fmt (pull_request) Successful in 5s
pytest / pytest (pull_request) Successful in 27s
test ebook search / test-ebook-search (pull_request) Successful in 34s
build_systems / build-brain (pull_request) Successful in 48s
build_systems / build-bob (pull_request) Successful in 50s
build_systems / build-rhapsody-in-green (pull_request) Successful in 1m3s
build_systems / build-jeeves (pull_request) Successful in 2m14s
treefmt / nix fmt (push) Successful in 4s
test ebook search / test-ebook-search (push) Successful in 27s
pytest / pytest (push) Successful in 30s
build_systems / build-brain (push) Successful in 34s
build_systems / build-bob (push) Successful in 37s
build_systems / build-jeeves (push) Successful in 2m9s
build_systems / build-rhapsody-in-green (push) Successful in 48s
treefmt / nix fmt (pull_request) Successful in 5s
pytest / pytest (pull_request) Successful in 27s
test ebook search / test-ebook-search (pull_request) Successful in 34s
build_systems / build-brain (pull_request) Successful in 48s
build_systems / build-bob (pull_request) Successful in 50s
build_systems / build-rhapsody-in-green (pull_request) Successful in 1m3s
build_systems / build-jeeves (pull_request) Successful in 2m14s
treefmt / nix fmt (push) Successful in 4s
test ebook search / test-ebook-search (push) Successful in 27s
pytest / pytest (push) Successful in 30s
build_systems / build-brain (push) Successful in 34s
build_systems / build-bob (push) Successful in 37s
build_systems / build-jeeves (push) Successful in 2m9s
build_systems / build-rhapsody-in-green (push) Successful in 48s
This commit was merged in pull request #40.
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./nix_builder.nix ];
|
||||
imports = [
|
||||
./nix_builder.nix
|
||||
./uv_cache_prune.nix
|
||||
];
|
||||
|
||||
services.nix_builder.containers = {
|
||||
nix-builder-00.enable = true;
|
||||
|
||||
@@ -62,6 +62,11 @@ in
|
||||
mountPoint = "/run/secrets/gitea-runners";
|
||||
isReadOnly = true;
|
||||
};
|
||||
uv-cache = {
|
||||
hostPath = vars.uv_cache;
|
||||
mountPoint = "/var/cache/uv";
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
config =
|
||||
{
|
||||
@@ -138,7 +143,6 @@ in
|
||||
nixos-rebuild
|
||||
nodejs
|
||||
treefmt
|
||||
uv
|
||||
wget
|
||||
];
|
||||
};
|
||||
@@ -154,14 +158,20 @@ in
|
||||
}
|
||||
) cfg.containers;
|
||||
|
||||
systemd.services = builtins.listToAttrs (
|
||||
map (name: {
|
||||
name = "container@${name}";
|
||||
value = {
|
||||
requires = [ "gitea.service" ];
|
||||
after = [ "gitea.service" ];
|
||||
};
|
||||
}) (builtins.attrNames (filterAttrs (_: c: c.enable) cfg.containers))
|
||||
);
|
||||
systemd = {
|
||||
services = builtins.listToAttrs (
|
||||
map (name: {
|
||||
name = "container@${name}";
|
||||
value = {
|
||||
requires = [ "gitea.service" ];
|
||||
after = [ "gitea.service" ];
|
||||
};
|
||||
}) (builtins.attrNames (filterAttrs (_: c: c.enable) cfg.containers))
|
||||
);
|
||||
|
||||
tmpfiles.rules = [
|
||||
"d ${vars.uv_cache} 0755 ${runnerUsername} ${runnerUsername} - -"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
vars = import ../vars.nix;
|
||||
runnerUsername = "gitea-runner";
|
||||
in
|
||||
{
|
||||
systemd = {
|
||||
services.uv-cache-prune = {
|
||||
description = "Prune the shared gitea runner uv cache";
|
||||
environment.UV_CACHE_DIR = vars.uv_cache;
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = runnerUsername;
|
||||
Group = runnerUsername;
|
||||
ExecStart = "${pkgs.uv}/bin/uv cache prune";
|
||||
};
|
||||
};
|
||||
|
||||
timers.uv-cache-prune = {
|
||||
description = "Monthly prune of the shared gitea runner uv cache";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-01 04:00:00";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -30,6 +30,7 @@ sudo zfs create media/secure/share -o mountpoint=/zfs/media/share -o exec=off
|
||||
# scratch datasets
|
||||
sudo zfs create scratch/kafka -o mountpoint=/zfs/scratch/kafka -o recordsize=1M
|
||||
sudo zfs create scratch/transmission -o mountpoint=/zfs/scratch/transmission -o recordsize=16k -o sync=disabled -o redundant_metadata=none
|
||||
sudo zfs create scratch/uv_cache -o mountpoint=/zfs/scratch/uv_cache
|
||||
|
||||
# storage datasets
|
||||
sudo zfs create storage/ollama -o recordsize=1M -o compression=zstd-19 -o sync=disabled
|
||||
|
||||
@@ -121,3 +121,9 @@ monthly = 2
|
||||
hourly = 0
|
||||
daily = 0
|
||||
monthly = 0
|
||||
|
||||
["scratch/uv_cache"]
|
||||
15_min = 2
|
||||
hourly = 0
|
||||
daily = 0
|
||||
monthly = 0
|
||||
|
||||
@@ -17,5 +17,6 @@ in
|
||||
transmission = "${zfs_storage}/transmission";
|
||||
ollama = "${zfs_storage}/ollama";
|
||||
transmission_scratch = "${zfs_scratch}/transmission";
|
||||
uv_cache = "${zfs_scratch}/uv_cache";
|
||||
kafka = "${zfs_scratch}/kafka";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user