Skip to content

Commit fc9073c

Browse files
committed
update: add comments for download-tokenizer and remove as dependecy to
build Signed-off-by: Wen Zhou <wenzhou@redhat.com>
1 parent 28f2999 commit fc9073c

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

Makefile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ BUILD_REF ?= $(shell git describe --abbrev=0 2>/dev/null)
8080
# go source files
8181
SRC = $(shell find . -type f -name '*.go')
8282

83-
# Tokenizer & Linking
83+
# DEPRECATED: Tokenizer & Linking flags (only used for legacy embedded tokenizer builds)
84+
# UDS builds don't need these flags - ZMQ linking is handled automatically via pkg-config
8485
LDFLAGS ?= -extldflags '-L$(LOCALLIB)'
8586
CGO_ENABLED=1
8687

@@ -111,7 +112,8 @@ endif
111112
PYTHON_CFLAGS := $(shell $(PYTHON_CONFIG) --cflags)
112113
PYTHON_LDFLAGS := $(shell $(PYTHON_CONFIG) --ldflags --embed)
113114

114-
# CGO flags with all dependencies
115+
# DEPRECATED: CGO flags with Python and tokenizers (only used for legacy embedded tokenizer builds)
116+
# The default UDS build only needs ZMQ
115117
CGO_CFLAGS := $(PYTHON_CFLAGS) '-I$(shell pwd)/lib'
116118
CGO_LDFLAGS := $(PYTHON_LDFLAGS) $(PYTHON_LIBS) '-L$(shell pwd)/lib' -ltokenizers -ldl -lm
117119

@@ -121,11 +123,12 @@ epp_IMAGE = $(EPP_IMAGE)
121123
sidecar_IMAGE = $(SIDECAR_IMAGE)
122124
epp_NAME = epp
123125
sidecar_NAME = $(SIDECAR_NAME)
124-
epp_LDFLAGS = -ldflags="$(LDFLAGS)"
126+
# Empty flags for UDS-only builds (ZMQ linking handled via pkg-config)
127+
epp_LDFLAGS =
125128
sidecar_LDFLAGS =
126-
epp_CGO_CFLAGS = "${CGO_CFLAGS}"
129+
epp_CGO_CFLAGS =
127130
sidecar_CGO_CFLAGS =
128-
epp_CGO_LDFLAGS = "${CGO_LDFLAGS}"
131+
epp_CGO_LDFLAGS =
129132
sidecar_CGO_LDFLAGS =
130133
epp_TEST_FILES = go list ./... | grep -v /test/ | grep -v ./pkg/sidecar/
131134
sidecar_TEST_FILES = go list ./pkg/sidecar/...
@@ -171,14 +174,14 @@ test: test-unit test-e2e ## Run all tests (unit and e2e)
171174
test-unit: test-unit-epp test-unit-sidecar ## Run unit tests
172175

173176
.PHONY: test-unit-%
174-
test-unit-%: download-tokenizer install-python-deps check-dependencies ## Run unit tests
177+
test-unit-%: check-dependencies ## Run unit tests
175178
@printf "\033[33;1m==== Running Unit Tests ====\033[0m\n"
176179
@KV_CACHE_PKG=$$(go list -m -f '{{.Dir}}/pkg/preprocessing/chat_completions' github.com/llm-d/llm-d-kv-cache 2>/dev/null || echo ""); \
177180
PYTHONPATH="$$KV_CACHE_PKG:$(VENV_DIR)/lib/python$(PYTHON_VERSION)/site-packages" \
178181
CGO_CFLAGS=${$*_CGO_CFLAGS} CGO_LDFLAGS=${$*_CGO_LDFLAGS} go test $($*_LDFLAGS) -v $$($($*_TEST_FILES) | tr '\n' ' ')
179182

180183
.PHONY: test-filter
181-
test-filter: download-tokenizer install-python-deps check-dependencies ## Run filtered unit tests (usage: make test-filter PATTERN=TestName TYPE=epp)
184+
test-filter: check-dependencies ## Run filtered unit tests (usage: make test-filter PATTERN=TestName TYPE=epp)
182185
@if [ -z "$(PATTERN)" ]; then \
183186
echo "ERROR: PATTERN is required. Usage: make test-filter PATTERN=TestName [TYPE=epp|sidecar]"; \
184187
exit 1; \
@@ -197,7 +200,7 @@ test-filter: download-tokenizer install-python-deps check-dependencies ## Run fi
197200
fi
198201

199202
.PHONY: test-integration
200-
test-integration: download-tokenizer check-dependencies ## Run integration tests
203+
test-integration: check-dependencies ## Run integration tests
201204
@printf "\033[33;1m==== Running Integration Tests ====\033[0m\n"
202205
go test -ldflags="$(LDFLAGS)" -v -tags=integration_tests ./test/integration/
203206

@@ -218,7 +221,7 @@ post-deploy-test: ## Run post deployment tests
218221
build: build-epp build-sidecar ## Build the project for both epp and sidecar
219222

220223
.PHONY: build-%
221-
build-%: check-go download-tokenizer ## Build the project
224+
build-%: check-go ## Build the project
222225
@printf "\033[33;1m==== Building ====\033[0m\n"
223226
CGO_CFLAGS=${$*_CGO_CFLAGS} CGO_LDFLAGS=${$*_CGO_LDFLAGS} go build $($*_LDFLAGS) -o bin/$($*_NAME) cmd/$($*_NAME)/main.go
224227

Makefile.tools.mk

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ VLLM_VERSION ?= 0.14.0
2222

2323
## Python Configuration
2424
PYTHON_VERSION ?= 3.12
25-
# Extract RELEASE_VERSION from Dockerfile
26-
TOKENIZER_VERSION ?= $(shell grep '^ARG RELEASE_VERSION=' Dockerfile.epp | cut -d'=' -f2)
25+
# DEPRECATED: Hardcoded tokenizer version for legacy embedded tokenizer support
26+
# Embedded tokenizers are deprecated. Use UDS tokenizer instead (see DEVELOPMENT.md)
27+
TOKENIZER_VERSION ?= v1.22.1
2728

2829
# Python executable for creating venv
2930
PYTHON_EXE := $(shell command -v python$(PYTHON_VERSION) || command -v python3)
@@ -143,14 +144,18 @@ install-dependencies: ## Install development dependencies based on OS/ARCH
143144
exit 1; \
144145
fi
145146

147+
## DEPRECATED: download-tokenizer target
148+
## This target downloads embedded tokenizer bindings (daulet/tokenizers) which are deprecated.
149+
## The project now uses UDS (Unix Domain Socket) tokenizers via a separate sidecar container.
146150
.PHONY: download-tokenizer
147151
download-tokenizer: $(TOKENIZER_LIB)
148152
$(TOKENIZER_LIB): | $(LOCALLIB)
149-
## Download the HuggingFace tokenizer bindings.
150-
@echo "Downloading HuggingFace tokenizer bindings for version $(TOKENIZER_VERSION)..."
153+
## Download the HuggingFace tokenizer bindings (DEPRECATED - use UDS tokenizer instead).
154+
@echo "WARNING: Downloading deprecated embedded tokenizer bindings for version $(TOKENIZER_VERSION)..."
155+
@echo "WARNING: Embedded tokenizers are deprecated. Use UDS tokenizer instead (see DEVELOPMENT.md)"
151156
@curl -L https://github.com/daulet/tokenizers/releases/download/$(TOKENIZER_VERSION)/libtokenizers.$(TARGETOS)-$(TOKENIZER_ARCH).tar.gz | tar -xz -C $(LOCALLIB)
152157
@ranlib $(LOCALLIB)/*.a
153-
@echo "Tokenizer bindings downloaded successfully."
158+
@echo "Tokenizer bindings downloaded successfully (DEPRECATED)."
154159

155160
.PHONY: detect-python
156161
detect-python: ## Detects Python and prints the configuration.

0 commit comments

Comments
 (0)