mirror of
https://github.com/mudler/LocalAI.git
synced 2026-09-28 09:05:05 -04:00
fix(ci): treat .docker/ as a shared build input
#11346 changed how ROCm llama.cpp compiles and built nothing. It touched .docker/llama-cpp-build-target.sh and scripts/build/llama-cpp-build-target_test.sh, no SHARED_BUILD_INPUTS rule matched either (the second is carved out on purpose), so the filter selected zero entries and all six backend job groups reported "skipping". The fix shipped to master unvalidated. .docker/ holds the per-backend compile and build-target scripts for llama-cpp, turboquant, bonsai and ik-llama-cpp, plus inputs every Dockerfile consumes (apt-mirror.sh, install-base-deps.sh). Those files decide how a backend is compiled, so a change to one can only be validated by rebuilding it. Take the same posture the scripts/build/ catch-all already takes, and for the reason its comment already gives: a shared build input silently shipping to nothing is the failure this list exists to prevent. A rule sees only the matrix entry, not which file matched it, so narrowing .docker/<name>-compile.sh to the backend named by its prefix would mean threading the filename through matchedSharedRules. Not worth it for files edited a handful of times a release. Two regression tests, both verified red against the unfixed filter: one asserting a .docker/ compile script selects the backend it compiles, one asserting a shared .docker/ input takes the full matrix. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude Code:claude-opus-5 [Read] [Edit] [Bash]
This commit is contained in:
1 parent
8f52437c81
commit
ea456e7027
2 files changed
+44
No files matched your search
@@ -436,6 +436,27 @@ export const SHARED_BUILD_INPUTS = [
|
||||
linux: always,
|
||||
darwin: always,
|
||||
},
|
||||
{
|
||||
// Same posture as the scripts/build/ catch-all above, and for the same
|
||||
// reason. .docker/ holds the per-backend compile and build-target scripts
|
||||
// (llama-cpp, turboquant, bonsai, ik-llama-cpp) plus inputs every
|
||||
// Dockerfile consumes (apt-mirror.sh, install-base-deps.sh). Nothing
|
||||
// matched any of them before, which is how #11346 shipped without a single
|
||||
// backend job: it changed how ROCm llama.cpp compiles, touching only
|
||||
// .docker/llama-cpp-build-target.sh and a `*_test.sh` that the rule above
|
||||
// deliberately carves out, so the filter selected zero entries and every
|
||||
// backend job reported "skipping".
|
||||
//
|
||||
// A rule cannot see which file matched it, only the matrix entry, so
|
||||
// narrowing `.docker/<name>-compile.sh` to the backend named by its prefix
|
||||
// would mean threading the filename through matchedSharedRules. Until
|
||||
// someone wants that, take the full matrix: these files are edited a
|
||||
// handful of times a release, and a shared build input silently shipping
|
||||
// to nothing is the failure this list exists to prevent.
|
||||
matches: file => file.startsWith(".docker/"),
|
||||
linux: always,
|
||||
darwin: always,
|
||||
},
|
||||
];
|
||||
|
||||
// The matrix stores dockerfiles as "./backend/Dockerfile.python"; changed-file
|
||||
|
||||
@@ -204,6 +204,29 @@ test("an unclassified scripts/build/ file conservatively rebuilds everything", (
|
||||
assert.equal(filteredDarwin.length, includesDarwin.length);
|
||||
});
|
||||
|
||||
// #11346 changed how ROCm llama.cpp compiles and built nothing: it touched only
|
||||
// .docker/llama-cpp-build-target.sh and a *_test.sh, no rule matched either, so
|
||||
// every backend job reported "skipping".
|
||||
test("a .docker/ compile script rebuilds the backends it compiles", () => {
|
||||
const { filtered } = run([
|
||||
".docker/llama-cpp-build-target.sh",
|
||||
"scripts/build/llama-cpp-build-target_test.sh",
|
||||
]);
|
||||
|
||||
assert.ok(filtered.length > 0, ".docker/ change selected no entries");
|
||||
assert.ok(
|
||||
filtered.some(e => e.backend === "llama-cpp"),
|
||||
"llama-cpp was not selected by a change to its own compile script",
|
||||
);
|
||||
});
|
||||
|
||||
test("a shared .docker/ input rebuilds everything", () => {
|
||||
const { filtered, filteredDarwin } = run([".docker/apt-mirror.sh"]);
|
||||
|
||||
assert.equal(filtered.length, includes.length);
|
||||
assert.equal(filteredDarwin.length, includesDarwin.length);
|
||||
});
|
||||
|
||||
test("tests for the packaging scripts do not rebuild anything", () => {
|
||||
const { filtered, filteredDarwin } = run([
|
||||
"scripts/build/package-gpu-libs_test.sh",
|
||||
|
||||
Reference in new issue
Block a user