Skip to content
Merged
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
11 changes: 6 additions & 5 deletions internal/webhook/v1/pod_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func (m *TensorFusionPodMutator) createOrUpdateWorkload(
}

func (m *TensorFusionPodMutator) patchTFClient(
ctx context.Context,
_ctx context.Context,
pod *corev1.Pod,
pool *tfv1.GPUPool,
isLocalGPU bool,
Expand All @@ -302,8 +302,8 @@ func (m *TensorFusionPodMutator) patchTFClient(
// Index must be assigned in webhook stage since scheduler cannot modify Pod
// This is a special index resource (1-512), not a real device resource
// Index is assigned in ascending order (1, 2, 3, ...) via distributed lock (leader election)
index := m.assignDeviceAllocationIndex(ctx, pod)
log.FromContext(ctx).Info("assigned device allocation index successfully", "index", index, "pod", pod.Name)
// index := m.assignDeviceAllocationIndex(ctx, pod)
// log.FromContext(ctx).Info("assigned device allocation index successfully", "index", index, "pod", pod.Name)

for _, containerIndex := range containerIndices {
container := &pod.Spec.Containers[containerIndex]
Expand Down Expand Up @@ -341,8 +341,9 @@ func (m *TensorFusionPodMutator) patchTFClient(
}
// Limit is set to actual index value (1-512) for Device Plugin to match Pod
// ResourceFit of dummy device already ignored in TF scheduler
indexQuantity := resource.MustParse(strconv.Itoa(index))
container.Resources.Limits[constants.PodIndexAnnotation] = indexQuantity
// indexQuantity := resource.MustParse(strconv.Itoa(index))
// TODO: workaround to avoid kubelet resource check error
container.Resources.Limits[constants.PodIndexAnnotation] = resource.MustParse("1")

if !isLocalGPU {
addConnectionForRemoteFixedReplicaVirtualGPU(pod, container, clientConfig)
Expand Down
Loading