Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pkg/epp/controller/inferencemodel_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/tools/record"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/event"
Expand All @@ -36,7 +35,6 @@ import (

type InferenceModelReconciler struct {
client.Reader
Record record.EventRecorder
Datastore datastore.Datastore
PoolNamespacedName types.NamespacedName
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/epp/controller/inferencemodel_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/tools/record"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
Expand Down Expand Up @@ -205,7 +204,6 @@ func TestInferenceModelReconciler(t *testing.T) {
_ = ds.PoolSet(context.Background(), fakeClient, pool)
reconciler := &InferenceModelReconciler{
Reader: fakeClient,
Record: record.NewFakeRecorder(10),
Datastore: ds,
PoolNamespacedName: types.NamespacedName{Name: pool.Name, Namespace: pool.Namespace},
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/epp/controller/inferencepool_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"

"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/client-go/tools/record"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
Expand All @@ -35,7 +34,6 @@ import (
// will have the proper controller that will create/manage objects on behalf of the server pool.
type InferencePoolReconciler struct {
client.Reader
Record record.EventRecorder
Datastore datastore.Datastore
}

Expand Down
6 changes: 4 additions & 2 deletions pkg/epp/controller/inferencepool_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ func diffStore(datastore datastore.Datastore, params diffStoreParams) string {
if params.wantModels == nil {
params.wantModels = []*v1alpha2.InferenceModel{}
}
gotModels := datastore.ModelGetAll()
if diff := utiltest.DiffModelLists(params.wantModels, gotModels); diff != "" {

if diff := cmp.Diff(params.wantModels, datastore.ModelGetAll(), cmpopts.SortSlices(func(a, b *v1alpha2.InferenceModel) bool {
return a.Name < b.Name
})); diff != "" {
return "models:" + diff
}
return ""
Expand Down
2 changes: 0 additions & 2 deletions pkg/epp/controller/pod_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/tools/record"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/event"
Expand All @@ -38,7 +37,6 @@ import (
type PodReconciler struct {
client.Reader
Datastore datastore.Datastore
Record record.EventRecorder
}

func (c *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
Expand Down
5 changes: 3 additions & 2 deletions pkg/epp/datastore/datastore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,11 @@ func TestModel(t *testing.T) {
t.Errorf("Unexpected operation result, want: %v, got: %v", test.wantOpResult, gotOpResult)
}

if diff := testutil.DiffModelLists(test.wantModels, ds.ModelGetAll()); diff != "" {
if diff := cmp.Diff(test.wantModels, ds.ModelGetAll(), cmpopts.SortSlices(func(a, b *v1alpha2.InferenceModel) bool {
return a.Name < b.Name
})); diff != "" {
t.Errorf("Unexpected models diff: %s", diff)
}

})
}
}
Expand Down
9 changes: 0 additions & 9 deletions pkg/epp/requestcontrol/request_control_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,3 @@ func (c *Config) AddPlugins(pluginObjects ...plugins.Plugin) {
}
}
}

func LoadRequestControlConfig(instantiatedPlugins map[string]plugins.Plugin) *Config {
config := NewConfig()
for _, plugin := range instantiatedPlugins {
config.AddPlugins(plugin)
}

return config
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
)

const (
DefaultScorerWeight = 1
// vLLM default token block size is 16, and a good guess of average characters per token is 4.
DefaultHashBlockSize = 64
// The maximum number of blocks to match. Two long requests with the same prefix up to this
Expand Down
3 changes: 1 addition & 2 deletions pkg/epp/scheduling/framework/plugins/scorer/kvcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import (
)

const (
DefaultKVCacheScorerWeight = 1
KvCacheScorerType = "kv-cache-scorer"
KvCacheScorerType = "kv-cache-scorer"
)

// compile-time type assertion
Expand Down
3 changes: 1 addition & 2 deletions pkg/epp/scheduling/framework/plugins/scorer/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import (
)

const (
DefaultQueueScorerWeight = 1
QueueScorerType = "queue-scorer"
QueueScorerType = "queue-scorer"
)

// compile-time type assertion
Expand Down
5 changes: 0 additions & 5 deletions pkg/epp/scheduling/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@ import (

"sigs.k8s.io/controller-runtime/pkg/log"

backendmetrics "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics"
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/metrics"
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/framework"
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/types"
logutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/logging"
)

type Datastore interface {
PodGetAll() []backendmetrics.PodMetrics
}

// NewSchedulerWithConfig returns a new scheduler with the given scheduler plugins configuration.
func NewSchedulerWithConfig(config *SchedulerConfig) *Scheduler {
return &Scheduler{
Expand Down
16 changes: 0 additions & 16 deletions pkg/epp/scheduling/types/cycle_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,6 @@ type CycleState struct {
storage sync.Map
}

// Clone creates a copy of CycleState and returns its pointer. Clone returns
// nil if the context being cloned is nil.
func (c *CycleState) Clone() *CycleState {
if c == nil {
return nil
}
copy := NewCycleState()
// Safe copy storage in case of overwriting.
c.storage.Range(func(k, v any) bool {
copy.storage.Store(k, v.(StateData).Clone())
return true
})

return copy
}

// Read retrieves data with the given "key" from CycleState. If the key is not
// present, ErrNotFound is returned.
//
Expand Down
3 changes: 0 additions & 3 deletions pkg/epp/server/runserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ func (r *ExtProcServerRunner) SetupWithManager(ctx context.Context, mgr ctrl.Man
if err := (&controller.InferencePoolReconciler{
Datastore: r.Datastore,
Reader: mgr.GetClient(),
Record: mgr.GetEventRecorderFor("InferencePool"),
}).SetupWithManager(mgr); err != nil {
return fmt.Errorf("failed setting up InferencePoolReconciler: %w", err)
}
Expand All @@ -112,15 +111,13 @@ func (r *ExtProcServerRunner) SetupWithManager(ctx context.Context, mgr ctrl.Man
Datastore: r.Datastore,
Reader: mgr.GetClient(),
PoolNamespacedName: r.PoolNamespacedName,
Record: mgr.GetEventRecorderFor("InferenceModel"),
}).SetupWithManager(ctx, mgr); err != nil {
return fmt.Errorf("failed setting up InferenceModelReconciler: %w", err)
}

if err := (&controller.PodReconciler{
Datastore: r.Datastore,
Reader: mgr.GetClient(),
Record: mgr.GetEventRecorderFor("pod"),
}).SetupWithManager(mgr); err != nil {
return fmt.Errorf("failed setting up PodReconciler: %v", err)
}
Expand Down
28 changes: 0 additions & 28 deletions pkg/epp/util/testing/diff.go

This file was deleted.