diff --git a/roles/multibench_run/README.md b/roles/multibench_run/README.md index e8d3b0c3d..59d58ebdb 100644 --- a/roles/multibench_run/README.md +++ b/roles/multibench_run/README.md @@ -20,10 +20,18 @@ It uses a pre-existing VM/host where all the crucible binaries are ready. By default, the workload launched by default is the example-A of Multi-bench, composed of 2 uperf scenarios and 1 iperf. ![Multi-bench_example-A](images/example-A.png) + If you want to customize the scenarios, you can edit the `run.sh` file which defines the previous layout of test. You can edit the resources requested by the pods (clients or servers), in order to have a Guaranteed QoS. You can change the variable `multibench_script` to keep several scenarios ready and easily switch from one to another. +Note: For multibench daily jobs, workload launched is from directory "/root/crucible-examples/multibench/openshift/example-A/daily" on multibench-vm using the script "run-daily.sh" which inturn uses input json file "all-in-one.json". +For any customizations to launch multibench daily jobs, it is required to generate input json file using regulus script from [repo](https://github.com/redhat-performance/regulus/blob/main/bin/reg-c2j-config.py). + +```yaml +/root/regulus/bin/reg-c2j-config.py --name iperf,uperf --mv-params iperf-mv-params.json,uperf-mv-params.json --bench-ids iperf:21-26,uperf:1-20,uperf:27-32 --max-sample-failures=2 --endpoint k8s,user:kni,host:provisioner.cluster4.dfwt5g.lab,nodeSelector:client-1-7+21-22+27:nodeSelector-worker0.json,nodeSelector:client-8-14+30:nodeSelector-worker1.json,nodeSelector:client-15-20+23-26+28-29+31-32:nodeSelector-worker2.json,nodeSelector:server-1-22+25-27+31-32:nodeSelector:nodeSelector-worker2.json,nodeSelector:server-28:nodeSelector-worker0.json,nodeSelector:server-23-24+29:nodeSelector-worker1.json,userenv:stream9,resources:default:resource-2req-daily.json,resources:client-1-20:resource-1req-daily.json,controller-ip:192.168.5.30,client:1-32,server:1-32 +``` + ## Example - how to use the role In this example, the two mandatory variables for the role are defined in the Ansible inventory: @@ -44,4 +52,4 @@ A host `multibench` should be defined in the Ansible inventory like so: hosts: my-host.my-lab: ansible_user: root -``` \ No newline at end of file +``` diff --git a/roles/multibench_run/defaults/main.yml b/roles/multibench_run/defaults/main.yml index 170ae857c..edab01c44 100644 --- a/roles/multibench_run/defaults/main.yml +++ b/roles/multibench_run/defaults/main.yml @@ -1,5 +1,5 @@ -nb_iterations: "{{ multibench_sample | default('3') }}" +num_samples: "{{ multibench_sample | default('3') }}" multibench_tags: automation: ansible -multibench_script_dir: "/root/crucible-examples/multibench/openshift/example-A" +multibench_script_dir: "/root/crucible-examples/multibench/openshift/example-A/daily" multibench_script: "run.sh" diff --git a/roles/multibench_run/tasks/main.yml b/roles/multibench_run/tasks/main.yml index 480bdbdcb..de805cab9 100644 --- a/roles/multibench_run/tasks/main.yml +++ b/roles/multibench_run/tasks/main.yml @@ -20,6 +20,14 @@ delegate_to: "{{ multibench_host }}" become: true +- name: Generate input json file for multibench run + ansible.builtin.template: + src: templates/all-in-one.json.j2 + dest: "{{ multibench_script_dir }}/all-in-one.json" + mode: '0644' + delegate_to: "{{ multibench_host }}" + become: true + - name: Creating an output directory if needed when: - multibench_run_output_dir is undefined diff --git a/roles/multibench_run/templates/all-in-one.json.j2 b/roles/multibench_run/templates/all-in-one.json.j2 new file mode 100644 index 000000000..2513dbcc8 --- /dev/null +++ b/roles/multibench_run/templates/all-in-one.json.j2 @@ -0,0 +1,783 @@ +{ + "benchmarks": [ + { + "name": "iperf", + "ids": "21-26", + "mv-params": { + "global-options": [ + { + "name": "common-params", + "params": [ + { + "arg": "time", + "vals": [ + "60" + ] + } + ] + } + ], + "sets": [ + { + "include": "common-params", + "enabled": "yes", + "params": [ + { + "arg": "ifname", + "vals": [ + "eth0" + ], + "role": "server" + }, + { + "arg": "ipv", + "vals": [ + "4" + ], + "role": "all" + }, + { + "arg": "protocol", + "vals": [ + "udp" + ], + "id": "21" + }, + { + "arg": "bitrate", + "vals": [ + "200M" + ], + "id": "21" + }, + { + "arg": "length", + "vals": [ + "256" + ], + "id": "21" + }, + { + "arg": "protocol", + "vals": [ + "udp" + ], + "id": "22" + }, + { + "arg": "bitrate", + "vals": [ + "400M" + ], + "id": "22" + }, + { + "arg": "length", + "vals": [ + "512" + ], + "id": "22" + }, + { + "arg": "protocol", + "vals": [ + "udp" + ], + "id": "23" + }, + { + "arg": "bitrate", + "vals": [ + "200M" + ], + "id": "23" + }, + { + "arg": "length", + "vals": [ + "256" + ], + "id": "23" + }, + { + "arg": "protocol", + "vals": [ + "udp" + ], + "id": "24" + }, + { + "arg": "bitrate", + "vals": [ + "400M" + ], + "id": "24" + }, + { + "arg": "length", + "vals": [ + "512" + ], + "id": "24" + }, + { + "arg": "protocol", + "vals": [ + "udp" + ], + "id": "25" + }, + { + "arg": "bitrate", + "vals": [ + "200M" + ], + "id": "25" + }, + { + "arg": "length", + "vals": [ + "256" + ], + "id": "25" + }, + { + "arg": "protocol", + "vals": [ + "udp" + ], + "id": "26" + }, + { + "arg": "bitrate", + "vals": [ + "400M" + ], + "id": "26" + }, + { + "arg": "length", + "vals": [ + "512" + ], + "id": "26" + } + ] + } + ] + } + }, + { + "name": "uperf", + "ids": "1-20+27-32", + "mv-params": { + "global-options": [ + { + "name": "common-params", + "params": [ + { + "arg": "duration", + "vals": [ + "60" + ] + }, + { + "arg": "protocol", + "vals": [ + "tcp" + ] + }, + { + "arg": "nthreads", + "vals": [ + "1" + ] + }, + { + "arg": "ifname", + "vals": [ + "eth0" + ], + "role": "server" + } + ] + } + ], + "sets": [ + { + "include": "common-params", + "params": [ + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "1" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "1" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "1" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "2" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "2" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "2" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "3" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "3" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "3" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "4" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "4" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "4" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "5" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "5" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "5" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "6" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "6" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "6" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "7" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "7" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "7" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "8" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "8" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "8" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "9" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "9" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "9" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "10" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "10" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "10" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "11" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "11" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "11" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "12" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "12" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "12" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "13" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "13" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "13" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "14" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "14" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "14" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "15" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "15" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "15" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "16" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "16" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "16" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "17" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "17" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "17" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "18" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "18" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "18" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "19" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "19" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "19" + }, + { + "arg": "test-type", + "vals": [ + "crr" + ], + "id": "20" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "20" + }, + { + "arg": "rsize", + "vals": [ + "2048" + ], + "id": "20" + }, + { + "arg": "test-type", + "vals": [ + "stream" + ], + "id": "27" + }, + { + "arg": "wsize", + "vals": [ + "32768" + ], + "id": "27" + }, + { + "arg": "test-type", + "vals": [ + "stream" + ], + "id": "28" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "28" + }, + { + "arg": "nthreads", + "vals": [ + "16" + ], + "id": "28" + }, + { + "arg": "test-type", + "vals": [ + "stream" + ], + "id": "29" + }, + { + "arg": "wsize", + "vals": [ + "32768" + ], + "id": "29" + }, + { + "arg": "test-type", + "vals": [ + "stream" + ], + "id": "30" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "30" + }, + { + "arg": "nthreads", + "vals": [ + "16" + ], + "id": "30" + }, + { + "arg": "test-type", + "vals": [ + "stream" + ], + "id": "31" + }, + { + "arg": "wsize", + "vals": [ + "32768" + ], + "id": "31" + }, + { + "arg": "test-type", + "vals": [ + "stream" + ], + "id": "32" + }, + { + "arg": "wsize", + "vals": [ + "512" + ], + "id": "32" + }, + { + "arg": "nthreads", + "vals": [ + "16" + ], + "id": "32" + } + ] + } + ] + } + } + ], + "endpoints": [ + { + "type": "k8s", + "user": "kni", + "host": "{{ ocp_host }}", + "nodeSelector": [ + "client-1-7+21-22+27:{{ multibench_script_dir }}/nodeSelector-worker0.json", + "server-28:{{ multibench_script_dir }}/nodeSelector-worker0.json", + "client-8-14+30:{{ multibench_script_dir }}/nodeSelector-worker1.json", + "server-23-24+29:{{ multibench_script_dir }}/nodeSelector-worker1.json", + "client-15-20+23-26+28-29+31-32:{{ multibench_script_dir }}/nodeSelector-worker2.json", + "server-1-22+25-27+31-32:{{ multibench_script_dir }}/nodeSelector-worker2.json" + ], + "userenv": "stream9", + "masters-tool-collect": 0, + "client": "1-32", + "server": "1-32" + } + ], + "run-params": { + "num-samples": {{ multibench_sample | default(3) }}, + "max-sample-failures": 1 + }, + "tags": { + "automation": "ansible" + }, + "tool-params": [ + { + "tool": "sysstat", + "params": [ + { "arg": "subtools", "val": "mpstat", "enabled": "yes" }, + { "arg": "subtools", "val": "sar-net", "enabled": "yes" }, + { "arg": "subtools", "val": "iostat", "enabled": "yes" }, + { "arg": "subtools", "val": "sar-mem", "enabled": "yes" }, + { "arg": "subtools", "val": "sar-scheduler", "enabled": "yes" }, + { "arg": "subtools", "val": "sar-tasks", "enabled": "yes" } + ] + }, + { + "tool": "procstat" + } + ] +}