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
5 changes: 3 additions & 2 deletions cmd/epp/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ func (r *Runner) Run(ctx context.Context) error {
setupLog.Error(err, "failed to create scheduler")
return err
}

setupLog.Info("parsed config", "scheduler-config", r.schedulerConfig)

scheduler := scheduling.NewSchedulerWithConfig(r.schedulerConfig)

saturationDetector := saturationdetector.NewDetector(sdConfig, datastore, setupLog)
Expand Down Expand Up @@ -404,8 +407,6 @@ func (r *Runner) parsePluginsConfiguration(ctx context.Context) error {
return fmt.Errorf("failed to load the configuration - %w", err)
}

setupLog.Info("Configuration file loaded", "config", config)

r.schedulerConfig, err = loader.LoadSchedulerConfig(config.SchedulingProfiles, handle)
if err != nil {
return fmt.Errorf("failed to create Scheduler configuration - %w", err)
Expand Down
23 changes: 23 additions & 0 deletions pkg/epp/scheduling/framework/scheduler_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package framework
import (
"context"
"fmt"
"strings"
"time"

"sigs.k8s.io/controller-runtime/pkg/log"
Expand Down Expand Up @@ -105,6 +106,28 @@ func (p *SchedulerProfile) AddPlugins(pluginObjects ...plugins.Plugin) error {
return nil
}

func (p *SchedulerProfile) String() string {
filterNames := make([]string, len(p.filters))
for i, filter := range p.filters {
filterNames[i] = filter.TypedName().String()
}
scorerNames := make([]string, len(p.scorers))
for i, scorer := range p.scorers {
scorerNames[i] = fmt.Sprintf("%s: %d", scorer.TypedName(), scorer.Weight())
}
postCyclePluginNames := make([]string, len(p.postCyclePlugins))
for i, postCyclePlugin := range p.postCyclePlugins {
postCyclePluginNames[i] = postCyclePlugin.TypedName().String()
}
return fmt.Sprintf(
"{Filters: [%s], Scorers: [%s], Picker: %s, PostCyclePlugins: [%s]}",
strings.Join(filterNames, ", "),
strings.Join(scorerNames, ", "),
p.picker.TypedName(),
strings.Join(postCyclePluginNames, ", "),
)
}

// RunCycle runs a SchedulerProfile cycle. In other words, it invokes all the SchedulerProfile plugins in this
// order - Filters, Scorers, Picker, PostCyclePlugins. After completing all, it returns the result.
func (p *SchedulerProfile) Run(ctx context.Context, request *types.LLMRequest, cycleState *types.CycleState, candidatePods []types.Pod) (*types.ProfileRunResult, error) {
Expand Down
10 changes: 10 additions & 0 deletions pkg/epp/scheduling/scheduler_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package scheduling

import (
"fmt"

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

Expand All @@ -33,3 +35,11 @@ type SchedulerConfig struct {
profileHandler framework.ProfileHandler
profiles map[string]*framework.SchedulerProfile
}

func (c *SchedulerConfig) String() string {
return fmt.Sprintf(
"{ProfileHandler: %s, Profiles: %v}",
c.profileHandler.TypedName(),
c.profiles,
)
}