ci/cache: Prune profile generations
Explicitly remove expired generations from the nonstandard Harmonia profile before collecting garbage. This keeps old CI closures from remaining rooted until the cache exhausts its inodes.
This commit is contained in:
+4
-1
@@ -12,7 +12,10 @@ remote_cmd() {
|
|||||||
|
|
||||||
collect_garbage() {
|
collect_garbage() {
|
||||||
echo "Collecting garbage..."
|
echo "Collecting garbage..."
|
||||||
remote_cmd nix-collect-garbage --delete-older-than 60d
|
remote_cmd nix-env \
|
||||||
|
-p "$REMOTE_STORE"/nix/var/nix/profiles/nixfiles \
|
||||||
|
--delete-generations 60d
|
||||||
|
remote_cmd nix-collect-garbage
|
||||||
}
|
}
|
||||||
|
|
||||||
umask_old=$(umask)
|
umask_old=$(umask)
|
||||||
|
|||||||
+2
-2
@@ -223,8 +223,8 @@ Harmonia substituter as the boxes), runs `nix flake check --no-build`, then buil
|
|||||||
of `.#ci.x86_64-linux`: systems as `system-<name>`, homes as `home-<name>` (with `@` changed to
|
of `.#ci.x86_64-linux`: systems as `system-<name>`, homes as `home-<name>` (with `@` changed to
|
||||||
`-at-`), packages as `package-<name>`, and the development `shell`. Each result is pushed to the
|
`-at-`), packages as `package-<name>`, and the development `shell`. Each result is pushed to the
|
||||||
Harmonia cache with [`ci/push-to-cache.sh`](../ci/push-to-cache.sh). Before the first push, the
|
Harmonia cache with [`ci/push-to-cache.sh`](../ci/push-to-cache.sh). Before the first push, the
|
||||||
workflow collects cache paths older than its retention period so a full cache cannot prevent
|
workflow deletes cache-profile generations older than its retention period, then collects
|
||||||
collection from being reached.
|
unreachable paths so a full cache cannot prevent collection from being reached.
|
||||||
|
|
||||||
It then builds `.#ciDrv.x86_64-linux`, a `linkFarm` of all CI attributes, and pushes it with
|
It then builds `.#ciDrv.x86_64-linux`, a `linkFarm` of all CI attributes, and pushes it with
|
||||||
`UPDATE_PROFILE=1`. That updates the `nixfiles` profile on the cache box and collects old paths
|
`UPDATE_PROFILE=1`. That updates the `nixfiles` profile on the cache box and collects old paths
|
||||||
|
|||||||
Reference in New Issue
Block a user