Skip to content

Commit

Permalink
Create multiple jobs based on number of nodes
Browse files Browse the repository at this point in the history
Separate Indexed from NonIndexed to compare.
  • Loading branch information
alculquicondor committed Mar 14, 2022
1 parent 3a1ad1c commit 89cf0ed
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 16 deletions.
54 changes: 42 additions & 12 deletions clusterloader2/testing/batch/config.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,67 @@
{{$jobs_per_node := 5}}
{{$num_jobs := MultiplyInt .Nodes $jobs_per_node}}
{{$pods_per_job := 10}}

name: batch

namespace:
number: 1
number: 2

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: mode = NonIndexed
- Identifier: WaitForFinishedIndexedJobs
Method: WaitForFinishedJobs
Params:
action: start
labelSelector: group = test-job
- name: Create job
labelSelector: mode = Indexed
- name: Create non-indexed jobs
phases:
- namespaceRange:
min: 1
max: 1
replicasPerNamespace: 1
tuningSet: Uniform1qps
replicasPerNamespace: {{$num_jobs}}
tuningSet: Uniform5qps
objectBundle:
- basename: test-job
objectTemplatePath: "job.yaml"
templateFillMap:
Replicas: {{$pods_per_job}}
Mode: NonIndexed
- name: Wait for non-indexed jobs to finish
measurements:
- Identifier: WaitForFinishedNonIndexedJobs
Method: WaitForFinishedJobs
Params:
action: gather
timeout: 5m
- name: Create indexed jobs
phases:
- namespaceRange:
min: 2
max: 2
replicasPerNamespace: {{$num_jobs}}
tuningSet: Uniform5qps
objectBundle:
- basename: test-job
objectTemplatePath: "job.yaml"
templateFillMap:
Replicas: 10
- name: Wait for jobs to finish
Replicas: {{$pods_per_job}}
Mode: Indexed
- name: Wait for indexed jobs to finish
measurements:
- Identifier: WaitForFinishedJobs
- Identifier: WaitForFinishedIndexedJobs
Method: WaitForFinishedJobs
Params:
action: gather
timeout: 1m
timeout: 5m
8 changes: 4 additions & 4 deletions clusterloader2/testing/batch/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ kind: Job
metadata:
name: {{.Name}}
labels:
group: test-job
mode: {{.Mode}}
spec:
parallelism: {{.Replicas}}
completions: {{.Replicas}}
completionMode: {{.Mode}}
template:
metadata:
labels:
group: test-pod
spec:
containers:
- name: {{.Name}}
image: bash
args: ["-c", "exit"]
restartPolicy: Never
image: gcr.io/k8s-staging-perf-tests/sleep:v0.0.3
restartPolicy: Never

0 comments on commit 89cf0ed

Please sign in to comment.