From cbcf5148802fa167ae7b73e0b179c5e69a9f6d10 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 11 May 2026 13:25:11 +0000 Subject: [PATCH] test(e2e-backends): allow BACKEND_BINARY for native-built backends Adds an escape hatch for hardware-gated backends (e.g. ds4) where the model is too large for Docker build context. When BACKEND_BINARY points at a run.sh produced by 'make -C backend/cpp/ package', the suite skips docker image extraction and drives the binary directly. Signed-off-by: Ettore Di Giacinto --- tests/e2e-backends/backend_test.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/e2e-backends/backend_test.go b/tests/e2e-backends/backend_test.go index 605f32f70..5888ac5a7 100644 --- a/tests/e2e-backends/backend_test.go +++ b/tests/e2e-backends/backend_test.go @@ -194,7 +194,14 @@ var _ = Describe("Backend container", Ordered, func() { BeforeAll(func() { image := os.Getenv("BACKEND_IMAGE") - Expect(image).NotTo(BeEmpty(), "BACKEND_IMAGE env var must be set (e.g. local-ai-backend:llama-cpp)") + // BACKEND_BINARY is an escape hatch for hardware-gated backends (e.g. ds4) + // where building a full Docker image around an 80+ GB model is impractical. + // Points at a `run.sh` produced by `make -C backend/cpp/ package`. + binary := os.Getenv("BACKEND_BINARY") + Expect(image != "" || binary != "").To(BeTrue(), + "either BACKEND_IMAGE or BACKEND_BINARY env var must be set") + Expect(image != "" && binary != "").To(BeFalse(), + "BACKEND_IMAGE and BACKEND_BINARY are mutually exclusive") modelURL := os.Getenv("BACKEND_TEST_MODEL_URL") modelFile = os.Getenv("BACKEND_TEST_MODEL_FILE") @@ -223,10 +230,13 @@ var _ = Describe("Backend container", Ordered, func() { workDir, err = os.MkdirTemp("", "backend-e2e-*") Expect(err).NotTo(HaveOccurred()) - // Extract the image filesystem so we can run run.sh directly. - binaryDir = filepath.Join(workDir, "rootfs") - Expect(os.MkdirAll(binaryDir, 0o755)).To(Succeed()) - extractImage(image, binaryDir) + if image != "" { + binaryDir = filepath.Join(workDir, "rootfs") + Expect(os.MkdirAll(binaryDir, 0o755)).To(Succeed()) + extractImage(image, binaryDir) + } else { + binaryDir = filepath.Dir(binary) + } Expect(filepath.Join(binaryDir, "run.sh")).To(BeAnExistingFile()) // Download the model once if not provided and no HF name given.