fix(ci): build Bonsai backend images (#10939) (#10951)

fix(ci): build Bonsai backend images

Register the Bonsai C++ source path with the backend matrix filter so changes select its image jobs. Also make shared llama.cpp changes rebuild the Bonsai and Turboquant fork images in the actual matrix, not only their test flags.\n\nAssisted-by: Codex:gpt-5 [Codex]

Co-authored-by: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com>
This commit is contained in:
localai-org-maint-bot
2026-07-19 11:49:07 +02:00
committed by GitHub
parent b19afb192a
commit 09b85ee00e
2 changed files with 19 additions and 7 deletions

View File

@@ -6,6 +6,9 @@ which branched from upstream some commits earlier. Any upstream API change that
gRPC server depends on, but that the fork does not yet carry, is back-ported here as a
`*.patch` file and applied to the cloned fork checkout by `../apply-patches.sh`.
CI treats both this directory and `backend/cpp/llama-cpp/` as Bonsai inputs, since
the wrapper copies and builds the shared llama.cpp backend sources.
Rules:
- One upstream commit (or minimal hunk) per patch, named `NNNN-short-description.patch`.

View File

@@ -63,6 +63,11 @@ function inferBackendPath(item) {
// via a thin wrapper Makefile. Changes to either dir should retrigger it.
return `backend/cpp/turboquant/`;
}
if (item.dockerfile.endsWith("bonsai")) {
// bonsai is a llama.cpp fork that reuses backend/cpp/llama-cpp sources
// via a thin wrapper Makefile. Changes to either dir should retrigger it.
return `backend/cpp/bonsai/`;
}
if (item.dockerfile.endsWith("privacy-filter")) {
return `backend/cpp/privacy-filter/`;
}
@@ -119,6 +124,15 @@ function getAllBackendPaths() {
const allBackendPaths = getAllBackendPaths();
function backendChanged(backend, pathPrefix, changedFiles) {
if (changedFiles.some(file => file.startsWith(pathPrefix))) return true;
// Fork backends reuse backend/cpp/llama-cpp sources via thin wrappers;
// changes to either directory must retrigger their pipelines.
return (backend === "turboquant" || backend === "bonsai") &&
changedFiles.some(file => file.startsWith("backend/cpp/llama-cpp/"));
}
const token = process.env.GITHUB_TOKEN;
const octokit = new Octokit({ auth: token });
@@ -305,7 +319,7 @@ function emitFilteredMatrix(changedFiles) {
const filtered = includes.filter(item => {
const backendPath = inferBackendPath(item);
if (!backendPath) return false;
return changedFiles.some(file => file.startsWith(backendPath));
return backendChanged(item.backend, backendPath, changedFiles);
});
const filteredDarwin = includesDarwin.filter(item => {
@@ -337,12 +351,7 @@ function emitFilteredMatrix(changedFiles) {
// Per-backend boolean outputs
for (const [backend, pathPrefix] of allBackendPaths) {
let changed = changedFiles.some(file => file.startsWith(pathPrefix));
// turboquant reuses backend/cpp/llama-cpp sources via a thin wrapper;
// changes to either directory should retrigger its pipeline.
if (backend === "turboquant" && !changed) {
changed = changedFiles.some(file => file.startsWith("backend/cpp/llama-cpp/"));
}
const changed = backendChanged(backend, pathPrefix, changedFiles);
fs.appendFileSync(process.env.GITHUB_OUTPUT, `${backend}=${changed ? 'true' : 'false'}\n`);
}
}