@@ -10,26 +10,12 @@ GINKGO = $(LOCALBIN)/ginkgo
1010GOLANGCI_LINT = $(LOCALBIN ) /golangci-lint
1111KUSTOMIZE = $(LOCALBIN ) /kustomize
1212TYPOS = $(LOCALBIN ) /typos
13- # # Dependencies
14- TOKENIZER_LIB = $(LOCALLIB ) /libtokenizers.a
1513
1614# # Tool fixed versions.
1715GINKGO_VERSION ?= v2.27.2
1816GOLANGCI_LINT_VERSION ?= v2.8.0
1917KUSTOMIZE_VERSION ?= v5.5.0
2018TYPOS_VERSION ?= v1.34.0
21- VLLM_VERSION ?= 0.14.0
22-
23- # # Python Configuration
24- PYTHON_VERSION ?= 3.12
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
28-
29- # Python executable for creating venv
30- PYTHON_EXE := $(shell command -v python$(PYTHON_VERSION ) || command -v python3)
31- VENV_DIR := $(shell pwd) /build/venv
32- VENV_BIN := $(VENV_DIR ) /bin
3319
3420# # go-install-tool will 'go install' any package with custom target and version.
3521define go-install-tool
4834# #@ Tools
4935
5036.PHONY : install-tools
51- install-tools : install-ginkgo install-golangci-lint install-kustomize install-typos install-dependencies download-tokenizer # # Install all development tools and dependencies
37+ install-tools : install-ginkgo install-golangci-lint install-kustomize install-typos install-dependencies # # Install all development tools and dependencies
5238 @echo " All development tools and dependencies are installed."
5339
5440.PHONY : install-ginkgo
@@ -80,12 +66,12 @@ $(TYPOS): | $(LOCALBIN)
8066check-dependencies : # # Check if development dependencies are installed
8167 @if [ " $( TARGETOS) " = " linux" ]; then \
8268 if [ -x " $$ (command -v apt)" ]; then \
83- if ! dpkg -s libzmq3-dev > /dev/null 2>&1 || ! dpkg -s g++ > /dev/null 2>&1 || ! dpkg -s python $( PYTHON_VERSION ) -dev > /dev/null 2>&1 ; then \
69+ if ! dpkg -s libzmq3-dev > /dev/null 2>&1 || ! dpkg -s g++ > /dev/null 2>&1 ; then \
8470 echo " ERROR: Missing dependencies. Please run 'sudo make install-dependencies'" ; \
8571 exit 1; \
8672 fi ; \
8773 elif [ -x " $$ (command -v dnf)" ]; then \
88- if ! rpm -q zeromq-devel > /dev/null 2>&1 || ! rpm -q gcc-c++ > /dev/null 2>&1 || ! rpm -q python $( PYTHON_VERSION ) -devel > /dev/null 2>&1 ; then \
74+ if ! rpm -q zeromq-devel > /dev/null 2>&1 || ! rpm -q gcc-c++ > /dev/null 2>&1 ; then \
8975 echo " ERROR: Missing dependencies. Please run 'sudo make install-dependencies'" ; \
9076 exit 1; \
9177 fi ; \
@@ -110,21 +96,21 @@ install-dependencies: ## Install development dependencies based on OS/ARCH
11096 @echo " Checking and installing development dependencies..."
11197 @if [ " $( TARGETOS) " = " linux" ]; then \
11298 if [ -x " $$ (command -v apt)" ]; then \
113- if ! dpkg -s libzmq3-dev > /dev/null 2>&1 || ! dpkg -s g++ > /dev/null 2>&1 || ! dpkg -s python $( PYTHON_VERSION ) -dev > /dev/null 2>&1 ; then \
99+ if ! dpkg -s libzmq3-dev > /dev/null 2>&1 || ! dpkg -s g++ > /dev/null 2>&1 ; then \
114100 echo " Installing dependencies with apt..." ; \
115- apt-get update && apt-get install -y libzmq3-dev g++ python $( PYTHON_VERSION ) -dev ; \
101+ apt-get update && apt-get install -y libzmq3-dev g++; \
116102 else \
117- echo " ✅ ZMQ, g++, and Python dev headers are already installed." ; \
103+ echo " ✅ ZMQ and g++ are already installed." ; \
118104 fi ; \
119105 elif [ -x " $$ (command -v dnf)" ]; then \
120- if ! rpm -q zeromq-devel > /dev/null 2>&1 || ! rpm -q gcc-c++ > /dev/null 2>&1 || ! rpm -q python $( PYTHON_VERSION ) -devel > /dev/null 2>&1 ; then \
106+ if ! rpm -q zeromq-devel > /dev/null 2>&1 || ! rpm -q gcc-c++ > /dev/null 2>&1 ; then \
121107 echo " Installing dependencies with dnf..." ; \
122- dnf install -y zeromq-devel gcc-c++ python $( PYTHON_VERSION ) -devel ; \
108+ dnf install -y zeromq-devel gcc-c++; \
123109 else \
124- echo " ✅ ZMQ, gcc-c++, and Python dev headers are already installed." ; \
110+ echo " ✅ ZMQ and gcc-c++ are already installed." ; \
125111 fi ; \
126112 else \
127- echo " ERROR: Unsupported Linux package manager. Install libzmq, g++/gcc-c++, and python-devel manually." ; \
113+ echo " ERROR: Unsupported Linux package manager. Install libzmq and g++/gcc-c++ manually." ; \
128114 exit 1; \
129115 fi ; \
130116 elif [ " $( TARGETOS) " = " darwin" ]; then \
@@ -133,7 +119,7 @@ install-dependencies: ## Install development dependencies based on OS/ARCH
133119 echo " Installing dependencies with brew..." ; \
134120 brew install zeromq pkg-config; \
135121 else \
136- echo " ✅ ZeroMQ and pkgconf are already installed." ; \
122+ echo " ✅ ZeroMQ and pkg-config are already installed." ; \
137123 fi ; \
138124 else \
139125 echo " ERROR: Homebrew is not installed and is required to install zeromq. Install it from https://brew.sh/" ; \
@@ -144,93 +130,6 @@ install-dependencies: ## Install development dependencies based on OS/ARCH
144130 exit 1; \
145131 fi
146132
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.
150- .PHONY : download-tokenizer
151- download-tokenizer : $(TOKENIZER_LIB )
152- $(TOKENIZER_LIB ) : | $(LOCALLIB )
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)"
156- @curl -L https://github.com/daulet/tokenizers/releases/download/$(TOKENIZER_VERSION ) /libtokenizers.$(TARGETOS ) -$(TOKENIZER_ARCH ) .tar.gz | tar -xz -C $(LOCALLIB )
157- @ranlib $(LOCALLIB ) /* .a
158- @echo " Tokenizer bindings downloaded successfully (DEPRECATED)."
159-
160- .PHONY : detect-python
161- detect-python : # # Detects Python and prints the configuration.
162- @printf " \033[33;1m==== Python Configuration ====\033[0m\n"
163- @if [ -z " $( PYTHON_EXE) " ]; then \
164- echo " ERROR: Python 3 not found in PATH." ; \
165- exit 1; \
166- fi
167- @# Verify the version of the found python executable using its exit code
168- @if ! $(PYTHON_EXE ) -c " import sys; sys.exit(0 if sys.version_info[:2] == ($( shell echo $( PYTHON_VERSION) | cut -d. -f1) , $( shell echo $( PYTHON_VERSION) | cut -d. -f2) ) else 1)" ; then \
169- echo " ERROR: Found Python at '$( PYTHON_EXE) ' but it is not version $( PYTHON_VERSION) ." ; \
170- echo " Please ensure 'python$( PYTHON_VERSION) ' or a compatible 'python3' is in your PATH." ; \
171- exit 1; \
172- fi
173- @echo " Python executable: $( PYTHON_EXE) ($$ ($( PYTHON_EXE) --version))"
174- @echo " Python CFLAGS: $( PYTHON_CFLAGS) "
175- @echo " Python LDFLAGS: $( PYTHON_LDFLAGS) "
176- @if [ -z " $( PYTHON_CFLAGS) " ]; then \
177- echo " ERROR: Python development headers not found. See installation instructions above." ; \
178- exit 1; \
179- fi
180- @printf " \033[33;1m==============================\033[0m\n"
181-
182- .PHONY : setup-venv
183- setup-venv : detect-python # # Sets up the Python virtual environment.
184- @printf " \033[33;1m==== Setting up Python virtual environment in $( VENV_DIR) ====\033[0m\n"
185- @if [ ! -f " $( VENV_BIN) /pip" ]; then \
186- echo " Creating virtual environment..." ; \
187- $(PYTHON_EXE ) -m venv $(VENV_DIR ) || { \
188- echo " ERROR: Failed to create virtual environment." ; \
189- echo " Your Python installation may be missing the 'venv' module." ; \
190- echo " Try: 'sudo apt install python$( PYTHON_VERSION) -venv' or 'sudo dnf install python$( PYTHON_VERSION) -devel'" ; \
191- exit 1; \
192- }; \
193- fi
194- @echo " Upgrading pip..."
195- @$(VENV_BIN ) /pip install --upgrade pip
196- @echo " Python virtual environment setup complete."
197-
198- .PHONY : install-python-deps
199- install-python-deps : setup-venv # # installs dependencies.
200- @printf " \033[33;1m==== Setting up Python virtual environment in $( VENV_DIR) ====\033[0m\n"
201- @echo " install vllm..."
202- @KV_CACHE_PKG=$$ {KV_CACHE_PKG:-$$(go list -m -f '{{.Dir}}' github.com/llm-d/llm-d-kv-cache 2>/dev/null ) }; \
203- if [ -z " $$ KV_CACHE_PKG" ]; then \
204- echo " ERROR: kv-cache package not found." ; \
205- exit 1; \
206- fi ; \
207- if [ " $( TARGETOS) " = " darwin" ]; then \
208- if [ -f " $$ KV_CACHE_PKG/pkg/preprocessing/chat_completions/setup.sh" ]; then \
209- echo " Running kv-cache setup script for macOS..." ; \
210- cp " $$ KV_CACHE_PKG/pkg/preprocessing/chat_completions/setup.sh" build/kv-cache-setup.sh; \
211- chmod +wx build/kv-cache-setup.sh; \
212- cd build && PATH=$(VENV_BIN ) :$$ PATH ./kv-cache-setup.sh && cd ..; \
213- else \
214- echo " ERROR: setup script not found at $$ KV_CACHE_PKG/pkg/preprocessing/chat_completions/setup.sh" ; \
215- exit 1; \
216- fi ; \
217- else \
218- echo " Installing vLLM for Linux $( TARGETARCH) ..." ; \
219- if [ " $( TARGETARCH) " = " arm64" ]; then \
220- $(VENV_BIN ) /pip install https://github.com/vllm-project/vllm/releases/download/v$(VLLM_VERSION ) /vllm-$(VLLM_VERSION ) +cpu-cp38-abi3-manylinux_2_35_aarch64.whl; \
221- elif [ " $( TARGETARCH) " = " amd64" ]; then \
222- $(VENV_BIN ) /pip install https://github.com/vllm-project/vllm/releases/download/v$(VLLM_VERSION ) /vllm-$(VLLM_VERSION ) +cpu-cp38-abi3-manylinux_2_35_x86_64.whl --extra-index-url https://download.pytorch.org/whl/cpu; \
223- else \
224- echo " ERROR: Unsupported architecture: $( TARGETARCH) . Only arm64 and amd64 are supported." ; \
225- exit 1; \
226- fi ; \
227- fi
228- @echo " Verifying vllm installation..."
229- @$(VENV_BIN ) /python -c " import vllm; print('✅ vllm version ' + vllm.__version__ + ' installed.')" || { \
230- echo " ERROR: vllm library not properly installed in venv." ; \
231- exit 1; \
232- }
233-
234133.PHONY : check-tools
235134check-tools : check-go check-ginkgo check-golangci-lint check-kustomize check-envsubst check-container-tool check-kubectl check-buildah check-typos # # Check that all required tools are installed
236135 @echo " All required tools are available."
0 commit comments