Skip to content

Commit 2c21478

Browse files
authored
fix: comment out device allocation index assignment and logging in pod webhook (#446)
1 parent 5e030c8 commit 2c21478

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

internal/webhook/v1/pod_webhook.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
corev1 "k8s.io/api/core/v1"
3030
"k8s.io/apimachinery/pkg/api/equality"
3131
"k8s.io/apimachinery/pkg/api/errors"
32-
"k8s.io/apimachinery/pkg/api/resource"
3332
"k8s.io/apimachinery/pkg/util/strategicpatch"
3433
ctrl "sigs.k8s.io/controller-runtime"
3534
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -294,8 +293,8 @@ func (m *TensorFusionPodMutator) patchTFClient(
294293
// Index must be assigned in webhook stage since scheduler cannot modify Pod
295294
// This is a special index resource (1-512), not a real device resource
296295
// Index is assigned in ascending order (1, 2, 3, ...) via distributed lock (leader election)
297-
index := m.assignDeviceAllocationIndex(ctx, pod)
298-
log.FromContext(ctx).Info("assigned device allocation index successfully", "index", index, "pod", pod.Name)
296+
// index := m.assignDeviceAllocationIndex(ctx, pod)
297+
// log.FromContext(ctx).Info("assigned device allocation index successfully", "index", index, "pod", pod.Name)
299298

300299
for _, containerIndex := range containerIndices {
301300
container := &pod.Spec.Containers[containerIndex]
@@ -332,7 +331,7 @@ func (m *TensorFusionPodMutator) patchTFClient(
332331
container.Resources.Limits = make(corev1.ResourceList)
333332
}
334333
// Limit is set to actual index value (1-512) for Device Plugin to match Pod
335-
container.Resources.Limits[constants.PodIndexAnnotation] = resource.MustParse(strconv.Itoa(index))
334+
// container.Resources.Limits[constants.PodIndexAnnotation] = resource.MustParse(strconv.Itoa(index))
336335

337336
if !isLocalGPU {
338337
addConnectionForRemoteFixedReplicaVirtualGPU(pod, container, clientConfig)

0 commit comments

Comments
 (0)