scheduler_perf: allow users to specify default pod and node specs (#101799)

* scheduler_perf: default pod and node spec

* Fix: un-support DefaultNodeTemplatePath
This commit is contained in:
Kensei Nakada 2022-06-30 03:44:07 +09:00 committed by GitHub
parent f045fb688f
commit b0d47cb380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 27 deletions

View File

@ -1,13 +1,12 @@
- name: SchedulingBasic - name: SchedulingBasic
defaultPodTemplatePath: config/pod-default.yaml
workloadTemplate: workloadTemplate:
- opcode: createNodes - opcode: createNodes
countParam: $initNodes countParam: $initNodes
- opcode: createPods - opcode: createPods
countParam: $initPods countParam: $initPods
podTemplatePath: config/pod-default.yaml
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-default.yaml
collectMetrics: true collectMetrics: true
workloads: workloads:
- name: 500Nodes - name: 500Nodes
@ -22,6 +21,7 @@
measurePods: 1000 measurePods: 1000
- name: SchedulingPodAntiAffinity - name: SchedulingPodAntiAffinity
defaultPodTemplatePath: config/pod-with-pod-anti-affinity.yaml
workloadTemplate: workloadTemplate:
- opcode: createNodes - opcode: createNodes
countParam: $initNodes countParam: $initNodes
@ -32,11 +32,9 @@
count: 2 count: 2
- opcode: createPods - opcode: createPods
countParam: $initPods countParam: $initPods
podTemplatePath: config/pod-with-pod-anti-affinity.yaml
namespace: sched-0 namespace: sched-0
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-with-pod-anti-affinity.yaml
collectMetrics: true collectMetrics: true
namespace: sched-1 namespace: sched-1
workloads: workloads:
@ -52,15 +50,14 @@
measurePods: 1000 measurePods: 1000
- name: SchedulingSecrets - name: SchedulingSecrets
defaultPodTemplatePath: config/pod-with-secret-volume.yaml
workloadTemplate: workloadTemplate:
- opcode: createNodes - opcode: createNodes
countParam: $initNodes countParam: $initNodes
- opcode: createPods - opcode: createPods
countParam: $initPods countParam: $initPods
podTemplatePath: config/pod-with-secret-volume.yaml
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-with-secret-volume.yaml
collectMetrics: true collectMetrics: true
workloads: workloads:
- name: 500Nodes - name: 500Nodes
@ -169,6 +166,7 @@
measurePods: 1000 measurePods: 1000
- name: SchedulingPodAffinity - name: SchedulingPodAffinity
defaultPodTemplatePath: config/pod-with-pod-affinity.yaml
workloadTemplate: workloadTemplate:
- opcode: createNodes - opcode: createNodes
countParam: $initNodes countParam: $initNodes
@ -181,11 +179,9 @@
count: 2 count: 2
- opcode: createPods - opcode: createPods
countParam: $initPods countParam: $initPods
podTemplatePath: config/pod-with-pod-affinity.yaml
namespace: sched-0 namespace: sched-0
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-with-pod-affinity.yaml
namespace: sched-1 namespace: sched-1
collectMetrics: true collectMetrics: true
workloads: workloads:
@ -201,6 +197,7 @@
measurePods: 1000 measurePods: 1000
- name: SchedulingPreferredPodAffinity - name: SchedulingPreferredPodAffinity
defaultPodTemplatePath: config/pod-with-preferred-pod-affinity.yaml
workloadTemplate: workloadTemplate:
- opcode: createNodes - opcode: createNodes
countParam: $initNodes countParam: $initNodes
@ -211,11 +208,9 @@
count: 2 count: 2
- opcode: createPods - opcode: createPods
countParam: $initPods countParam: $initPods
podTemplatePath: config/pod-with-preferred-pod-affinity.yaml
namespace: sched-0 namespace: sched-0
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-with-preferred-pod-affinity.yaml
namespace: sched-1 namespace: sched-1
collectMetrics: true collectMetrics: true
workloads: workloads:
@ -231,6 +226,7 @@
measurePods: 1000 measurePods: 1000
- name: SchedulingPreferredPodAntiAffinity - name: SchedulingPreferredPodAntiAffinity
defaultPodTemplatePath: config/pod-with-preferred-pod-affinity.yaml
workloadTemplate: workloadTemplate:
- opcode: createNodes - opcode: createNodes
countParam: $initNodes countParam: $initNodes
@ -241,11 +237,9 @@
count: 2 count: 2
- opcode: createPods - opcode: createPods
countParam: $initPods countParam: $initPods
podTemplatePath: config/pod-with-preferred-pod-anti-affinity.yaml
namespace: sched-0 namespace: sched-0
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-with-preferred-pod-anti-affinity.yaml
namespace: sched-1 namespace: sched-1
collectMetrics: true collectMetrics: true
workloads: workloads:
@ -261,6 +255,7 @@
measurePods: 1000 measurePods: 1000
- name: SchedulingNodeAffinity - name: SchedulingNodeAffinity
defaultPodTemplatePath: config/pod-with-node-affinity.yaml
workloadTemplate: workloadTemplate:
- opcode: createNodes - opcode: createNodes
countParam: $initNodes countParam: $initNodes
@ -270,10 +265,8 @@
labelValues: ["zone1"] labelValues: ["zone1"]
- opcode: createPods - opcode: createPods
countParam: $initPods countParam: $initPods
podTemplatePath: config/pod-with-node-affinity.yaml
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-with-node-affinity.yaml
collectMetrics: true collectMetrics: true
workloads: workloads:
- name: 500Nodes - name: 500Nodes
@ -342,6 +335,7 @@
measurePods: 2000 measurePods: 2000
- name: MixedSchedulingBasePod - name: MixedSchedulingBasePod
defaultPodTemplatePath: config/pod-default.yaml
workloadTemplate: workloadTemplate:
- opcode: createNodes - opcode: createNodes
countParam: $initNodes countParam: $initNodes
@ -354,7 +348,6 @@
count: 1 count: 1
- opcode: createPods - opcode: createPods
countParam: $initPods countParam: $initPods
podTemplatePath: config/pod-default.yaml
namespace: sched-0 namespace: sched-0
- opcode: createPods - opcode: createPods
countParam: $initPods countParam: $initPods
@ -374,7 +367,6 @@
namespace: sched-0 namespace: sched-0
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-default.yaml
collectMetrics: true collectMetrics: true
workloads: workloads:
- name: 500Nodes - name: 500Nodes
@ -498,6 +490,7 @@
measurePods: 2000 measurePods: 2000
- name: SchedulingRequiredPodAntiAffinityWithNSSelector - name: SchedulingRequiredPodAntiAffinityWithNSSelector
defaultPodTemplatePath: config/pod-anti-affinity-ns-selector.yaml
featureGates: featureGates:
PodAffinityNamespaceSelector: true PodAffinityNamespaceSelector: true
workloadTemplate: workloadTemplate:
@ -519,10 +512,8 @@
createPodsOp: createPodsOp:
opcode: createPods opcode: createPods
countParam: $initPodsPerNamespace countParam: $initPodsPerNamespace
podTemplatePath: config/pod-anti-affinity-ns-selector.yaml
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-anti-affinity-ns-selector.yaml
collectMetrics: true collectMetrics: true
namespace: measure-ns-0 namespace: measure-ns-0
workloads: workloads:
@ -534,6 +525,7 @@
measurePods: 1000 measurePods: 1000
- name: SchedulingPreferredAntiAffinityWithNSSelector - name: SchedulingPreferredAntiAffinityWithNSSelector
defaultPodTemplatePath: config/pod-preferred-anti-affinity-ns-selector.yaml
featureGates: featureGates:
PodAffinityNamespaceSelector: true PodAffinityNamespaceSelector: true
workloadTemplate: workloadTemplate:
@ -555,10 +547,8 @@
createPodsOp: createPodsOp:
opcode: createPods opcode: createPods
countParam: $initPodsPerNamespace countParam: $initPodsPerNamespace
podTemplatePath: config/pod-preferred-anti-affinity-ns-selector.yaml
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-preferred-anti-affinity-ns-selector.yaml
collectMetrics: true collectMetrics: true
namespace: measure-ns-0 namespace: measure-ns-0
workloads: workloads:
@ -570,6 +560,7 @@
measurePods: 1000 measurePods: 1000
- name: SchedulingRequiredPodAffinityWithNSSelector - name: SchedulingRequiredPodAffinityWithNSSelector
defaultPodTemplatePath: config/pod-affinity-ns-selector.yaml
featureGates: featureGates:
PodAffinityNamespaceSelector: true PodAffinityNamespaceSelector: true
workloadTemplate: workloadTemplate:
@ -592,10 +583,8 @@
createPodsOp: createPodsOp:
opcode: createPods opcode: createPods
countParam: $initPodsPerNamespace countParam: $initPodsPerNamespace
podTemplatePath: config/pod-affinity-ns-selector.yaml
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-affinity-ns-selector.yaml
collectMetrics: true collectMetrics: true
namespace: measure-ns-0 namespace: measure-ns-0
workloads: workloads:
@ -607,6 +596,7 @@
measurePods: 1000 measurePods: 1000
- name: SchedulingPreferredAffinityWithNSSelector - name: SchedulingPreferredAffinityWithNSSelector
defaultPodTemplatePath: config/pod-preferred-affinity-ns-selector.yaml
featureGates: featureGates:
PodAffinityNamespaceSelector: true PodAffinityNamespaceSelector: true
workloadTemplate: workloadTemplate:
@ -628,10 +618,8 @@
createPodsOp: createPodsOp:
opcode: createPods opcode: createPods
countParam: $initPodsPerNamespace countParam: $initPodsPerNamespace
podTemplatePath: config/pod-preferred-affinity-ns-selector.yaml
- opcode: createPods - opcode: createPods
countParam: $measurePods countParam: $measurePods
podTemplatePath: config/pod-preferred-affinity-ns-selector.yaml
collectMetrics: true collectMetrics: true
namespace: measure-ns-0 namespace: measure-ns-0
workloads: workloads:

View File

@ -103,9 +103,9 @@ type testCase struct {
Workloads []*workload Workloads []*workload
// SchedulerConfigFile is the path of scheduler configuration // SchedulerConfigFile is the path of scheduler configuration
SchedulerConfigFile string SchedulerConfigFile string
// TODO(#93792): reduce config toil by having a default pod and node spec per // Default path to spec file describing the pods to create. Optional.
// testCase? CreatePods and CreateNodes ops will inherit these unless // This path can be overridden in createPodsOp by setting PodTemplatePath .
// manually overridden. DefaultPodTemplatePath *string
} }
func (tc *testCase) collectsMetrics() bool { func (tc *testCase) collectsMetrics() bool {
@ -353,6 +353,7 @@ type createPodsOp struct {
// namespace of the format "namespace-<number>". // namespace of the format "namespace-<number>".
Namespace *string Namespace *string
// Path to spec file describing the pods to schedule. Optional. // Path to spec file describing the pods to schedule. Optional.
// If nil, DefaultPodTemplatePath will be used.
PodTemplatePath *string PodTemplatePath *string
// Whether or not to wait for all pods in this op to get scheduled. Optional, // Whether or not to wait for all pods in this op to get scheduled. Optional,
// defaults to false. // defaults to false.
@ -708,6 +709,9 @@ func runWorkload(b *testing.B, tc *testCase, w *workload) []DataItem {
} }
numPodsScheduledPerNamespace[namespace] = 0 numPodsScheduledPerNamespace[namespace] = 0
} }
if concreteOp.PodTemplatePath == nil {
concreteOp.PodTemplatePath = tc.DefaultPodTemplatePath
}
var collectors []testDataCollector var collectors []testDataCollector
var collectorCtx context.Context var collectorCtx context.Context
var collectorCancel func() var collectorCancel func()