|
1 | 1 | --- |
2 | 2 | - name: Display current filesystem configuration |
3 | | - debug: |
| 3 | + ansible.builtin.debug: |
4 | 4 | msg: "Testing filesystem configuration {{ fs_index + 1 }}/{{ enabled_fs_configs | length }}: {{ fs_config.name }}" |
5 | 5 |
|
6 | 6 | - name: Unmount filesystem if mounted |
7 | | - mount: |
| 7 | + ansible.posix.mount: |
8 | 8 | path: "{{ ai_multifs_mount_point }}" |
9 | 9 | state: unmounted |
10 | 10 | ignore_errors: true |
11 | 11 |
|
12 | 12 | - name: Create filesystem with specific configuration |
13 | | - shell: "{{ fs_config.mkfs_cmd }} {{ ai_multifs_device }}" |
| 13 | + ansible.builtin.shell: "{{ fs_config.mkfs_cmd }} {{ ai_multifs_device }}" |
14 | 14 | register: mkfs_result |
15 | 15 |
|
16 | 16 | - name: Display mkfs output |
17 | | - debug: |
| 17 | + ansible.builtin.debug: |
18 | 18 | msg: "mkfs output: {{ mkfs_result.stdout }}" |
19 | 19 | when: mkfs_result.stdout != "" |
20 | 20 |
|
21 | 21 | - name: Mount filesystem with specific options |
22 | | - mount: |
| 22 | + ansible.posix.mount: |
23 | 23 | path: "{{ ai_multifs_mount_point }}" |
24 | 24 | src: "{{ ai_multifs_device }}" |
25 | 25 | fstype: "{{ fs_config.filesystem }}" |
26 | 26 | opts: "{{ fs_config.mount_opts }}" |
27 | 27 | state: mounted |
28 | 28 |
|
29 | 29 | - name: Create filesystem-specific results directory |
30 | | - file: |
| 30 | + ansible.builtin.file: |
31 | 31 | path: "{{ ai_multifs_results_dir }}/{{ fs_config.name }}" |
32 | 32 | state: directory |
33 | 33 | mode: "0755" |
34 | 34 |
|
35 | 35 | - name: Update AI benchmark configuration for current filesystem |
36 | | - set_fact: |
| 36 | + ansible.builtin.set_fact: |
37 | 37 | current_fs_benchmark_dir: "{{ ai_multifs_mount_point }}/ai-benchmark-data" |
38 | 38 | current_fs_results_dir: "{{ ai_multifs_results_dir }}/{{ fs_config.name }}" |
39 | 39 |
|
40 | 40 | - name: Create AI benchmark data directory on current filesystem |
41 | | - file: |
| 41 | + ansible.builtin.file: |
42 | 42 | path: "{{ current_fs_benchmark_dir }}" |
43 | 43 | state: directory |
44 | 44 | mode: "0755" |
45 | 45 |
|
46 | 46 | - name: Generate AI benchmark configuration for current filesystem |
47 | | - template: |
| 47 | + ansible.builtin.template: |
48 | 48 | src: milvus_config.json.j2 |
49 | 49 | dest: "{{ current_fs_results_dir }}/milvus_config.json" |
50 | 50 | mode: "0644" |
51 | 51 |
|
52 | 52 | - name: Run AI benchmark on current filesystem |
53 | | - shell: | |
| 53 | + ansible.builtin.shell: | |
54 | 54 | cd {{ current_fs_benchmark_dir }} |
55 | 55 | python3 {{ playbook_dir }}/roles/ai_run_benchmarks/files/milvus_benchmark.py \ |
56 | 56 | --config {{ current_fs_results_dir }}/milvus_config.json \ |
|
60 | 60 | poll: 30 |
61 | 61 |
|
62 | 62 | - name: Display benchmark completion |
63 | | - debug: |
| 63 | + ansible.builtin.debug: |
64 | 64 | msg: "Benchmark completed for {{ fs_config.name }}: {{ benchmark_result.stdout_lines[-5:] | default(['No output']) }}" |
65 | 65 |
|
66 | 66 | - name: Record filesystem configuration metadata |
67 | | - copy: |
| 67 | + ansible.builtin.copy: |
68 | 68 | content: | |
69 | 69 | # Filesystem Configuration: {{ fs_config.name }} |
70 | 70 | Filesystem Type: {{ fs_config.filesystem }} |
|
83 | 83 | mode: "0644" |
84 | 84 |
|
85 | 85 | - name: Capture filesystem statistics after benchmark |
86 | | - shell: | |
| 86 | + ansible.builtin.shell: | |
87 | 87 | echo "=== Filesystem Usage ===" > {{ current_fs_results_dir }}/filesystem_stats.txt |
88 | 88 | df -h {{ ai_multifs_mount_point }} >> {{ current_fs_results_dir }}/filesystem_stats.txt |
89 | 89 | echo "" >> {{ current_fs_results_dir }}/filesystem_stats.txt |
|
99 | 99 | ignore_errors: true |
100 | 100 |
|
101 | 101 | - name: Unmount filesystem after benchmark |
102 | | - mount: |
| 102 | + ansible.posix.mount: |
103 | 103 | path: "{{ ai_multifs_mount_point }}" |
104 | 104 | state: unmounted |
0 commit comments