Skip to content

Changes InferencePool EPP Flags #152

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

Merged
merged 1 commit into from
Jan 7, 2025
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
14 changes: 7 additions & 7 deletions pkg/ext-proc/backend/endpointslice_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ var (

type EndpointSliceReconciler struct {
client.Client
Scheme *runtime.Scheme
Record record.EventRecorder
ServerPoolName string
ServiceName string
Zone string
Namespace string
Datastore *K8sDatastore
Scheme *runtime.Scheme
Record record.EventRecorder
PoolName string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PoolName string
InferencePoolName string

ServiceName string
Zone string
Namespace string
Datastore *K8sDatastore
}

func (c *EndpointSliceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
Expand Down
16 changes: 8 additions & 8 deletions pkg/ext-proc/backend/inferencemodel_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import (

type InferenceModelReconciler struct {
client.Client
Scheme *runtime.Scheme
Record record.EventRecorder
Datastore *K8sDatastore
ServerPoolName string
Namespace string
Scheme *runtime.Scheme
Record record.EventRecorder
Datastore *K8sDatastore
PoolName string
PoolNamespace string
}

func (c *InferenceModelReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
if req.Namespace != c.Namespace {
if req.Namespace != c.PoolNamespace {
return ctrl.Result{}, nil
}
klog.V(1).Info("reconciling InferenceModel", req.NamespacedName)
Expand All @@ -43,8 +43,8 @@ func (c *InferenceModelReconciler) SetupWithManager(mgr ctrl.Manager) error {
}

func (c *InferenceModelReconciler) updateDatastore(infModel *v1alpha1.InferenceModel) {
if infModel.Spec.PoolRef.Name == c.ServerPoolName {
klog.V(1).Infof("Incoming pool ref %v, server pool name: %v", infModel.Spec.PoolRef, c.ServerPoolName)
if infModel.Spec.PoolRef.Name == c.PoolName {
klog.V(1).Infof("Incoming pool ref %v, server pool name: %v", infModel.Spec.PoolRef, c.PoolName)
klog.V(1).Infof("Adding/Updating inference model: %v", infModel.Spec.ModelName)
c.Datastore.InferenceModels.Store(infModel.Spec.ModelName, infModel)
return
Expand Down
4 changes: 2 additions & 2 deletions pkg/ext-proc/backend/inferencemodel_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ func TestUpdateDatastore_InferenceModelReconciler(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
InferenceModelReconciler := &InferenceModelReconciler{
Datastore: test.datastore,
ServerPoolName: test.datastore.inferencePool.Name,
Datastore: test.datastore,
PoolName: test.datastore.inferencePool.Name,
}
InferenceModelReconciler.updateDatastore(test.incomingService)

Expand Down
14 changes: 7 additions & 7 deletions pkg/ext-proc/backend/inferencepool_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ import (
// will have the proper controller that will create/manage objects on behalf of the server pool.
type InferencePoolReconciler struct {
client.Client
Scheme *runtime.Scheme
Record record.EventRecorder
ServerPoolName string
Namespace string
Datastore *K8sDatastore
Zone string
Scheme *runtime.Scheme
Record record.EventRecorder
PoolName string
PoolNamespace string
Datastore *K8sDatastore
Zone string
}

func (c *InferencePoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
if req.NamespacedName.Name != c.ServerPoolName || req.NamespacedName.Namespace != c.Namespace {
if req.NamespacedName.Name != c.PoolName || req.NamespacedName.Namespace != c.PoolNamespace {
return ctrl.Result{}, nil
}
klog.V(1).Info("reconciling InferencePool", req.NamespacedName)
Expand Down
54 changes: 27 additions & 27 deletions pkg/ext-proc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ var (
"targetPodHeader",
"target-pod",
"Header key used by Envoy to route to the appropriate pod. This must match Envoy configuration.")
serverPoolName = flag.String(
"serverPoolName",
poolName = flag.String(
"poolName",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"poolName",
"inferencePoolName",

"",
"Name of the serverPool this Endpoint Picker is associated with.")
"Name of the InferencePool this Endpoint Picker is associated with.")
poolNamespace = flag.String(
"poolNamespace",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"poolNamespace",
"inferencePoolNamespace",

"default",
"Namespace of the InferencePool this Endpoint Picker is associated with.")
serviceName = flag.String(
"serviceName",
"",
"Name of the service that will be used to read the endpointslices from")
namespace = flag.String(
"namespace",
"default",
"The Namespace that the server pool should exist in.")
"Name of the Service that will be used to read EndpointSlices from")
zone = flag.String(
"zone",
"",
Expand Down Expand Up @@ -114,35 +114,35 @@ func main() {
}

if err := (&backend.InferencePoolReconciler{
Datastore: datastore,
Scheme: mgr.GetScheme(),
Client: mgr.GetClient(),
ServerPoolName: *serverPoolName,
Namespace: *namespace,
Record: mgr.GetEventRecorderFor("InferencePool"),
Datastore: datastore,
Scheme: mgr.GetScheme(),
Client: mgr.GetClient(),
PoolName: *poolName,
PoolNamespace: *poolNamespace,
Record: mgr.GetEventRecorderFor("InferencePool"),
}).SetupWithManager(mgr); err != nil {
klog.Error(err, "Error setting up InferencePoolReconciler")
}

if err := (&backend.InferenceModelReconciler{
Datastore: datastore,
Scheme: mgr.GetScheme(),
Client: mgr.GetClient(),
ServerPoolName: *serverPoolName,
Namespace: *namespace,
Record: mgr.GetEventRecorderFor("InferenceModel"),
Datastore: datastore,
Scheme: mgr.GetScheme(),
Client: mgr.GetClient(),
PoolName: *poolName,
PoolNamespace: *poolNamespace,
Record: mgr.GetEventRecorderFor("InferenceModel"),
}).SetupWithManager(mgr); err != nil {
klog.Error(err, "Error setting up InferenceModelReconciler")
}

if err := (&backend.EndpointSliceReconciler{
Datastore: datastore,
Scheme: mgr.GetScheme(),
Client: mgr.GetClient(),
Record: mgr.GetEventRecorderFor("endpointslice"),
ServiceName: *serviceName,
Zone: *zone,
ServerPoolName: *serverPoolName,
Datastore: datastore,
Scheme: mgr.GetScheme(),
Client: mgr.GetClient(),
Record: mgr.GetEventRecorderFor("endpointslice"),
ServiceName: *serviceName,
Zone: *zone,
PoolName: *poolName,
}).SetupWithManager(mgr); err != nil {
klog.Error(err, "Error setting up EndpointSliceReconciler")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/manifests/ext_proc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
# TODO(https://github.com/kubernetes-sigs/llm-instance-gateway/issues/34) Update the image and args.
image: us-central1-docker.pkg.dev/k8s-staging-images/llm-instance-gateway/epp:main
args:
- -serverPoolName
- -poolName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- -poolName
- -inferencePoolName

- "vllm-llama2-7b-pool"
- -v
- "3"
Expand Down