-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrun-benchmark.yaml
68 lines (68 loc) · 2.59 KB
/
run-benchmark.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
- name: Run Mir benchmark nodes (experiment ID {{ exp_id }})
hosts: all
gather_facts: False
become: False
environment:
PATH: "{{ ansible_env.PATH }}:/home/{{ ansible_user }}/mir/bin:"
tasks:
- name: Run benchmark
block:
- name: Execute kill script
ansible.builtin.script:
cmd: scripts/kill.sh
ignore_errors: True
- name: Delete potential leftover files from previous runs
file:
path: "/home/{{ ansible_user }}/{{ item }}"
state: absent
with_items:
- "{{ ready_sync_file }}"
- "{{ deliver_sync_file }}"
- "{{ node_config_file | basename }}"
- "{{ bench_output_file }}"
- "{{ node_log_file }}"
- name: Upload configuration file ({{ node_config_file }})
copy:
src: "{{ node_config_file }}"
dest: "/home/{{ ansible_user }}/"
- name: Start benchmark node
script:
cmd: scripts/start-benchmark.sh
"{{ lookup('ansible.utils.index_of', ansible_play_hosts_all, 'eq', ansible_host) }}"
"{{ node_config_file | basename }}"
"{{ ready_sync_file }}"
"{{ deliver_sync_file }}"
"{{ bench_output_file }}"
"{{ node_log_file }}"
- name: Wait for node to get ready ({{ ready_sync_file }})
wait_for:
path: "/home/{{ ansible_user }}/{{ ready_sync_file }}"
timeout: "{{ sync_wait_timeout }}"
- name: Launch benchmark ({{ ready_sync_file }})
file:
path: "/home/{{ ansible_user }}/{{ ready_sync_file }}"
state: absent
- name: Wait for nodes to finish the benchmark ({{ deliver_sync_file }})
wait_for:
path: "/home/{{ ansible_user }}/{{ deliver_sync_file }}"
timeout: "{{ sync_wait_timeout }}"
- name: Let nodes shut down ({{ deliver_sync_file }})
file:
path: "/home/{{ ansible_user }}/{{ deliver_sync_file }}"
state: absent
- name: Wait for benchmark output file ({{ bench_output_file }})
wait_for:
path: "/home/{{ ansible_user }}/{{ bench_output_file }}"
timeout: "30"
# Default timeout used here
always:
- name: Download output files
fetch:
flat: True
src: "/home/{{ ansible_user }}/{{ item }}"
dest: "{{ output_dir }}/data/{{ inventory_hostname }}-{{ item }}"
with_items:
- "{{ bench_output_file }}"
- "{{ node_log_file }}"
...