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
6 changes: 2 additions & 4 deletions internal/runnable/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ func GRPCServer(name string, srv *grpc.Server, port int) manager.Runnable {
// Start listening.
lis, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
if err != nil {
log.Error(err, "gRPC server failed to listen")
return err
return fmt.Errorf("gRPC server failed to listen - %w", err)
}

log.Info("gRPC server listening", "port", port)
Expand All @@ -59,8 +58,7 @@ func GRPCServer(name string, srv *grpc.Server, port int) manager.Runnable {

// Keep serving until terminated.
if err := srv.Serve(lis); err != nil && err != grpc.ErrServerStopped {
log.Error(err, "gRPC server failed")
return err
return fmt.Errorf("gRPC server failed - %w", err)
}
log.Info("gRPC server terminated")
return nil
Expand Down
3 changes: 0 additions & 3 deletions pkg/bbr/handlers/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ func (s *Server) Process(srv extProcPb.ExternalProcessor_ProcessServer) error {
return nil
}
if recvErr != nil {
// This error occurs very frequently, though it doesn't seem to have any impact.
// TODO Figure out if we can remove this noise.
loggerVerbose.Error(recvErr, "Cannot receive stream request")
return status.Errorf(codes.Unknown, "cannot receive stream request: %v", recvErr)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/bbr/server/runserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package server
import (
"context"
"crypto/tls"
"fmt"

extProcPb "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3"
"github.com/go-logr/logr"
Expand Down Expand Up @@ -54,8 +55,7 @@ func (r *ExtProcServerRunner) AsRunnable(logger logr.Logger) manager.Runnable {
if r.SecureServing {
cert, err := tlsutil.CreateSelfSignedTLSCertificate(logger)
if err != nil {
logger.Error(err, "Failed to create self signed certificate")
return err
return fmt.Errorf("failed to create self signed certificate - %w", err)
}
creds := credentials.NewTLS(&tls.Config{Certificates: []tls.Certificate{cert}})
srv = grpc.NewServer(grpc.Creds(creds))
Expand Down
4 changes: 2 additions & 2 deletions pkg/epp/controller/inferenceobjective_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package controller

import (
"context"
"fmt"

"k8s.io/apimachinery/pkg/api/errors"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down Expand Up @@ -48,8 +49,7 @@ func (c *InferenceObjectiveReconciler) Reconcile(ctx context.Context, req ctrl.R
notFound := false
if err := c.Get(ctx, req.NamespacedName, infObjective); err != nil {
if !errors.IsNotFound(err) {
logger.Error(err, "Unable to get InferenceObjective")
return ctrl.Result{}, err
return ctrl.Result{}, fmt.Errorf("unable to get InferenceObjective - %w", err)
}
notFound = true
}
Expand Down
13 changes: 4 additions & 9 deletions pkg/epp/controller/inferencepool_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ func (c *InferencePoolReconciler) Reconcile(ctx context.Context, req ctrl.Reques
obj = &v1alpha2.InferencePool{}
default:
// Handle unsupported groups gracefully.
err := fmt.Errorf("unsupported API group: %s", c.PoolGKNN.Group)
logger.Error(err, "Cannot reconcile InferencePool")
return ctrl.Result{}, err
return ctrl.Result{}, fmt.Errorf("cannot reconcile InferencePool - unsupported API group: %s", c.PoolGKNN.Group)
}

// 2. Perform a single, generic fetch for the object.
Expand All @@ -68,8 +66,7 @@ func (c *InferencePoolReconciler) Reconcile(ctx context.Context, req ctrl.Reques
c.Datastore.Clear()
return ctrl.Result{}, nil
}
logger.Error(err, "Unable to get InferencePool")
return ctrl.Result{}, err
return ctrl.Result{}, fmt.Errorf("unable to get InferencePool - %w", err)
}

// 3. Perform common checks using the client.Object interface.
Expand All @@ -90,16 +87,14 @@ func (c *InferencePoolReconciler) Reconcile(ctx context.Context, req ctrl.Reques
var err error
err = pool.ConvertTo(v1infPool)
if err != nil {
logger.Error(err, "Failed to convert XInferencePool to InferencePool")
return ctrl.Result{}, err
return ctrl.Result{}, fmt.Errorf("failed to convert XInferencePool to InferencePool - %w", err)
}
default:
return ctrl.Result{}, fmt.Errorf("unsupported API group: %s", c.PoolGKNN.Group)
}

if err := c.Datastore.PoolSet(ctx, c.Reader, v1infPool); err != nil {
logger.Error(err, "Failed to update datastore")
return ctrl.Result{}, err
return ctrl.Result{}, fmt.Errorf("failed to update datastore - %w", err)
}

return ctrl.Result{}, nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/epp/controller/pod_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package controller

import (
"context"
"fmt"

"github.com/go-logr/logr"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -55,8 +56,7 @@ func (c *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
c.Datastore.PodDelete(req.NamespacedName)
return ctrl.Result{}, nil
}
logger.V(logutil.DEFAULT).Error(err, "Unable to get pod")
return ctrl.Result{}, err
return ctrl.Result{}, fmt.Errorf("unable to get pod - %w", err)
}

c.updateDatastore(logger, pod)
Expand Down
4 changes: 2 additions & 2 deletions pkg/epp/handlers/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package handlers
import (
"context"
"encoding/json"
"fmt"
"strings"

configPb "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
Expand All @@ -39,8 +40,7 @@ func (s *StreamingServer) HandleResponseBody(ctx context.Context, reqCtx *Reques
logger := log.FromContext(ctx)
responseBytes, err := json.Marshal(response)
if err != nil {
logger.V(logutil.DEFAULT).Error(err, "error marshalling responseBody")
return reqCtx, err
return reqCtx, fmt.Errorf("error marshalling responseBody - %w", err)
}
if response["usage"] != nil {
usg := response["usage"].(map[string]any)
Expand Down
3 changes: 0 additions & 3 deletions pkg/epp/handlers/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@ func (s *StreamingServer) Process(srv extProcPb.ExternalProcessor_ProcessServer)
return nil
}
if recvErr != nil {
// This error occurs very frequently, though it doesn't seem to have any impact.
// TODO Figure out if we can remove this noise.
logger.V(logutil.DEFAULT).Error(err, "Cannot receive stream request")
return status.Errorf(codes.Unknown, "cannot receive stream request: %v", err)
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/epp/server/runserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ func (r *ExtProcServerRunner) AsRunnable(logger logr.Logger) manager.Runnable {
cert, err = tlsutil.CreateSelfSignedTLSCertificate(logger)
}
if err != nil {
logger.Error(err, "Failed to create self signed certificate")
return err
return fmt.Errorf("failed to create self signed certificate - %w", err)
}

creds := credentials.NewTLS(&tls.Config{
Expand Down