cleanup drv gcroots after a build
This commit is contained in:
parent
25e583ea9e
commit
3c1e2c0e76
|
@ -377,6 +377,9 @@ def nix_eval_config(
|
||||||
haltOnFailure=True,
|
haltOnFailure=True,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
drv_gcroots_dir = util.Interpolate(
|
||||||
|
"/nix/var/nix/gcroots/per-user/buildbot-worker/%(prop:project)s/drvs/",
|
||||||
|
)
|
||||||
|
|
||||||
factory.addStep(
|
factory.addStep(
|
||||||
NixEvalCommand(
|
NixEvalCommand(
|
||||||
|
@ -393,8 +396,7 @@ def nix_eval_config(
|
||||||
"accept-flake-config",
|
"accept-flake-config",
|
||||||
"true",
|
"true",
|
||||||
"--gc-roots-dir",
|
"--gc-roots-dir",
|
||||||
# FIXME: don't hardcode this
|
drv_gcroots_dir,
|
||||||
"/var/lib/buildbot-worker/gcroot",
|
|
||||||
"--force-recurse",
|
"--force-recurse",
|
||||||
"--check-cache-status",
|
"--check-cache-status",
|
||||||
"--flake",
|
"--flake",
|
||||||
|
@ -405,6 +407,17 @@ def nix_eval_config(
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
factory.addStep(
|
||||||
|
steps.ShellCommand(
|
||||||
|
name="Cleanup drv paths",
|
||||||
|
command=[
|
||||||
|
"rm",
|
||||||
|
"-rf",
|
||||||
|
drv_gcroots_dir,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
return util.BuilderConfig(
|
return util.BuilderConfig(
|
||||||
name=f"{project.name}/nix-eval",
|
name=f"{project.name}/nix-eval",
|
||||||
workernames=worker_names,
|
workernames=worker_names,
|
||||||
|
|
|
@ -234,8 +234,11 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
# delete legacy gcroot location, can be dropped after 2024-06-01
|
||||||
|
"R /var/lib/buildbot-worker/gcroot - - - - -"
|
||||||
|
] ++ lib.optional (cfg.outputsPath != null)
|
||||||
# Allow buildbot-master to write to this directory
|
# Allow buildbot-master to write to this directory
|
||||||
systemd.tmpfiles.rules = lib.optional (cfg.outputsPath != null)
|
|
||||||
"d ${cfg.outputsPath} 0755 buildbot buildbot - -";
|
"d ${cfg.outputsPath} 0755 buildbot buildbot - -";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue