Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Romani <[email protected]>
  • Loading branch information
ffromani committed Jan 24, 2025
1 parent e259d94 commit 43aae27
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions test/e2e/serial/tests/scheduler_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,17 @@ var _ = Describe("[serial][scheduler][cache][tier0] scheduler cache", Serial, La
cpuNum, ok := cpuQty.AsInt64()
Expect(ok).To(BeTrue(), "invalid CPU resource in zone %q node %q: %v", referenceZone.Name, referenceNode.Name, cpuQty)

cpuPerPod := int(float64(cpuNum) * 0.6) // anything that consumes > 50% (because overreserve over 2 NUMA zones) is fine
memoryPerPod := 8 * 1024 * 1024 * 1024 // random non-zero amount
cpuPerPod := int64(float64(cpuNum) * 0.6) // anything that consumes > 50% (because overreserve over 2 NUMA zones) is fine
memoryPerPod := int64(8 * 1024 * 1024 * 1024) // random non-zero amount

// so we have now:
// - because of CPU request > 51% of available, a NUMA zone can run at most 1 pod.
// - because of the overreservation, a single pod will consume resources on BOTH NUMA zones
// - hence at most 1 pod per compute node should be running until reconciliation catches up

podRequiredRes := corev1.ResourceList{
corev1.ResourceMemory: *resource.NewQuantity(int64(memoryPerPod), resource.BinarySI),
corev1.ResourceCPU: *resource.NewQuantity(int64(cpuPerPod), resource.DecimalSI),
corev1.ResourceMemory: *resource.NewQuantity(memoryPerPod, resource.BinarySI),
corev1.ResourceCPU: *resource.NewQuantity(cpuPerPod, resource.DecimalSI),
}

var zero int64
Expand Down Expand Up @@ -383,14 +383,14 @@ var _ = Describe("[serial][scheduler][cache][tier0] scheduler cache", Serial, La
cpuNum, ok := cpuQty.AsInt64()
Expect(ok).To(BeTrue(), "invalid CPU resource in zone %q node %q: %v", referenceZone.Name, referenceNode.Name, cpuQty)

cpuPerPod := int(float64(cpuNum) * 0.7) // anything that consumes > 50% (because overreserve over 2 NUMA zones) is fine
memoryPerPod := 8 * 1024 * 1024 * 1024
devicePerPod := 1
cpuPerPod := int64(float64(cpuNum) * 0.7) // anything that consumes > 50% (because overreserve over 2 NUMA zones) is fine
memoryPerPod := int64(8 * 1024 * 1024 * 1024)
devicePerPod := int64(1)

Check failure on line 388 in test/e2e/serial/tests/scheduler_cache.go

View workflow job for this annotation

GitHub Actions / golangci-lint

declared and not used: devicePerPod (typecheck)

podRequiredRes := corev1.ResourceList{
corev1.ResourceMemory: *resource.NewQuantity(int64(memoryPerPod), resource.BinarySI),
corev1.ResourceCPU: *resource.NewQuantity(int64(cpuPerPod), resource.DecimalSI),
corev1.ResourceName(deviceName): *resource.NewQuantity(int64(devicePerPod), resource.DecimalSI),
corev1.ResourceMemory: *resource.NewQuantity(memoryPerPod, resource.BinarySI),
corev1.ResourceCPU: *resource.NewQuantity(cpuPerPod, resource.DecimalSI),
corev1.ResourceName(deviceName): *resource.NewQuantity(devicePerPod, resource.DecimalSI),
}

var zero int64
Expand Down Expand Up @@ -504,14 +504,14 @@ var _ = Describe("[serial][scheduler][cache][tier0] scheduler cache", Serial, La
cpuNum, ok := cpuQty.AsInt64()
Expect(ok).To(BeTrue(), "invalid CPU resource in zone %q node %q: %v", referenceZone.Name, referenceNode.Name, cpuQty)

cpuPerPod := int(float64(cpuNum) * 0.6) // anything that consumes > 50% (because overreserve over 2 NUMA zones) is fine
memoryPerPod := 8 * 1024 * 1024 * 1024
devicePerPod := 1
cpuPerPod := int64(float64(cpuNum) * 0.6) // anything that consumes > 50% (because overreserve over 2 NUMA zones) is fine
memoryPerPod := int64(8 * 1024 * 1024 * 1024)
devicePerPod := int64(1)

Check failure on line 509 in test/e2e/serial/tests/scheduler_cache.go

View workflow job for this annotation

GitHub Actions / golangci-lint

declared and not used: devicePerPod (typecheck)

podRequiredRes := corev1.ResourceList{
corev1.ResourceMemory: *resource.NewQuantity(int64(memoryPerPod), resource.BinarySI),
corev1.ResourceCPU: *resource.NewQuantity(int64(cpuPerPod), resource.DecimalSI),
corev1.ResourceName(deviceName): *resource.NewQuantity(int64(devicePerPod), resource.DecimalSI),
corev1.ResourceMemory: *resource.NewQuantity(memoryPerPod, resource.BinarySI),
corev1.ResourceCPU: *resource.NewQuantity(cpuPerPod, resource.DecimalSI),
corev1.ResourceName(deviceName): *resource.NewQuantity(devicePerPod, resource.DecimalSI),
}

var zero int64
Expand Down

0 comments on commit 43aae27

Please sign in to comment.