Skip to content

Commit 774fb62

Browse files
danehanscourageJ
authored andcommitted
Changes InferencePool EPP Flags (#152)
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent 111864d commit 774fb62

6 files changed

+52
-52
lines changed

pkg/ext-proc/backend/endpointslice_reconciler.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ var (
2121

2222
type EndpointSliceReconciler struct {
2323
client.Client
24-
Scheme *runtime.Scheme
25-
Record record.EventRecorder
26-
ServerPoolName string
27-
ServiceName string
28-
Zone string
29-
Namespace string
30-
Datastore *K8sDatastore
24+
Scheme *runtime.Scheme
25+
Record record.EventRecorder
26+
PoolName string
27+
ServiceName string
28+
Zone string
29+
Namespace string
30+
Datastore *K8sDatastore
3131
}
3232

3333
func (c *EndpointSliceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {

pkg/ext-proc/backend/inferencemodel_reconciler.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import (
1313

1414
type InferenceModelReconciler struct {
1515
client.Client
16-
Scheme *runtime.Scheme
17-
Record record.EventRecorder
18-
Datastore *K8sDatastore
19-
ServerPoolName string
20-
Namespace string
16+
Scheme *runtime.Scheme
17+
Record record.EventRecorder
18+
Datastore *K8sDatastore
19+
PoolName string
20+
PoolNamespace string
2121
}
2222

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

4545
func (c *InferenceModelReconciler) updateDatastore(infModel *v1alpha1.InferenceModel) {
46-
if infModel.Spec.PoolRef.Name == c.ServerPoolName {
47-
klog.V(1).Infof("Incoming pool ref %v, server pool name: %v", infModel.Spec.PoolRef, c.ServerPoolName)
46+
if infModel.Spec.PoolRef.Name == c.PoolName {
47+
klog.V(1).Infof("Incoming pool ref %v, server pool name: %v", infModel.Spec.PoolRef, c.PoolName)
4848
klog.V(1).Infof("Adding/Updating inference model: %v", infModel.Spec.ModelName)
4949
c.Datastore.InferenceModels.Store(infModel.Spec.ModelName, infModel)
5050
return

pkg/ext-proc/backend/inferencemodel_reconciler_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ func TestUpdateDatastore_InferenceModelReconciler(t *testing.T) {
125125
for _, test := range tests {
126126
t.Run(test.name, func(t *testing.T) {
127127
InferenceModelReconciler := &InferenceModelReconciler{
128-
Datastore: test.datastore,
129-
ServerPoolName: test.datastore.inferencePool.Name,
128+
Datastore: test.datastore,
129+
PoolName: test.datastore.inferencePool.Name,
130130
}
131131
InferenceModelReconciler.updateDatastore(test.incomingService)
132132

pkg/ext-proc/backend/inferencepool_reconciler.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ import (
1616
// will have the proper controller that will create/manage objects on behalf of the server pool.
1717
type InferencePoolReconciler struct {
1818
client.Client
19-
Scheme *runtime.Scheme
20-
Record record.EventRecorder
21-
ServerPoolName string
22-
Namespace string
23-
Datastore *K8sDatastore
24-
Zone string
19+
Scheme *runtime.Scheme
20+
Record record.EventRecorder
21+
PoolName string
22+
PoolNamespace string
23+
Datastore *K8sDatastore
24+
Zone string
2525
}
2626

2727
func (c *InferencePoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
28-
if req.NamespacedName.Name != c.ServerPoolName || req.NamespacedName.Namespace != c.Namespace {
28+
if req.NamespacedName.Name != c.PoolName || req.NamespacedName.Namespace != c.PoolNamespace {
2929
return ctrl.Result{}, nil
3030
}
3131
klog.V(1).Info("reconciling InferencePool", req.NamespacedName)

pkg/ext-proc/main.go

+27-27
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ var (
4444
"targetPodHeader",
4545
"target-pod",
4646
"Header key used by Envoy to route to the appropriate pod. This must match Envoy configuration.")
47-
serverPoolName = flag.String(
48-
"serverPoolName",
47+
poolName = flag.String(
48+
"poolName",
4949
"",
50-
"Name of the serverPool this Endpoint Picker is associated with.")
50+
"Name of the InferencePool this Endpoint Picker is associated with.")
51+
poolNamespace = flag.String(
52+
"poolNamespace",
53+
"default",
54+
"Namespace of the InferencePool this Endpoint Picker is associated with.")
5155
serviceName = flag.String(
5256
"serviceName",
5357
"",
54-
"Name of the service that will be used to read the endpointslices from")
55-
namespace = flag.String(
56-
"namespace",
57-
"default",
58-
"The Namespace that the server pool should exist in.")
58+
"Name of the Service that will be used to read EndpointSlices from")
5959
zone = flag.String(
6060
"zone",
6161
"",
@@ -124,35 +124,35 @@ func main() {
124124
}
125125

126126
if err := (&backend.InferencePoolReconciler{
127-
Datastore: datastore,
128-
Scheme: mgr.GetScheme(),
129-
Client: mgr.GetClient(),
130-
ServerPoolName: *serverPoolName,
131-
Namespace: *namespace,
132-
Record: mgr.GetEventRecorderFor("InferencePool"),
127+
Datastore: datastore,
128+
Scheme: mgr.GetScheme(),
129+
Client: mgr.GetClient(),
130+
PoolName: *poolName,
131+
PoolNamespace: *poolNamespace,
132+
Record: mgr.GetEventRecorderFor("InferencePool"),
133133
}).SetupWithManager(mgr); err != nil {
134134
klog.Error(err, "Error setting up InferencePoolReconciler")
135135
}
136136

137137
if err := (&backend.InferenceModelReconciler{
138-
Datastore: datastore,
139-
Scheme: mgr.GetScheme(),
140-
Client: mgr.GetClient(),
141-
ServerPoolName: *serverPoolName,
142-
Namespace: *namespace,
143-
Record: mgr.GetEventRecorderFor("InferenceModel"),
138+
Datastore: datastore,
139+
Scheme: mgr.GetScheme(),
140+
Client: mgr.GetClient(),
141+
PoolName: *poolName,
142+
PoolNamespace: *poolNamespace,
143+
Record: mgr.GetEventRecorderFor("InferenceModel"),
144144
}).SetupWithManager(mgr); err != nil {
145145
klog.Error(err, "Error setting up InferenceModelReconciler")
146146
}
147147

148148
if err := (&backend.EndpointSliceReconciler{
149-
Datastore: datastore,
150-
Scheme: mgr.GetScheme(),
151-
Client: mgr.GetClient(),
152-
Record: mgr.GetEventRecorderFor("endpointslice"),
153-
ServiceName: *serviceName,
154-
Zone: *zone,
155-
ServerPoolName: *serverPoolName,
149+
Datastore: datastore,
150+
Scheme: mgr.GetScheme(),
151+
Client: mgr.GetClient(),
152+
Record: mgr.GetEventRecorderFor("endpointslice"),
153+
ServiceName: *serviceName,
154+
Zone: *zone,
155+
PoolName: *poolName,
156156
}).SetupWithManager(mgr); err != nil {
157157
klog.Error(err, "Error setting up EndpointSliceReconciler")
158158
}

pkg/manifests/ext_proc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
# TODO(https://github.com/kubernetes-sigs/gateway-api-inference-extension/issues/34) Update the image and args.
5252
image: us-central1-docker.pkg.dev/k8s-staging-images/llm-instance-gateway/epp:main
5353
args:
54-
- -serverPoolName
54+
- -poolName
5555
- "vllm-llama2-7b-pool"
5656
- -v
5757
- "3"

0 commit comments

Comments
 (0)