Skip to content

Commit e432640

Browse files
committed
Merge remote-tracking branch 'upstream/main' into odh-main
2 parents ae39e80 + 1071b4d commit e432640

11 files changed

Lines changed: 126 additions & 54 deletions

File tree

.github/workflows/check-typos.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ jobs:
1313
uses: actions/checkout@v6
1414

1515
- name: Check typos
16-
uses: crate-ci/typos@v1.39.2
16+
uses: crate-ci/typos@v1.40.0
1717

.github/workflows/ci-pr-checks.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,28 @@ on:
99
- main
1010

1111
jobs:
12+
check-changes:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
docs: ${{ steps.filter.outputs.docs }}
16+
steps:
17+
- name: Checkout source
18+
uses: actions/checkout@v6
19+
- uses: dorny/paths-filter@v3
20+
id: filter
21+
with:
22+
filters: |
23+
docs:
24+
- 'README.md'
25+
- 'docs/**'
1226
lint-and-test:
27+
needs: check-changes
28+
if: ${{ needs.check-changes.outputs.docs == 'false' }}
1329
runs-on: ubuntu-latest
1430
steps:
1531
- name: Checkout source
1632
uses: actions/checkout@v6
17-
33+
1834
- name: Sanity check repo contents
1935
run: ls -la
2036

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check Signed Commits in PR
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
check-signed-commits:
8+
name: Check signed commits in PR
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: write # Required to post comments on PRs
13+
steps:
14+
- name: Check signed commits in PR
15+
uses: 1Password/check-signed-commits-action@v1 # Use the action
16+
with:
17+
comment: |
18+
🚨 Unsigned commits detected! Please sign your commits.
19+
20+
For instructions on how to set up GPG/SSH signing and verify your commits,
21+
please see [GitHub Documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification).

Makefile

Lines changed: 59 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ include Makefile.tools.mk
44
SHELL := /usr/bin/env bash
55

66
# Defaults
7-
TARGETOS ?= $(shell go env GOOS)
8-
TARGETARCH ?= $(shell go env GOARCH)
7+
TARGETOS ?= $(shell command -v go >/dev/null 2>&1 && go env GOOS || uname -s | tr '[:upper:]' '[:lower:]')
8+
TARGETARCH ?= $(shell command -v go >/dev/null 2>&1 && go env GOARCH || uname -m | sed 's/x86_64/amd64/; s/aarch64/arm64/; s/armv7l/arm/')
99
PROJECT_NAME ?= llm-d-inference-scheduler
1010
SIDECAR_IMAGE_NAME ?= llm-d-routing-sidecar
1111
VLLM_SIMULATOR_IMAGE_NAME ?= llm-d-inference-sim
@@ -69,31 +69,29 @@ PYTHON_VERSION := 3.12
6969
PYTHON_CONFIG ?= $(shell command -v python$(PYTHON_VERSION)-config || command -v python3-config)
7070
ifeq ($(PYTHON_CONFIG),)
7171
ifeq ($(TARGETOS),darwin)
72-
# macOS: Find Homebrew's python-config script for the most reliable flags.
73-
BREW_PREFIX := $(shell command -v brew >/dev/null 2>&1 && brew --prefix python@$(PYTHON_VERSION) 2>/dev/null)
74-
PYTHON_CONFIG ?= $(BREW_PREFIX)/bin/python$(PYTHON_VERSION)-config
75-
PYTHON_ERROR := "Could not execute 'python$(PYTHON_VERSION)-config'. Please ensure Python is installed correctly with: 'brew install python@$(PYTHON_VERSION)' or install python3.12 manually."
72+
# macOS: Find Homebrew's python-config script for the most reliable flags.
73+
BREW_PREFIX := $(shell command -v brew >/dev/null 2>&1 && brew --prefix python@$(PYTHON_VERSION) 2>/dev/null)
74+
PYTHON_CONFIG ?= $(BREW_PREFIX)/bin/python$(PYTHON_VERSION)-config
75+
PYTHON_ERROR := "Could not execute 'python$(PYTHON_VERSION)-config'. Please ensure Python is installed correctly with: 'brew install python@$(PYTHON_VERSION)' or install python3.12 manually."
7676
else ifeq ($(TARGETOS),linux)
77-
# Linux: Use standard system tools to find flags.
78-
PYTHON_ERROR := "Python $(PYTHON_VERSION) development headers not found. Please install with: 'sudo apt install python$(PYTHON_VERSION)-dev' or 'sudo dnf install python$(PYTHON_VERSION)-devel'"
77+
# Linux: Use standard system tools to find flags.
78+
PYTHON_ERROR := "Python $(PYTHON_VERSION) development headers not found. Please install with: 'sudo apt install python$(PYTHON_VERSION)-dev' or 'sudo dnf install python$(PYTHON_VERSION)-devel'"
7979
else
80-
PYTHON_ERROR := "you should set up PYTHON_CONFIG variable manually"
80+
PYTHON_ERROR := "you should set up PYTHON_CONFIG variable manually"
8181
endif
8282
endif
8383

84-
# Check if PYTHON_CONFIG is found before using it
85-
ifneq ($(PYTHON_CONFIG),)
86-
ifneq ($(shell $(PYTHON_CONFIG) --cflags 2>/dev/null),)
87-
PYTHON_CFLAGS := $(shell $(PYTHON_CONFIG) --cflags)
88-
# Use --ldflags --embed to get all necessary flags for linking
89-
PYTHON_LDFLAGS := $(shell $(PYTHON_CONFIG) --ldflags --embed)
90-
else
91-
$(error ${PYTHON_ERROR})
84+
ifeq ($(PYTHON_CONFIG),)
85+
$(error ${PYTHON_ERROR})
9286
endif
93-
else
94-
$(error ${PYTHON_ERROR})
87+
88+
ifeq ($(shell $(PYTHON_CONFIG) --cflags 2>/dev/null),)
89+
$(error Python configuration tool cannot provide cflags)
9590
endif
9691

92+
PYTHON_CFLAGS := $(shell $(PYTHON_CONFIG) --cflags)
93+
PYTHON_LDFLAGS := $(shell $(PYTHON_CONFIG) --ldflags --embed)
94+
9795
# CGO flags with all dependencies
9896
CGO_CFLAGS := $(PYTHON_CFLAGS) '-I$(shell pwd)/lib'
9997
CGO_LDFLAGS := $(PYTHON_LDFLAGS) $(PYTHON_LIBS) '-L$(shell pwd)/lib' -ltokenizers -ldl -lm
@@ -156,12 +154,12 @@ test: test-unit test-e2e ## Run unit tests and e2e tests
156154
test-unit: test-unit-epp test-unit-sidecar
157155

158156
.PHONY: test-unit-%
159-
test-unit-%: download-tokenizer install-dependencies ## Run unit tests
157+
test-unit-%: download-tokenizer check-dependencies ## Run unit tests
160158
@printf "\033[33;1m==== Running Unit Tests ====\033[0m\n"
161159
CGO_CFLAGS=${$*_CGO_CFLAGS} CGO_LDFLAGS=${$*_CGO_LDFLAGS} go test $($*_LDFLAGS) -v $$($($*_TEST_FILES) | tr '\n' ' ')
162160

163161
.PHONY: test-integration
164-
test-integration: download-tokenizer install-dependencies ## Run integration tests
162+
test-integration: download-tokenizer check-dependencies ## Run integration tests
165163
@printf "\033[33;1m==== Running Integration Tests ====\033[0m\n"
166164
go test -ldflags="$(LDFLAGS)" -v -tags=integration_tests ./test/integration/
167165

@@ -187,9 +185,9 @@ lint: check-golangci-lint check-typos ## Run lint
187185
build: build-epp build-sidecar ## Build the project
188186

189187
.PHONY: build-%
190-
build-%: check-go install-dependencies download-tokenizer ## Build the project
188+
build-%: check-go download-tokenizer ## Build the project
191189
@printf "\033[33;1m==== Building ====\033[0m\n"
192-
go build $($*_LDFLAGS) -o bin/$($*_NAME) cmd/$($*_NAME)/main.go
190+
CGO_CFLAGS=${$*_CGO_CFLAGS} CGO_LDFLAGS=${$*_CGO_LDFLAGS} go build $($*_LDFLAGS) -o bin/$($*_NAME) cmd/$($*_NAME)/main.go
193191

194192
##@ Container Build/Push
195193

@@ -465,26 +463,55 @@ clean-env-dev-kubernetes: check-kubectl check-kustomize check-envsubst
465463

466464
##@ Dependencies
467465

466+
.PHONY: check-dependencies
467+
check-dependencies: ## Check if development dependencies are installed
468+
@if [ "$(TARGETOS)" = "linux" ]; then \
469+
if [ -x "$$(command -v apt)" ]; then \
470+
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 \
471+
echo "ERROR: Missing dependencies. Please run 'sudo make install-dependencies'"; \
472+
exit 1; \
473+
fi; \
474+
elif [ -x "$$(command -v dnf)" ]; then \
475+
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 \
476+
echo "ERROR: Missing dependencies. Please run 'sudo make install-dependencies'"; \
477+
exit 1; \
478+
fi; \
479+
else \
480+
echo "WARNING: Unsupported Linux package manager. Cannot verify dependencies."; \
481+
fi; \
482+
elif [ "$(TARGETOS)" = "darwin" ]; then \
483+
if [ -x "$$(command -v brew)" ]; then \
484+
if ! brew list zeromq pkg-config >/dev/null 2>&1; then \
485+
echo "ERROR: Missing dependencies. Please run 'make install-dependencies'"; \
486+
exit 1; \
487+
fi; \
488+
else \
489+
echo "ERROR: Homebrew is not installed and is required. Install it from https://brew.sh/"; \
490+
exit 1; \
491+
fi; \
492+
fi
493+
@echo "✅ All dependencies are installed."
494+
468495
.PHONY: install-dependencies
469496
install-dependencies: ## Install development dependencies based on OS/ARCH
470497
@echo "Checking and installing development dependencies..."
471498
@if [ "$(TARGETOS)" = "linux" ]; then \
472499
if [ -x "$$(command -v apt)" ]; then \
473-
if ! dpkg -s libzmq3-dev >/dev/null 2>&1 || ! dpkg -s g++ >/dev/null 2>&1; then \
500+
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 \
474501
echo "Installing dependencies with apt..."; \
475-
apt-get update && apt-get install -y libzmq3-dev g++; \
502+
apt-get update && apt-get install -y libzmq3-dev g++ python$(PYTHON_VERSION)-dev; \
476503
else \
477-
echo "✅ ZMQ and g++ are already installed."; \
504+
echo "✅ ZMQ, g++, and Python dev headers are already installed."; \
478505
fi; \
479506
elif [ -x "$$(command -v dnf)" ]; then \
480-
if ! dnf -q list installed zeromq-devel >/dev/null 2>&1 || ! dnf -q list installed gcc-c++ >/dev/null 2>&1; then \
507+
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 \
481508
echo "Installing dependencies with dnf..."; \
482-
dnf install -y zeromq-devel gcc-c++; \
509+
dnf install -y zeromq-devel gcc-c++ python$(PYTHON_VERSION)-devel; \
483510
else \
484-
echo "✅ ZMQ and gcc-c++ are already installed."; \
511+
echo "✅ ZMQ, gcc-c++, and Python dev headers are already installed."; \
485512
fi; \
486513
else \
487-
echo "Unsupported Linux package manager. Install libzmq and g++/gcc-c++ manually."; \
514+
echo "ERROR: Unsupported Linux package manager. Install libzmq, g++/gcc-c++, and python-devel manually."; \
488515
exit 1; \
489516
fi; \
490517
elif [ "$(TARGETOS)" = "darwin" ]; then \
@@ -496,10 +523,10 @@ install-dependencies: ## Install development dependencies based on OS/ARCH
496523
echo "✅ ZeroMQ and pkgconf are already installed."; \
497524
fi; \
498525
else \
499-
echo "Homebrew is not installed and is required to install zeromq. Install it from https://brew.sh/"; \
526+
echo "ERROR: Homebrew is not installed and is required to install zeromq. Install it from https://brew.sh/"; \
500527
exit 1; \
501528
fi; \
502529
else \
503-
echo "Unsupported OS: $(TARGETOS). Install development dependencies manually."; \
530+
echo "ERROR: Unsupported OS: $(TARGETOS). Install development dependencies manually."; \
504531
exit 1; \
505532
fi

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d
2727
sigs.k8s.io/controller-runtime v0.22.4
2828
sigs.k8s.io/gateway-api v1.4.0
29-
sigs.k8s.io/gateway-api-inference-extension v1.2.0-rc.1
29+
sigs.k8s.io/gateway-api-inference-extension v1.2.1
3030
)
3131

3232
require (

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
181181
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
182182
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
183183
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
184-
github.com/llm-d/llm-d-kv-cache-manager v0.4.0-rc2 h1:l2Sm8W6SRg4TAme4RsndwZ++5+4aQvDI4vnf8TKrhww=
185-
github.com/llm-d/llm-d-kv-cache-manager v0.4.0-rc2/go.mod h1:ZlK7MCuz5D/weLeHyNKEmVF/eJZDyYn3XyRowTihq9o=
186184
github.com/llm-d/llm-d-kv-cache-manager v0.4.0 h1:MBWVpDW0PWsqNJEEAW1esrJW+Xavb0a7w14tCJWWyRY=
187185
github.com/llm-d/llm-d-kv-cache-manager v0.4.0/go.mod h1:ZlK7MCuz5D/weLeHyNKEmVF/eJZDyYn3XyRowTihq9o=
188186
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
@@ -411,8 +409,8 @@ sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327U
411409
sigs.k8s.io/controller-runtime v0.22.4/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8=
412410
sigs.k8s.io/gateway-api v1.4.0 h1:ZwlNM6zOHq0h3WUX2gfByPs2yAEsy/EenYJB78jpQfQ=
413411
sigs.k8s.io/gateway-api v1.4.0/go.mod h1:AR5RSqciWP98OPckEjOjh2XJhAe2Na4LHyXD2FUY7Qk=
414-
sigs.k8s.io/gateway-api-inference-extension v1.2.0-rc.1 h1:46O32J2MN4kqumN1rypbuI1N3AjDdRSJ8DrNP7p4WFA=
415-
sigs.k8s.io/gateway-api-inference-extension v1.2.0-rc.1/go.mod h1:/HWeqxuOMjFM56YwJ2Spt3qceK7Spz4hk6ZfXYgE9a8=
412+
sigs.k8s.io/gateway-api-inference-extension v1.2.1 h1:kQjnFWW8YLCN42EZxDNxTuDE0xHkPkoyaEVpQ5sNCBQ=
413+
sigs.k8s.io/gateway-api-inference-extension v1.2.1/go.mod h1:/HWeqxuOMjFM56YwJ2Spt3qceK7Spz4hk6ZfXYgE9a8=
416414
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
417415
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
418416
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=

pkg/sidecar/proxy/chat_completions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (s *Server) chatCompletionsHandler(w http.ResponseWriter, r *http.Request)
5757
if len(prefillHostPort) == 0 {
5858
s.logger.V(4).Info("skip disaggregated prefill")
5959

60-
if s.forwardDataParallel && !s.dataParallelHandler(w, r) {
60+
if !s.forwardDataParallel || !s.dataParallelHandler(w, r) {
6161
s.decoderProxy.ServeHTTP(w, r)
6262
}
6363
return

pkg/sidecar/proxy/connector_lmcache.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ func (s *Server) runLMCacheProtocol(w http.ResponseWriter, r *http.Request, pref
8484
// Forward original request to local decoder
8585

8686
r.Body = io.NopCloser(strings.NewReader(string(original)))
87-
if s.forwardDataParallel && !s.dataParallelHandler(w, r) {
87+
if !s.forwardDataParallel || !s.dataParallelHandler(w, r) {
88+
s.logger.V(4).Info("sending request to decoder", "to", s.decoderURL.Host)
8889
s.decoderProxy.ServeHTTP(w, r)
8990
}
9091
}

pkg/sidecar/proxy/connector_nixlv2.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ func (s *Server) runNIXLProtocolV2(w http.ResponseWriter, r *http.Request, prefi
168168
// 2. Forward to local decoder.
169169

170170
s.logger.V(5).Info("sending request to decoder", "body", string(dbody))
171-
if s.forwardDataParallel && !s.dataParallelHandler(w, dreq) {
171+
if !s.forwardDataParallel || !s.dataParallelHandler(w, dreq) {
172+
s.logger.V(4).Info("sending request to decoder", "to", s.decoderURL.Host)
172173
s.decoderProxy.ServeHTTP(w, dreq)
173174
}
174175
}

pkg/sidecar/proxy/data_parallel.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ func (s *Server) startDataParallel(ctx context.Context, cert *tls.Certificate, g
5353
decoderPort := strconv.Itoa(baseDecoderPort + idx + 1)
5454
rankPort := strconv.Itoa(basePort + idx + 1)
5555
hostPort := net.JoinHostPort(podIP, rankPort)
56-
rankURL, err := url.Parse(s.decoderURL.Scheme + "://localhost:" + decoderPort)
56+
decoderURL, err := url.Parse(s.decoderURL.Scheme + "://localhost:" + decoderPort)
5757
if err != nil {
5858
return err
5959
}
60-
handler := s.createDecoderProxyHandler(rankURL, s.config.DecoderInsecureSkipVerify)
60+
handler := s.createDecoderProxyHandler(decoderURL, s.config.DecoderInsecureSkipVerify)
6161
s.dataParallelProxies[hostPort] = handler
6262
}
6363

@@ -77,6 +77,7 @@ func (s *Server) startDataParallel(ctx context.Context, cert *tls.Certificate, g
7777
clone.forwardDataParallel = false
7878
// Configure handlers
7979
clone.handler = clone.createRoutes()
80+
clone.setConnector()
8081

8182
return clone.startHTTP(ctx, cert)
8283
})

0 commit comments

Comments
 (0)