Skip to content

Commit b3ccbcb

Browse files
Merge pull request #12 from digitalocean/upstream-main
Sync upstream 2026-11-19
2 parents e746668 + e922a7a commit b3ccbcb

290 files changed

Lines changed: 23216 additions & 2366 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/workflows/check-typos.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ jobs:
3030
uses: actions/checkout@v7
3131

3232
- name: Check typos
33-
uses: crate-ci/typos@v1.52.0
33+
uses: crate-ci/typos@v1.52.2
3434

‎.github/workflows/codeql.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
pull_request:
99
branches:
1010
- main
11+
merge_group:
12+
types: [checks_requested]
1113
schedule:
1214
- cron: '17 3 * * 1'
1315

‎.github/workflows/nightly-router-perf-test-optimized-baseline-10k-1k.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
GCP_PROJECT_ID: ${{ inputs.gcp_project_id || 'llm-d-scale' }}
4545
GKE_CLUSTER_NAME: ${{ inputs.gke_cluster_name || 'llm-d-ap-usc1-router-perf' }}
4646
GKE_CLUSTER_ZONE: ${{ inputs.gke_cluster_zone || 'us-central1' }}
47+
CLOUDSDK_CONTAINER_USE_APPLICATION_DEFAULT_CREDENTIALS: 'true'
4748
TARGET: ${{ inputs.target || 'test/perf/config/targets/optimized-baseline-job1.yaml' }}
4849
GCS_BUCKET: ${{ inputs.gcs_bucket || 'llm-d-router-perf-results' }}
4950
HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -72,9 +73,16 @@ jobs:
7273

7374
- name: Get GKE credentials
7475
run: |
76+
# google-github-actions/auth sets GOOGLE_APPLICATION_CREDENTIALS and
77+
# CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE. Enabling ADC tells
78+
# get-credentials to pass --use_application_default_credentials to
79+
# gke-gcloud-auth-plugin so it exchanges tokens from ADC directly
80+
# instead of shelling out to `gcloud config config-helper`.
81+
gcloud config set container/use_application_default_credentials true
7582
gcloud container clusters get-credentials "${{ env.GKE_CLUSTER_NAME }}" \
7683
--zone "${{ env.GKE_CLUSTER_ZONE }}" \
7784
--project "${{ env.GCP_PROJECT_ID }}"
85+
gke-gcloud-auth-plugin --use_application_default_credentials > /dev/null
7886
7987
- name: Install helm
8088
run: |

‎DEVELOPMENT.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ Data parallel and KV cache are orthogonal options that can be combined with any
307307
| `VLLM_EXTRA_ARGS_P` | _(empty)_ | Additional flags appended to the Prefill vLLM container args. Use `--flag=value` format. Example: `--gpu-memory-utilization=0.9` |
308308
| `VLLM_EXTRA_ARGS_D` | _(empty)_ | Additional flags appended to the Decode vLLM container args. Use `--flag=value` format. Example: `--tensor-parallel-size=2` |
309309

310+
A `VLLM_EXTRA_ARGS_*` value can hold several plain `--flag` or `--flag=value` tokens separated by spaces, and each
311+
token becomes a separate argument. A value that contains JSON or quotes is passed as one argument, so it cannot be
312+
combined with other flags in the same variable.
313+
310314
For technical details, refer to [docs/disaggregation.md](docs/disaggregation.md) and
311315
[test/e2e/artifacts/environments/dev/README.md](test/e2e/artifacts/environments/dev/README.md).
312316

‎cmd/coordinator/main.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ func main() {
8686
log.Error(err, "failed to load config")
8787
os.Exit(1)
8888
}
89+
for _, key := range cfg.DeprecatedKeys {
90+
log.Info("config key is deprecated and ignored", "key", key)
91+
}
8992

9093
// CLI -v wins over config log_level.
9194
if vFlag := pflag.CommandLine.Lookup("v"); vFlag != nil && !vFlag.Changed {
@@ -149,7 +152,7 @@ func main() {
149152
log.Error(err, "failed to build pipeline")
150153
os.Exit(1)
151154
}
152-
srv, err := server.New(cfg.Server, p, gwClient)
155+
srv, err := server.New(cfg.Server, p, gwClient, server.WithWorkerProtocol(cfg.Pipeline.WorkerProtocol))
153156
if err != nil {
154157
log.Error(err, "failed to create server")
155158
os.Exit(1)

‎cmd/coordinator/main_test.go‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ func newTestServer(t *testing.T, listenAddr string) *server.Server {
4848
ListenAddr: listenAddr,
4949
ShutdownTimeout: time.Second,
5050
ReadTimeout: time.Second,
51-
WriteTimeout: time.Second,
5251
}, pipeline.New(nil), gateway.NewWithTransport(nil, "http://gateway-stub.invalid"))
5352
require.NoError(t, err)
5453
return srv
@@ -207,7 +206,6 @@ func TestRun_MetricsDisabled_DrainsCleanlyOnCancel(t *testing.T) {
207206
ListenAddr: listenAddr,
208207
ShutdownTimeout: time.Second,
209208
ReadTimeout: time.Second,
210-
WriteTimeout: time.Second,
211209
MetricsPort: 0,
212210
}
213211
srv := newTestServer(t, listenAddr)
@@ -241,7 +239,6 @@ func TestRun_NilListener_DrainsCleanlyOnCancel(t *testing.T) {
241239
ListenAddr: listenAddr,
242240
ShutdownTimeout: time.Second,
243241
ReadTimeout: time.Second,
244-
WriteTimeout: time.Second,
245242
MetricsPort: 0,
246243
}
247244
srv := newTestServer(t, listenAddr)
@@ -283,7 +280,6 @@ func TestRun_MetricsPortCollision_DrainsCoordinatorServer(t *testing.T) {
283280
ListenAddr: listenAddr,
284281
ShutdownTimeout: time.Second,
285282
ReadTimeout: time.Second,
286-
WriteTimeout: time.Second,
287283
MetricsPort: blockedPort,
288284
}
289285
srv := newTestServer(t, listenAddr)
@@ -322,7 +318,6 @@ func TestRun_InvalidMetricsTLSDrainsCoordinatorServer(t *testing.T) {
322318
ListenAddr: listenAddr,
323319
ShutdownTimeout: time.Second,
324320
ReadTimeout: time.Second,
325-
WriteTimeout: time.Second,
326321
MetricsPort: metricsPort,
327322
MetricsCertDir: t.TempDir(),
328323
}
@@ -361,7 +356,6 @@ func TestRun_DrainTimeout_ServesWithConnectionCloseThenShutsDown(t *testing.T) {
361356
ShutdownTimeout: time.Second,
362357
DrainTimeout: drain,
363358
ReadTimeout: time.Second,
364-
WriteTimeout: time.Second,
365359
}
366360
srv := newTestServer(t, listenAddr)
367361

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
Copyright 2026 The llm-d Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package runner
18+
19+
import (
20+
"context"
21+
"fmt"
22+
"sync/atomic"
23+
"testing"
24+
"time"
25+
26+
"github.com/stretchr/testify/require"
27+
28+
metricsutil "github.com/llm-d/llm-d-router/pkg/common/observability/metrics"
29+
fwknet "github.com/llm-d/llm-d-router/test/framework/net"
30+
)
31+
32+
// --fairness-id-metric-label-limit caps the fairness_id label in file-discovery
33+
// mode as it does on the Kubernetes path.
34+
func TestRunWithFileDiscovery_AppliesFairnessIDLabelLimit(t *testing.T) {
35+
t.Cleanup(func() { metricsutil.SetFairnessIDLabelLimit(metricsutil.DefaultFairnessIDLabelLimit) })
36+
37+
modelServer, _ := newDrainTestBackend(t, &atomic.Bool{})
38+
opts := newDrainTestOptions(modelServer)
39+
opts.FairnessIDMetricLabelLimit = 1
40+
plugin, discovery := drainTestFileDiscoveryConfig(t, modelServer)
41+
opts.ConfigText = fmt.Sprintf(`apiVersion: llm-d.ai/v1
42+
kind: EndpointPickerConfig
43+
plugins:
44+
%s- type: random-picker
45+
schedulingProfiles:
46+
- name: default
47+
plugins:
48+
- pluginRef: random-picker
49+
dataLayer:
50+
%s`, plugin, discovery)
51+
52+
ctx, stop := context.WithCancel(t.Context())
53+
defer stop()
54+
listener, err := fwknet.ReserveListener()
55+
require.NoError(t, err)
56+
t.Cleanup(func() { _ = listener.Close() })
57+
_, done := startFileDiscoveryDrainTest(ctx, t, opts, listener)
58+
defer func() {
59+
if !t.Failed() {
60+
return
61+
}
62+
select {
63+
case err := <-done:
64+
t.Errorf("EPP exited before serving a request: %v", err)
65+
default:
66+
}
67+
}()
68+
69+
// A served request means startup has finished applying the flags. It carries no
70+
// fairness ID, so it resolves to default-flow and takes no cap slot.
71+
_, routed := sendDrainTestRequest(t, listener, "ready")
72+
select {
73+
case res := <-routed:
74+
require.NoError(t, res.err)
75+
case <-time.After(10 * time.Second):
76+
t.Fatal("EPP did not serve a request")
77+
}
78+
79+
require.Equal(t, "first", metricsutil.BoundFairnessID("first"))
80+
require.Equal(t, metricsutil.OverflowValue, metricsutil.BoundFairnessID("second"))
81+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
Copyright 2026 The llm-d Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package runner
18+
19+
import (
20+
"encoding/json"
21+
"testing"
22+
23+
"github.com/stretchr/testify/assert"
24+
"github.com/stretchr/testify/require"
25+
26+
fwkplugin "github.com/llm-d/llm-d-router/pkg/epp/framework/interface/plugin"
27+
"github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/datalayer/discovery/k8speer"
28+
)
29+
30+
func newK8sPeerPlugin(t *testing.T, namespace string) fwkplugin.Plugin {
31+
t.Helper()
32+
t.Setenv("NAMESPACE", namespace)
33+
params, err := json.Marshal(map[string]string{
34+
"selector": "app=epp",
35+
"port": "9002",
36+
"namespace": namespace,
37+
})
38+
require.NoError(t, err)
39+
p, err := k8speer.Factory("peer-disc", fwkplugin.StrictDecoder(params), nil)
40+
require.NoError(t, err)
41+
return p
42+
}
43+
44+
func TestSetupPeerDiscovery_K8sPeerInPoolNamespace(t *testing.T) {
45+
r := &Runner{PluginHandle: newHandleWithPlugin(t, "peer-disc", newK8sPeerPlugin(t, "pool-ns"))}
46+
mgr := &addOnlyManager{}
47+
48+
require.NoError(t, r.setupPeerDiscovery(mgr, peersConfigRef("peer-disc"), "pool-ns"))
49+
assert.Len(t, mgr.added, 1)
50+
}
51+
52+
func TestSetupPeerDiscovery_K8sPeerOutsidePoolNamespace(t *testing.T) {
53+
r := &Runner{PluginHandle: newHandleWithPlugin(t, "peer-disc", newK8sPeerPlugin(t, "epp-ns"))}
54+
mgr := &addOnlyManager{}
55+
56+
err := r.setupPeerDiscovery(mgr, peersConfigRef("peer-disc"), "pool-ns")
57+
require.Error(t, err)
58+
assert.ErrorContains(t, err, "peer-disc")
59+
assert.ErrorContains(t, err, "epp-ns")
60+
assert.ErrorContains(t, err, "pool-ns")
61+
assert.Empty(t, mgr.added)
62+
}
63+
64+
func TestSetupPeerDiscovery_OtherPluginIgnoresPoolNamespace(t *testing.T) {
65+
r := &Runner{PluginHandle: newHandleWithPlugin(t, "peer-disc", newStubPeerDiscovery())}
66+
mgr := &addOnlyManager{}
67+
68+
require.NoError(t, r.setupPeerDiscovery(mgr, peersConfigRef("peer-disc"), "pool-ns"))
69+
assert.Len(t, mgr.added, 1)
70+
}

‎cmd/epp/runner/peer_discovery_test.go‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func TestSetupPeerDiscoveryConnectsStoreToSyncer(t *testing.T) {
126126
r := runnerWithPeerPlugins(t, disc, syncer)
127127
mgr := &addOnlyManager{}
128128

129-
require.NoError(t, r.setupPeerDiscovery(mgr, peersConfigRef("my-peers")))
129+
require.NoError(t, r.setupPeerDiscovery(mgr, peersConfigRef("my-peers"), "pool-ns"))
130130
require.Len(t, mgr.added, 1, "discovery runs as a manager runnable")
131131
require.NotNil(t, syncer.source, "the syncer was given the peer set")
132132
assert.Empty(t, syncer.source.Peers())
@@ -159,7 +159,7 @@ func TestSetupPeerDiscoveryLeavesNonConsumingSyncer(t *testing.T) {
159159
r := runnerWithPeerPlugins(t, newStubPeerDiscovery(), &externalStoreSyncer{})
160160
mgr := &addOnlyManager{}
161161

162-
require.NoError(t, r.setupPeerDiscovery(mgr, peersConfigRef("my-peers")))
162+
require.NoError(t, r.setupPeerDiscovery(mgr, peersConfigRef("my-peers"), "pool-ns"))
163163
assert.Len(t, mgr.added, 1)
164164
}
165165

@@ -168,27 +168,37 @@ func TestSetupPeerDiscoveryWithoutSyncer(t *testing.T) {
168168
r := runnerWithPeerPlugins(t, newStubPeerDiscovery(), nil)
169169
mgr := &addOnlyManager{}
170170

171-
require.NoError(t, r.setupPeerDiscovery(mgr, peersConfigRef("my-peers")))
171+
require.NoError(t, r.setupPeerDiscovery(mgr, peersConfigRef("my-peers"), "pool-ns"))
172172
assert.Len(t, mgr.added, 1)
173173
}
174174

175175
// Without dataLayer.discovery.peers nothing is registered.
176176
func TestSetupPeerDiscoveryDisabled(t *testing.T) {
177+
r := runnerWithPeerPlugins(t, newStubPeerDiscovery(), &externalStoreSyncer{})
178+
mgr := &addOnlyManager{}
179+
180+
require.NoError(t, r.setupPeerDiscovery(mgr, &configapiv1.EndpointPickerConfig{}, "pool-ns"))
181+
assert.Empty(t, mgr.added)
182+
}
183+
184+
// A syncer that consumes the peer set needs peer discovery to exchange state.
185+
func TestSetupPeerDiscoveryRequiredByPeerConsumingSyncer(t *testing.T) {
177186
r := runnerWithPeerPlugins(t, newStubPeerDiscovery(), &peerConsumingSyncer{})
178187
mgr := &addOnlyManager{}
179188

180-
require.NoError(t, r.setupPeerDiscovery(mgr, &configapiv1.EndpointPickerConfig{}))
189+
err := r.setupPeerDiscovery(mgr, &configapiv1.EndpointPickerConfig{}, "pool-ns")
190+
assert.ErrorContains(t, err, "dataLayer.discovery.peers")
181191
assert.Empty(t, mgr.added)
182192
}
183193

184194
func TestSetupPeerDiscoveryPluginRefNotFound(t *testing.T) {
185195
r := runnerWithPeerPlugins(t, newStubPeerDiscovery(), nil)
186-
err := r.setupPeerDiscovery(&addOnlyManager{}, peersConfigRef("missing"))
196+
err := r.setupPeerDiscovery(&addOnlyManager{}, peersConfigRef("missing"), "pool-ns")
187197
assert.ErrorContains(t, err, "missing")
188198
}
189199

190200
func TestSetupPeerDiscoveryNotPeerDiscovery(t *testing.T) {
191201
r := runnerWithPeerPlugins(t, &externalStoreSyncer{}, nil)
192-
err := r.setupPeerDiscovery(&addOnlyManager{}, peersConfigRef("my-peers"))
202+
err := r.setupPeerDiscovery(&addOnlyManager{}, peersConfigRef("my-peers"), "pool-ns")
193203
assert.ErrorContains(t, err, "PeerDiscovery")
194204
}

0 commit comments

Comments
 (0)