Skip to content

Commit acd9db0

Browse files
committed
Add back stashed changes. Update outdated comments.
1 parent 3c7c320 commit acd9db0

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

pkg/epp/requestcontrol/director.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ func (d *Director) HandleRequest(ctx context.Context, reqCtx *handlers.RequestCo
173173
snapshotOfCandidatePods := d.toSchedulerPodMetrics(candidatePods)
174174

175175
// Prepare per request data by running PrepareData plugins.
176-
// NOTE: Failure in prepare data plugins does not block the request processing.
177176
if d.runPrepareDataPlugins(ctx, reqCtx.SchedulingRequest, snapshotOfCandidatePods) != nil {
178177
return reqCtx, errutil.Error{Code: errutil.Internal, Msg: "failed to prepare request data"}
179178
}

pkg/epp/requestcontrol/director_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,29 @@ func (ds *mockDatastore) PodList(predicate func(backendmetrics.PodMetrics) bool)
106106
return res
107107
}
108108

109+
type mockPrepareDataPlugin struct {
110+
name string
111+
produces map[string]any
112+
consumes map[string]any
113+
}
114+
115+
func (m *mockPrepareDataPlugin) TypedName() plugins.TypedName {
116+
return plugins.TypedName{Name: m.name, Type: "mock"}
117+
}
118+
119+
func (m *mockPrepareDataPlugin) Produces() map[string]any {
120+
return m.produces
121+
}
122+
123+
func (m *mockPrepareDataPlugin) Consumes() map[string]any {
124+
return m.consumes
125+
}
126+
127+
func (m *mockPrepareDataPlugin) PrepareRequestData(ctx context.Context, request *schedulingtypes.LLMRequest, pods []schedulingtypes.Pod) error {
128+
pods[0].Put(mockProducedDataKey, mockProducedDataType{value: 42})
129+
return nil
130+
}
131+
109132
func newMockPrepareDataPlugin(name string) *mockPrepareDataPlugin {
110133
return &mockPrepareDataPlugin{
111134
name: name,

0 commit comments

Comments
 (0)