diff --git a/clusterloader2/pkg/measurement/common/wait_for_jobs.go b/clusterloader2/pkg/measurement/common/wait_for_jobs.go index 8a2e44ea30..ee5b2f79ba 100644 --- a/clusterloader2/pkg/measurement/common/wait_for_jobs.go +++ b/clusterloader2/pkg/measurement/common/wait_for_jobs.go @@ -46,7 +46,7 @@ const ( defaultWaitForFinishedJobsTimeout = 10 * time.Minute waitForFinishedJobsName = "WaitForFinishedJobs" waitForFinishedJobsWorkers = 1 - checkFinishedJobsInterval = 5 * time.Second + checkFinishedJobsInterval = time.Second ) func init() { diff --git a/clusterloader2/testing/batch/config.yaml b/clusterloader2/testing/batch/config.yaml index de1453dd08..08df0d3feb 100644 --- a/clusterloader2/testing/batch/config.yaml +++ b/clusterloader2/testing/batch/config.yaml @@ -1,37 +1,116 @@ +{{$pods_per_node_per_size := 20}} +{{$total_pods_per_size := MultiplyInt .Nodes $pods_per_node_per_size}} +{{$small_job_size := 5}} +{{$small_jobs_count := DivideInt $total_pods_per_size $small_job_size}} +{{$medium_job_size := 20}} +{{$medium_jobs_count := DivideInt $total_pods_per_size $medium_job_size}} +{{$large_job_size := 400}} +{{$large_jobs_count := DivideInt $total_pods_per_size $large_job_size}} + name: batch namespace: number: 1 tuningSets: -- name: Uniform1qps +- name: Uniform5qps qpsLoad: - qps: 1 + qps: 5 steps: - name: Start measurements measurements: - - Identifier: WaitForFinishedJobs + - Identifier: WaitForFinishedNonIndexedJobs Method: WaitForFinishedJobs Params: action: start - labelSelector: group = test-job -- name: Create job + labelSelector: mode = NonIndexed + - Identifier: WaitForFinishedIndexedJobs + Method: WaitForFinishedJobs + Params: + action: start + labelSelector: mode = Indexed +- name: Create non-indexed jobs phases: - namespaceRange: min: 1 max: 1 - replicasPerNamespace: 1 - tuningSet: Uniform1qps + replicasPerNamespace: {{$small_jobs_count}} + tuningSet: Uniform5qps + objectBundle: + - basename: small-non-indexed + objectTemplatePath: "job.yaml" + templateFillMap: + Replicas: {{$small_job_size}} + Mode: NonIndexed + - namespaceRange: + min: 1 + max: 1 + replicasPerNamespace: {{$medium_jobs_count}} + tuningSet: Uniform5qps + objectBundle: + - basename: medium-non-indexed + objectTemplatePath: "job.yaml" + templateFillMap: + Replicas: {{$medium_job_size}} + Mode: NonIndexed + - namespaceRange: + min: 1 + max: 1 + replicasPerNamespace: {{$large_jobs_count}} + tuningSet: Uniform5qps + objectBundle: + - basename: large-non-indexed + objectTemplatePath: "job.yaml" + templateFillMap: + Replicas: {{$large_job_size}} + Mode: NonIndexed +- name: Wait for non-indexed jobs to finish + measurements: + - Identifier: WaitForFinishedNonIndexedJobs + Method: WaitForFinishedJobs + Params: + action: gather + timeout: 10m +- name: Create indexed jobs + phases: + - namespaceRange: + min: 1 + max: 1 + replicasPerNamespace: {{$small_jobs_count}} + tuningSet: Uniform5qps + objectBundle: + - basename: small-indexed + objectTemplatePath: "job.yaml" + templateFillMap: + Replicas: {{$small_job_size}} + Mode: Indexed + - namespaceRange: + min: 1 + max: 1 + replicasPerNamespace: {{$medium_jobs_count}} + tuningSet: Uniform5qps + objectBundle: + - basename: medium-indexed + objectTemplatePath: "job.yaml" + templateFillMap: + Replicas: {{$medium_job_size}} + Mode: Indexed + - namespaceRange: + min: 1 + max: 1 + replicasPerNamespace: {{$large_jobs_count}} + tuningSet: Uniform5qps objectBundle: - - basename: test-job + - basename: large-indexed objectTemplatePath: "job.yaml" templateFillMap: - Replicas: 10 -- name: Wait for jobs to finish + Replicas: {{$large_job_size}} + Mode: Indexed +- name: Wait for indexed jobs to finish measurements: - - Identifier: WaitForFinishedJobs + - Identifier: WaitForFinishedIndexedJobs Method: WaitForFinishedJobs Params: action: gather - timeout: 1m \ No newline at end of file + timeout: 10m diff --git a/clusterloader2/testing/batch/job.yaml b/clusterloader2/testing/batch/job.yaml index ab728da9da..b9497e8851 100644 --- a/clusterloader2/testing/batch/job.yaml +++ b/clusterloader2/testing/batch/job.yaml @@ -3,10 +3,11 @@ kind: Job metadata: name: {{.Name}} labels: - group: test-job + mode: {{.Mode}} spec: parallelism: {{.Replicas}} completions: {{.Replicas}} + completionMode: {{.Mode}} template: metadata: labels: @@ -14,6 +15,5 @@ spec: spec: containers: - name: {{.Name}} - image: bash - args: ["-c", "exit"] - restartPolicy: Never \ No newline at end of file + image: gcr.io/k8s-staging-perf-tests/sleep:v0.0.3 + restartPolicy: Never