Skip to content

Commit 62ea9b7

Browse files
sarahbxjtaleric
authored andcommitted
Support for uperf multi-pair vm runs, adjust vm requirements to reflect usage
1 parent d328bb6 commit 62ea9b7

File tree

5 files changed

+53
-48
lines changed

5 files changed

+53
-48
lines changed

docs/uperf.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ You must have configured your k8s cluster with [Kubevirt](https://kubevirt.io) p
209209
```yaml
210210
server_vm:
211211
dedicatedcpuplacement: false # cluster would need have the CPUManager feature enabled
212-
sockets: 2
213-
cores: 1
212+
sockets: 1
213+
cores: 2
214214
threads: 1
215215
image: kubevirt/fedora-cloud-container-disk-demo:latest # your image must've ethtool installed if enabling multiqueue
216216
limits:
217-
memory: 2Gi
217+
memory: 4Gi
218218
requests:
219-
memory: 2Gi
219+
memory: 4Gi
220220
network:
221221
front_end: bridge # or masquerade
222222
multiqueue:
@@ -227,14 +227,14 @@ server_vm:
227227
#- hostpassthrough
228228
client_vm:
229229
dedicatedcpuplacement: false # cluster would need have the CPUManager feature enabled
230-
sockets: 2
231-
cores: 1
230+
sockets: 1
231+
cores: 2
232232
threads: 1
233233
image: kubevirt/fedora-cloud-container-disk-demo:latest # your image must've ethtool installed if enabling multiqueue
234234
limits:
235-
memory: 2Gi
235+
memory: 4Gi
236236
requests:
237-
memory: 2Gi
237+
memory: 4Gi
238238
network:
239239
front_end: bridge # or masquerade
240240
multiqueue:

resources/crds/ripsaw_v1alpha1_uperf_vm.yaml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ spec:
2020
pin_server: "node-0"
2121
pin_client: "node-1"
2222
samples: 2
23-
pair: 1 # has to be one 1 for vm
23+
pair: 1
2424
kind: vm
2525
server_vm:
2626
dedicatedcpuplacement: false
27-
sockets: 2
28-
cores: 1
27+
sockets: 1
28+
cores: 2
2929
threads: 1
3030
image: kubevirt/fedora-cloud-container-disk-demo:latest # your image must've ethtool installed if enabling multiqueue
3131
limits:
32-
memory: 2Gi
32+
memory: 4Gi
3333
requests:
34-
memory: 2Gi
34+
memory: 4Gi
3535
network:
3636
front_end: bridge # or masquerade
3737
multiqueue:
@@ -42,14 +42,14 @@ spec:
4242
#- hostpassthrough
4343
client_vm:
4444
dedicatedcpuplacement: false
45-
sockets: 2
46-
cores: 1
45+
sockets: 1
46+
cores: 2
4747
threads: 1
4848
image: kubevirt/fedora-cloud-container-disk-demo:latest
4949
limits:
50-
memory: 2Gi
50+
memory: 4Gi
5151
requests:
52-
memory: 2Gi
52+
memory: 4Gi
5353
network:
5454
front_end: bridge # or masquerade
5555
multiqueue:
@@ -59,15 +59,11 @@ spec:
5959
- none
6060
#- hostpassthrough
6161
test_types:
62-
#- stream
63-
- rr
62+
- stream
6463
protos:
6564
- tcp
66-
#- udp
6765
sizes:
68-
#- 1024
69-
- 512
66+
- 16384
7067
nthrs:
71-
#- 1
72-
- 2
73-
runtime: 5
68+
- 1
69+
runtime: 30

roles/uperf/tasks/main.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@
153153
when: "workload_args.pair|default('1')|int == server_vms | json_query('resources[].status[]')|selectattr('phase','match','Running')|list|length and workload_args.pair|default('1')|int == (server_vms | json_query('resources[].status.interfaces[0].ipAddress')|length)"
154154

155155
- name: blocking client from running uperf
156-
command: "redis-cli set {{ trunc_uuid }} false"
156+
command: "redis-cli set start false"
157157
with_items: "{{ server_vms.resources }}"
158158
when: "workload_args.pair|default('1')|int == server_vms | json_query('resources[].status[]')|selectattr('phase','match','Running')|list|length and workload_args.pair|default('1')|int == (server_vms | json_query('resources[].status.interfaces[0].ipAddress')|length)"
159159

160-
when: resource_state.resources[0].status.state == "Starting Servers" and resource_kind == "vm" and workload_args.pair|default('1')|int|int == 1
160+
when: resource_state.resources[0].status.state == "Starting Servers" and resource_kind == "vm"
161161

162162
- block:
163163

@@ -200,7 +200,6 @@
200200
- type = uperf-bench-server-{{ trunc_uuid }}
201201
register: server_vms
202202

203-
204203
- name: Generate uperf test files
205204
k8s:
206205
definition: "{{ lookup('template', 'configmap_script.yml.j2') | from_yaml }}"
@@ -253,27 +252,22 @@
253252
- name: set complete to false
254253
command: "redis-cli set complete false"
255254

256-
- name: Get client vm status
257-
k8s_facts:
258-
kind: VirtualMachineInstance
259-
api_version: kubevirt.io/v1alpha3
260-
namespace: '{{ operator_namespace }}'
261-
label_selectors:
262-
- app = uperf-bench-client-{{ trunc_uuid }}
263-
register: client_vms
264-
265-
- name: Update resource state
266-
operator_sdk.util.k8s_status:
267-
api_version: ripsaw.cloudbulldozer.io/v1alpha1
268-
kind: Benchmark
269-
name: "{{ meta.name }}"
270-
namespace: "{{ operator_namespace }}"
271-
status:
272-
state: Clients Running
273-
when: "workload_args.pair|default('1')|int == client_vms | json_query('resources[].status[]')|selectattr('phase','match','Running')|list|length and workload_args.pair|default('1')|int == (client_vms | json_query('resources[].status.interfaces[0].ipAddress')|length)"
255+
- name: Get count of clients ready
256+
command: "redis-cli get clients-{{ trunc_uuid }}"
257+
register: clients_ready_count
274258

275259
when: resource_kind == "vm"
276260

261+
- name: Update resource state
262+
operator_sdk.util.k8s_status:
263+
api_version: ripsaw.cloudbulldozer.io/v1alpha1
264+
kind: Benchmark
265+
name: "{{ meta.name }}"
266+
namespace: "{{ operator_namespace }}"
267+
status:
268+
state: Clients Running
269+
when: "workload_args.pair|default('1')|int == clients_ready_count.stdout|int"
270+
277271
when: resource_state.resources[0].status.state == "Waiting for Clients"
278272

279273
- block:
@@ -365,6 +359,12 @@
365359
when: cleanup
366360
when: resource_kind == "pod"
367361

362+
- name: delete redis keys
363+
command: "redis-cli del {{ item }}"
364+
loop:
365+
- "{{ trunc_uuid }}"
366+
- "clients-{{ trunc_uuid }}"
367+
368368
- operator_sdk.util.k8s_status:
369369
api_version: ripsaw.cloudbulldozer.io/v1alpha1
370370
kind: Benchmark

roles/uperf/templates/configmap_script.yml.j2

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ data:
2323
export clustername={{clustername}}
2424
export hostnet={{workload_args.hostnetwork}}
2525
export ips=$(hostname -I)
26+
echo "Setting ready, waiting for signal to start..."
27+
redis-cli -h {{bo.resources[0].status.podIP}} setnx clients-{{trunc_uuid}} 0
28+
redis-cli -h {{bo.resources[0].status.podIP}} incr clients-{{trunc_uuid}}
2629
while true; do
27-
if [[ ($(redis-cli -h {{bo.resources[0].status.podIP}} get start) =~ 'true') && ($(redis-cli -h {{bo.resources[0].status.podIP}} get {{ trunc_uuid }}) =~ 'true') ]]; then
30+
BO_START=$(redis-cli -h {{bo.resources[0].status.podIP}} get start)
31+
CLIENTS_READY=$(redis-cli -h {{bo.resources[0].status.podIP}} get clients-{{ trunc_uuid }})
32+
SERVERS_READY=$(redis-cli -h {{bo.resources[0].status.podIP}} get {{ trunc_uuid }})
33+
if [[ ("${BO_START}" =~ 'true') && ("${CLIENTS_READY}" == "${SERVERS_READY}") ]]; then
2834
{% for test in workload_args.test_types %}
2935
{% for proto in workload_args.protos %}
3036
{% for size in workload_args.sizes %}
@@ -43,9 +49,11 @@ data:
4349
{% endfor %}
4450
{% endfor %}
4551
else
52+
sleep 0.1;
4653
continue;
4754
fi;
4855
break;
4956
done;
5057
redis-cli -h {{bo.resources[0].status.podIP}} set start false
58+
redis-cli -h {{bo.resources[0].status.podIP}} del clients-{{trunc_uuid}}
5159
redis-cli -h {{bo.resources[0].status.podIP}} set complete true

roles/uperf/templates/server_vm.yml.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ spec:
5959
- ethtool -L eth0 combined {{ workload_args.server_vm.network.multiqueue.queues }}
6060
{% endif %}
6161
- dnf install -y uperf redis git
62-
- redis-cli -h {{ bo.resources[0].status.podIP }} set {{ trunc_uuid }} true
62+
- redis-cli -h {{ bo.resources[0].status.podIP }} setnx {{ trunc_uuid }} 0
63+
- redis-cli -h {{ bo.resources[0].status.podIP }} incr {{ trunc_uuid }}
6364
- uperf -s -v -P 20000
6465
name: cloudinitdisk
6566
status: {}

0 commit comments

Comments
 (0)