diff --git a/.gitignore b/.gitignore index 4442b6516..db1d4621d 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ go.work.sum # generated docs site + +.envrc diff --git a/Makefile b/Makefile index bb4f078d9..672db27e9 100644 --- a/Makefile +++ b/Makefile @@ -494,6 +494,7 @@ image-build: check-container-tool load-version-json ## Build container image usi --build-arg TARGETARCH=$(TARGETARCH) \ --build-arg GIT_NM_USER=$(GIT_NM_USER)\ --build-arg NM_TOKEN=$(NM_TOKEN) \ + --progress=plain \ -t $(IMG) . .PHONY: image-push diff --git a/pkg/epp/scheduling/local_config.go b/pkg/epp/scheduling/local_config.go index fe4d0b3b7..85b91d7cd 100644 --- a/pkg/epp/scheduling/local_config.go +++ b/pkg/epp/scheduling/local_config.go @@ -90,4 +90,5 @@ func setPDFilter() { } defaultConfig.filters = append(defaultConfig.filters, filter.PDFilter) + loggerDebug.Info("Initialized PDFilter") } diff --git a/pkg/epp/scheduling/plugins/filter/pd_filter.go b/pkg/epp/scheduling/plugins/filter/pd_filter.go index 945c615d3..228d18143 100644 --- a/pkg/epp/scheduling/plugins/filter/pd_filter.go +++ b/pkg/epp/scheduling/plugins/filter/pd_filter.go @@ -19,8 +19,10 @@ import ( "fmt" "math/rand/v2" + "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics" "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/types" + logutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/logging" ) const ( @@ -42,6 +44,8 @@ var PDFilter = &baseFilter{ // Returns: // - Filtered slice of pod metrics, could contain one or zerro elements func prefillDecodeFilterFunc(ctx *types.SchedulingContext, pods []types.Pod) []types.Pod { + loggerDebug := log.FromContext(ctx).WithName("pd_filter").V(logutil.DEBUG) + pPods := make([]types.Pod, 0) dPods := make([]types.Pod, 0) @@ -56,7 +60,10 @@ func prefillDecodeFilterFunc(ctx *types.SchedulingContext, pods []types.Pod) []t if len(pPods) > 0 { // select a random prefill pod randomIndex := rand.IntN(len(pPods)) - ctx.MutatedHeaders[prefillPodHeader] = fmt.Sprintf("http://%s:%d", pPods[randomIndex].GetPod().Address, ctx.TargetPort) + url := fmt.Sprintf("http://%s:%d", pPods[randomIndex].GetPod().Address, ctx.TargetPort) + loggerDebug.Info("Prefill pod selected", "url", url) + + ctx.MutatedHeaders[prefillPodHeader] = url } if len(dPods) > 1 {