Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Each pod has independent loops to refresh metrics #460

Merged
merged 5 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ vet: ## Run go vet against code.

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -race -coverprofile cover.out

.PHONY: test-integration
test-integration: manifests generate fmt vet envtest ## Run tests.
Expand Down
7 changes: 1 addition & 6 deletions cmd/epp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/metrics/filters"
"sigs.k8s.io/gateway-api-inference-extension/internal/runnable"
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend"
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/vllm"
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore"
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/metrics"
Expand Down Expand Up @@ -144,20 +143,16 @@ func run() error {
ctx := ctrl.SetupSignalHandler()

// Setup runner.
datastore := datastore.NewDatastore()
provider := backend.NewProvider(&vllm.PodMetricsClientImpl{}, datastore)
datastore := datastore.NewDatastore(ctx, &vllm.PodMetricsClientImpl{}, *refreshMetricsInterval, *refreshPrometheusMetricsInterval)
serverRunner := &runserver.ExtProcServerRunner{
GrpcPort: *grpcPort,
DestinationEndpointHintMetadataNamespace: *destinationEndpointHintMetadataNamespace,
DestinationEndpointHintKey: *destinationEndpointHintKey,
PoolName: *poolName,
PoolNamespace: *poolNamespace,
RefreshMetricsInterval: *refreshMetricsInterval,
RefreshPrometheusMetricsInterval: *refreshPrometheusMetricsInterval,
Datastore: datastore,
SecureServing: *secureServing,
CertPath: *certPath,
Provider: provider,
UseStreaming: useStreamingServer,
}
if err := serverRunner.SetupWithManager(ctx, mgr); err != nil {
Expand Down
183 changes: 0 additions & 183 deletions pkg/epp/backend/provider.go

This file was deleted.

151 changes: 0 additions & 151 deletions pkg/epp/backend/provider_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/epp/controller/inferencemodel_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func TestInferenceModelReconciler(t *testing.T) {
WithIndex(&v1alpha2.InferenceModel{}, datastore.ModelNameIndexKey, indexInferenceModelsByModelName).
Build()

datastore := datastore.NewFakeDatastore(nil, test.modelsInStore, pool)
datastore := datastore.NewFakeDatastore(t.Context(), &datastore.FakePodMetricsClient{}, nil, test.modelsInStore, pool)
reconciler := &InferenceModelReconciler{
Client: fakeClient,
Record: record.NewFakeRecorder(10),
Expand Down
Loading