Skip to content

Commit 7424dc8

Browse files
committed
ci(bump-deps): register ds4 + move version pin into the Makefile
The initial ds4 PR (#9758) put the upstream commit pin in backend/cpp/ds4/prepare.sh as a shell variable. The auto-bump bot at .github/bump_deps.sh greps for ^$VAR?= in a Makefile, so DS4_VERSION was invisible to it - other backends (llama-cpp, ik-llama-cpp, turboquant, voxtral, etc.) all pin in their Makefile. This change: - Moves DS4_VERSION?= and DS4_REPO?= to the top of backend/cpp/ds4/Makefile. - Inlines the git init/fetch/checkout recipe into the 'ds4:' target (matches llama-cpp's 'llama.cpp:' target pattern). Directory acts as the target so make only re-clones when missing. - Deletes the now-redundant prepare.sh. - Adds antirez/ds4 + DS4_VERSION + main + backend/cpp/ds4/Makefile to the .github/workflows/bump_deps.yaml matrix so the daily bot opens PRs against this pin. - Updates .agents/ds4-backend.md to point at the Makefile. Verified: $ grep -m1 '^DS4_VERSION?=' backend/cpp/ds4/Makefile DS4_VERSION?=ae302c2fa18cc6d9aefc021d0f27ae03c9ad2fc0 $ make -C backend/cpp/ds4 ds4 # clones into ds4/ at the pin $ make -C backend/cpp/ds4 ds4 # no-op on second invocation make: 'ds4' is up to date. Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent d892e4a commit 7424dc8

4 files changed

Lines changed: 42 additions & 43 deletions

File tree

.agents/ds4-backend.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ LocalAI wraps the engine's C API (`ds4/ds4.h`) with a fresh C++ gRPC server at
66

77
## Pin
88

9-
`backend/cpp/ds4/prepare.sh` clones `antirez/ds4` at `DS4_VERSION`. Bump that
10-
commit to follow upstream.
9+
`backend/cpp/ds4/Makefile` pins `DS4_VERSION?=<sha>` at the top. The `ds4`
10+
target in the Makefile clones `antirez/ds4` at that commit (mirroring the
11+
llama-cpp / ik-llama-cpp / turboquant pattern). The bump-deps bot
12+
(`.github/workflows/bump_deps.yaml`) finds this pin via grep and opens a
13+
daily PR to update it. To bump manually: edit the `DS4_VERSION?=` line,
14+
then `make purge && make` (or rely on CI's clean build).
1115

1216
## Wire shape
1317

.github/workflows/bump_deps.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
variable: "TURBOQUANT_VERSION"
2323
branch: "feature/turboquant-kv-cache"
2424
file: "backend/cpp/turboquant/Makefile"
25+
- repository: "antirez/ds4"
26+
variable: "DS4_VERSION"
27+
branch: "main"
28+
file: "backend/cpp/ds4/Makefile"
2529
- repository: "ggml-org/whisper.cpp"
2630
variable: "WHISPER_CPP_VERSION"
2731
branch: "master"

backend/cpp/ds4/Makefile

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# ds4 backend Makefile.
2-
CURDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
3-
DS4_DIR := $(CURDIR)ds4
4-
BUILD_DIR := $(CURDIR)build
2+
#
3+
# Upstream pin lives below as DS4_VERSION?= so the bump-deps bot
4+
# (.github/bump_deps.sh) can find and update it - matches the
5+
# llama-cpp / ik-llama-cpp / turboquant convention.
6+
7+
DS4_VERSION?=ae302c2fa18cc6d9aefc021d0f27ae03c9ad2fc0
8+
DS4_REPO?=https://github.com/antirez/ds4
9+
10+
CURRENT_MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
11+
BUILD_DIR := build
512

613
BUILD_TYPE ?=
714
NATIVE ?= false
@@ -27,37 +34,45 @@ ifneq ($(NATIVE),true)
2734
CMAKE_ARGS += -DDS4_NATIVE=OFF
2835
endif
2936

30-
.PHONY: prepare grpc-server package clean purge test all
37+
.PHONY: grpc-server package clean purge test all
3138
all: grpc-server
3239

33-
prepare:
34-
bash $(CURDIR)prepare.sh
40+
# Clone the upstream ds4 source at the pinned commit. Directory acts as the
41+
# target so make only re-clones when missing. After a DS4_VERSION bump,
42+
# run 'make purge && make' to refetch (or rely on CI's clean build).
43+
ds4:
44+
mkdir -p ds4
45+
cd ds4 && \
46+
git init -q && \
47+
git remote add origin $(DS4_REPO) && \
48+
git fetch --depth 1 origin $(DS4_VERSION) && \
49+
git checkout FETCH_HEAD
3550

3651
# Build ds4's engine object files via its own Makefile, which already encodes
3752
# the right per-platform compile flags (Objective-C/Metal on Darwin, nvcc on Linux+CUDA).
38-
$(DS4_DIR)/ds4.o: prepare
53+
ds4/ds4.o: ds4
3954
ifeq ($(BUILD_TYPE),cublas)
40-
+$(MAKE) -C $(DS4_DIR) ds4.o ds4_cuda.o
55+
+$(MAKE) -C ds4 ds4.o ds4_cuda.o
4156
else ifeq ($(UNAME_S),Darwin)
42-
+$(MAKE) -C $(DS4_DIR) ds4.o ds4_metal.o
57+
+$(MAKE) -C ds4 ds4.o ds4_metal.o
4358
else
44-
+$(MAKE) -C $(DS4_DIR) ds4_cpu.o
59+
+$(MAKE) -C ds4 ds4_cpu.o
4560
endif
4661

47-
grpc-server: $(DS4_DIR)/ds4.o
62+
grpc-server: ds4/ds4.o
4863
mkdir -p $(BUILD_DIR)
49-
cd $(BUILD_DIR) && cmake $(CMAKE_ARGS) -DDS4_DIR=$(DS4_DIR) $(CURDIR) && cmake --build . --config Release -j $(JOBS)
50-
cp $(BUILD_DIR)/grpc-server $(CURDIR)grpc-server
64+
cd $(BUILD_DIR) && cmake $(CMAKE_ARGS) $(CURRENT_MAKEFILE_DIR) && cmake --build . --config Release -j $(JOBS)
65+
cp $(BUILD_DIR)/grpc-server grpc-server
5166

5267
package: grpc-server
53-
bash $(CURDIR)package.sh
68+
bash package.sh
5469

5570
test:
5671
@echo "ds4 backend: e2e coverage at tests/e2e-backends/ (BACKEND_BINARY mode)"
5772

5873
clean:
59-
rm -rf $(BUILD_DIR) $(CURDIR)grpc-server $(CURDIR)package
60-
if [ -d $(DS4_DIR) ]; then $(MAKE) -C $(DS4_DIR) clean; fi
74+
rm -rf $(BUILD_DIR) grpc-server package
75+
if [ -d ds4 ]; then $(MAKE) -C ds4 clean; fi
6176

6277
purge: clean
63-
rm -rf $(DS4_DIR)
78+
rm -rf ds4

backend/cpp/ds4/prepare.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)