Skip to content

Commit c6a1c9a

Browse files
Merge branch 'main' into fix/per-prompt-mm-features
2 parents de1ccc2 + de4f661 commit c6a1c9a

132 files changed

Lines changed: 15101 additions & 135 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/trivy-scan/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ runs:
2626
output: 'trivy-results.sarif'
2727
severity: ${{ inputs.severity }}
2828
exit-code: '1'
29+
# trivy-action drops the severity filter for SARIF output unless told
30+
# otherwise, which fails the scan on findings outside `severity` (e.g.
31+
# UNKNOWN-severity Go vulndb notes).
32+
limit-severities-for-sarif: 'true'
33+
version: 'v0.72.0'
2934

3035
- name: Upload Trivy SARIF to Security tab
3136
uses: github/codeql-action/upload-sarif@v4.35.4 # v4.35.4 68bde559dea0fdcac2102bfdf6230c5f70eb485e
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Nightly - Router Perf Test (Optimized Baseline 10k-1k)
2+
3+
on:
4+
schedule:
5+
- cron: '0 9 * * *' # Run daily at 09:00 UTC
6+
workflow_dispatch: # Enable manual triggering from UI
7+
inputs:
8+
gcp_project_id:
9+
description: 'GCP Project ID'
10+
default: 'llm-d-scale'
11+
required: true
12+
type: string
13+
gke_cluster_name:
14+
description: 'GKE Cluster Name'
15+
default: 'llm-d-ap-usc1-router-perf'
16+
required: true
17+
type: string
18+
gke_cluster_zone:
19+
description: 'GKE Cluster Zone/Region'
20+
default: 'us-central1'
21+
required: true
22+
type: string
23+
sim_replicas:
24+
description: 'Number of simulator replicas'
25+
default: '10'
26+
required: true
27+
type: string
28+
router_config:
29+
description: 'Path to consolidated router Helm values configuration'
30+
default: 'test/perf/config/router-configs/optimized-baseline.yaml'
31+
required: true
32+
type: string
33+
test_name:
34+
description: 'Test identifier name'
35+
default: 'optimized-baseline-job1'
36+
required: true
37+
type: string
38+
perf_job:
39+
description: 'Performance job configuration path'
40+
default: 'test/perf/config/shared_prefix_job1.yaml'
41+
required: true
42+
type: string
43+
gcs_bucket:
44+
description: 'GCS bucket name for storing performance test results'
45+
default: 'llm-d-router-perf-results'
46+
required: true
47+
type: string
48+
49+
permissions:
50+
contents: read
51+
actions: read
52+
53+
jobs:
54+
run-perf-benchmark:
55+
runs-on: ubuntu-latest
56+
env:
57+
# This cluster must have the Gateway API Inference Extension CRDs
58+
# already installed in it.
59+
GCP_PROJECT_ID: ${{ inputs.gcp_project_id || 'llm-d-scale' }}
60+
GKE_CLUSTER_NAME: ${{ inputs.gke_cluster_name || 'llm-d-ap-usc1-router-perf' }}
61+
GKE_CLUSTER_ZONE: ${{ inputs.gke_cluster_zone || 'us-central1' }}
62+
SIM_REPLICAS: ${{ inputs.sim_replicas || '10' }}
63+
ROUTER_CONFIG: ${{ inputs.router_config || 'test/perf/config/router-configs/optimized-baseline.yaml' }}
64+
TEST_NAME: ${{ inputs.test_name || 'optimized-baseline-job1' }}
65+
PERF_JOB: ${{ inputs.perf_job || 'test/perf/config/shared_prefix_job1.yaml' }}
66+
GCS_BUCKET: ${{ inputs.gcs_bucket || 'llm-d-router-perf-results' }}
67+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
68+
steps:
69+
- name: Checkout llm-d/llm-d-router
70+
uses: actions/checkout@v6
71+
72+
- name: Checkout kubernetes-sigs/inference-perf
73+
uses: actions/checkout@v6
74+
with:
75+
repository: kubernetes-sigs/inference-perf
76+
path: inference-perf
77+
78+
- name: Authenticate to Google Cloud
79+
uses: google-github-actions/auth@v2
80+
with:
81+
credentials_json: ${{ secrets.GKE_SA_KEY }}
82+
83+
- name: Set up gcloud CLI and kubectl
84+
uses: google-github-actions/setup-gcloud@v2
85+
with:
86+
project_id: ${{ env.GCP_PROJECT_ID }}
87+
install_components: 'kubectl,gke-gcloud-auth-plugin'
88+
89+
- name: Get GKE credentials
90+
run: |
91+
gcloud container clusters get-credentials "${{ env.GKE_CLUSTER_NAME }}" \
92+
--zone "${{ env.GKE_CLUSTER_ZONE }}" \
93+
--project "${{ env.GCP_PROJECT_ID }}"
94+
95+
- name: Install helm
96+
run: |
97+
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
98+
99+
- name: Set up Python
100+
uses: actions/setup-python@v5
101+
with:
102+
python-version: "3.10"
103+
104+
- name: Install Graphviz
105+
run: |
106+
sudo apt-get update && sudo apt-get install -y graphviz
107+
108+
- name: Install Python dependencies
109+
run: |
110+
python3 -m pip install --upgrade pip
111+
python3 -m pip install pyyaml
112+
113+
- name: Run Performance Test Script
114+
run: |
115+
python3 test/perf/run_nightly_perf.py \
116+
--router-config ${{ env.ROUTER_CONFIG }} \
117+
--test-name ${{ env.TEST_NAME }} \
118+
--perf-chart ${{ github.workspace }}/inference-perf/deploy/inference-perf \
119+
--perf-job ${{ env.PERF_JOB }} \
120+
--sim-replicas ${{ env.SIM_REPLICAS }} \
121+
--results-dir test/perf/results/optimized-baseline \
122+
--router-machine-family e2 \
123+
--gcp-project ${{ env.GCP_PROJECT_ID }} \
124+
--collect-pprof-profiles \
125+
--gcs-bucket ${{ env.GCS_BUCKET }}
126+
127+
- name: Upload Performance Results Artifact
128+
uses: actions/upload-artifact@v4
129+
if: always()
130+
with:
131+
name: epp-perf-results
132+
path: test/perf/results/optimized-baseline/

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,7 @@ vendor
5353
# Helm dependency artifacts
5454
config/charts/*/charts/
5555
config/charts/*/Chart.lock
56+
57+
# Performance benchmark local results directory
58+
test/perf/__pycache__/
59+
test/perf/results/

.golangci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ linters:
4545
text: "avoid meaningless package names"
4646
- linters: [revive]
4747
text: "avoid package names that conflict with Go standard library package names"
48+
# Packages transferred verbatim from llm-d-kv-cache (#1862); style cleanup tracked separately
49+
- path: pkg/(kvcache|kvevents|telemetry|utils)/
50+
linters:
51+
- revive
52+
- perfsprint
53+
- goconst
54+
- dupword
55+
- prealloc
4856
settings:
4957
importas:
5058
no-unaliased: false # unaliased imports are allowed; only enforce when an alias is used

Dockerfile.builder

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM golang:1.25.12
1+
FROM golang:1.26.5
22

33
RUN mkdir /app
44
WORKDIR /app
55

66
ARG TYPOS_VERSION=v1.34.0
77
ARG KIND_VERSION=v0.27.0
8-
ARG GOLANGCI_LINT_VERSION=v2.8.0
8+
ARG GOLANGCI_LINT_VERSION=v2.10.0
99
ARG KUBECTL_VERSION=v1.35.3
1010
ARG KUSTOMIZE_VERSION=v5.6.0
1111
ARG DOCKER_VERSION=29.3.0

Dockerfile.coordinator

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
ARG BASE_IMAGE=gcr.io/distroless/static:nonroot
77

88
# Go build stage
9-
FROM --platform=${BUILDPLATFORM} quay.io/projectquay/golang:1.25 AS builder
9+
FROM --platform=${BUILDPLATFORM} golang:1.26.5 AS builder
1010

1111
ARG TARGETOS
1212
ARG TARGETARCH

Dockerfile.epp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
ARG BASE_IMAGE=gcr.io/distroless/static:nonroot
77

88
# Go build stage
9-
FROM --platform=${BUILDPLATFORM} golang:1.25.12 AS go-builder
9+
FROM --platform=${BUILDPLATFORM} golang:1.26.5 AS go-builder
1010

1111
ARG TARGETOS
1212
ARG TARGETARCH

Dockerfile.sidecar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# COPY --from=builder /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-bundle.crt
66
ARG BASE_IMAGE=gcr.io/distroless/static:nonroot
77

8-
# Build Stage: using Go 1.25.12 image
9-
FROM --platform=${BUILDPLATFORM} golang:1.25.12 AS builder
8+
# Build Stage: using Go 1.26.5 image
9+
FROM --platform=${BUILDPLATFORM} golang:1.26.5 AS builder
1010
ARG TARGETOS
1111
ARG TARGETARCH
1212

config/charts/llm-d-router-standalone/values.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,8 @@ router:
224224
reuse_connection: true
225225
grpc_health_check:
226226
service_name: "envoy.service.ext_proc.v3.ExternalProcessor"
227-
tls_options:
228-
alpn_protocols: ["h2"]
229-
transport_socket:
230-
name: "envoy.transport_sockets.tls"
231-
typed_config:
232-
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
233-
common_tls_context:
234-
validation_context:
227+
{{ include "llm-d-router.proxy.envoyExtProcTLSOptions" . | indent 10 }}
228+
{{ include "llm-d-router.proxy.envoyExtProcTransportSocket" . | indent 6 }}
235229
typed_extension_protocol_options:
236230
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
237231
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions

config/charts/routerlib/templates/_helpers.tpl

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,49 @@ false
173173
{{- end -}}
174174
{{- end -}}
175175

176+
{{/*
177+
Return "true" if EPP is configured with secure (TLS) serving, "false" if
178+
router.epp.flags.secure-serving is explicitly set to false. Defaults to true
179+
so that the Envoy ext_proc cluster uses TLS by default.
180+
*/}}
181+
{{- define "llm-d-router.proxy.eppSecureServing" -}}
182+
{{- $flags := .Values.router.epp.flags | default dict -}}
183+
{{- $secureServing := index $flags "secure-serving" -}}
184+
{{- if and (not (kindIs "invalid" $secureServing)) (eq (toString $secureServing) "false") -}}
185+
false
186+
{{- else -}}
187+
true
188+
{{- end -}}
189+
{{- end -}}
190+
191+
{{/*
192+
Envoy health-check tls_options block for the ext_proc cluster.
193+
Emitted only when EPP runs with TLS (secure-serving != false).
194+
Callers must indent to match the surrounding YAML context.
195+
*/}}
196+
{{- define "llm-d-router.proxy.envoyExtProcTLSOptions" -}}
197+
{{- if eq (include "llm-d-router.proxy.eppSecureServing" .) "true" -}}
198+
tls_options:
199+
alpn_protocols: ["h2"]
200+
{{- end -}}
201+
{{- end -}}
202+
203+
{{/*
204+
Envoy transport_socket block for the ext_proc cluster.
205+
Emitted only when EPP runs with TLS (secure-serving != false).
206+
Callers must indent to match the surrounding YAML context.
207+
*/}}
208+
{{- define "llm-d-router.proxy.envoyExtProcTransportSocket" -}}
209+
{{- if eq (include "llm-d-router.proxy.eppSecureServing" .) "true" -}}
210+
transport_socket:
211+
name: "envoy.transport_sockets.tls"
212+
typed_config:
213+
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
214+
common_tls_context:
215+
validation_context:
216+
{{- end -}}
217+
{{- end -}}
218+
176219
{{/*
177220
Normalize a scalar, comma-separated string, or list of ports into a
178221
comma-separated numeric string.
@@ -296,7 +339,12 @@ Standalone uses proxy presets merged with explicit proxy overrides.
296339
{{- $proxyType := include "llm-d-router.proxyType" . -}}
297340
{{- $presets := index $proxy "presets" | default dict -}}
298341
{{- $preset := deepCopy ((index $presets $proxyType) | default dict) -}}
342+
{{- $userArgs := index $proxy "args" | default list -}}
343+
{{- $presetArgs := index $preset "args" | default list -}}
299344
{{- $resolved = mergeOverwrite $preset $proxy -}}
345+
{{- if empty $userArgs -}}
346+
{{- $_ := set $resolved "args" $presetArgs -}}
347+
{{- end -}}
300348
{{- if eq $proxyType "agentgateway" -}}
301349
{{- $listenerPort := include "llm-d-router.standaloneProxyListenerPort" . | int -}}
302350
{{- $ports := index $resolved "ports" | default list -}}

0 commit comments

Comments
 (0)