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
47 changes: 0 additions & 47 deletions apix/config/v1alpha1/defaults.go

This file was deleted.

30 changes: 29 additions & 1 deletion apix/config/v1alpha1/endpointpickerconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ package v1alpha1

import (
"encoding/json"
"fmt"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +k8s:defaulter-gen=true
// +kubebuilder:object:root=true

// EndpointPickerConfig is the Schema for the endpointpickerconfigs API
Expand All @@ -41,6 +41,14 @@ type EndpointPickerConfig struct {
SchedulingProfiles []SchedulingProfile `json:"schedulingProfiles"`
}

func (cfg EndpointPickerConfig) String() string {
return fmt.Sprintf(
"{Plugins: %v, SchedulingProfiles: %v}",
cfg.Plugins,
cfg.SchedulingProfiles,
)
}

// PluginSpec contains the information that describes a plugin that
// will be instantiated.
type PluginSpec struct {
Expand All @@ -61,6 +69,14 @@ type PluginSpec struct {
Parameters json.RawMessage `json:"parameters"`
}

func (ps PluginSpec) String() string {
var parameters string
if ps.Parameters != nil {
parameters = fmt.Sprintf(", Parameters: %s", ps.Parameters)
}
return fmt.Sprintf("{%s/%s%s}", ps.Name, ps.Type, parameters)
}

// SchedulingProfile contains the information to create a SchedulingProfile
// entry to be used by the scheduler.
type SchedulingProfile struct {
Expand All @@ -75,6 +91,10 @@ type SchedulingProfile struct {
Plugins []SchedulingPlugin `json:"plugins"`
}

func (sp SchedulingProfile) String() string {
return fmt.Sprintf("{Name: %s, Plugins: %v}", sp.Name, sp.Plugins)
}

// SchedulingPlugin describes a plugin that will be associated with a
// SchedulingProfile entry.
type SchedulingPlugin struct {
Expand All @@ -90,3 +110,11 @@ type SchedulingPlugin struct {
// Weight is the weight fo be used if this plugin is a Scorer.
Weight *int `json:"weight"`
}

func (sp SchedulingPlugin) String() string {
var weight string
if sp.Weight != nil {
weight = fmt.Sprintf(", Weight: %d", *sp.Weight)
}
return fmt.Sprintf("{PluginRef: %s%s}", sp.PluginRef, weight)
}
38 changes: 0 additions & 38 deletions apix/config/v1alpha1/zz_generated.defaults.go

This file was deleted.

11 changes: 5 additions & 6 deletions cmd/epp/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ func (r *Runner) parsePluginsConfiguration(ctx context.Context) error {
return nil // configuring through code, not through file
}

logger := log.FromContext(ctx)

var configBytes []byte
if *configText != "" {
configBytes = []byte(*configText)
Expand All @@ -425,20 +427,17 @@ func (r *Runner) parsePluginsConfiguration(ctx context.Context) error {

r.registerInTreePlugins()
handle := plugins.NewEppHandle(ctx)
config, err := loader.LoadConfig(configBytes, handle)
config, err := loader.LoadConfig(configBytes, handle, logger)
if err != nil {
return fmt.Errorf("failed to load the configuration - %w", err)
}

r.schedulerConfig, err = loader.LoadSchedulerConfig(config.SchedulingProfiles, handle)
if err != nil {
return fmt.Errorf("failed to create Scheduler configuration - %w", err)
}
r.schedulerConfig = config.SchedulerConfig

// Add requestControl plugins
r.requestControlConfig.AddPlugins(handle.GetAllPlugins()...)

log.FromContext(ctx).Info("loaded configuration from file/text successfully")
logger.Info("loaded configuration from file/text successfully")
return nil
}

Expand Down
2 changes: 0 additions & 2 deletions config/charts/inferencepool/templates/epp-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ data:
- type: queue-scorer
- type: kv-cache-utilization-scorer
- type: prefix-cache-scorer
- type: max-score-picker
- type: single-profile-handler
schedulingProfiles:
- name: default
plugins:
Expand Down
5 changes: 0 additions & 5 deletions config/charts/inferencepool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,10 @@ inferenceExtension:
# - type: custom-scorer
# parameters:
# custom-threshold: 64
# - type: max-score-picker
# - type: single-profile-handler
# schedulingProfiles:
# - name: default
# plugins:
# - pluginRef: custom-scorer
# weight: 1
# - pluginRef: max-score-picker
# weight: 1

# Example environment variables:
# env:
Expand Down
2 changes: 0 additions & 2 deletions config/manifests/inferencepool-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ data:
- type: queue-scorer
- type: kv-cache-utilization-scorer
- type: prefix-cache-scorer
- type: max-score-picker
- type: single-profile-handler
schedulingProfiles:
- name: default
plugins:
Expand Down
5 changes: 0 additions & 5 deletions conformance/resources/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,10 @@ data:
kind: EndpointPickerConfig
plugins:
- type: header-based-testing-filter
- type: max-score-picker
parameters:
maxNumOfEndpoints: 1
- type: single-profile-handler
schedulingProfiles:
- name: conformance-profile
plugins:
- pluginRef: header-based-testing-filter
- pluginRef: max-score-picker
---
# --- Required Role and RoleBinding for Conformance Test for EPP ---
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
24 changes: 24 additions & 0 deletions pkg/epp/config/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Copyright 2025 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package config

import "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling"

// Config is the configuration loaded from the text based configuration
type Config struct {
SchedulerConfig *scheduling.SchedulerConfig
}
Loading