|
266 | 266 |
|
267 | 267 | tasks: |
268 | 268 | - block: |
| 269 | + - name: Ensure log directory exists on DUT |
| 270 | + ansible.builtin.file: |
| 271 | + path: "{{ log_dir }}" |
| 272 | + state: directory |
| 273 | + mode: "0755" |
| 274 | + |
269 | 275 | - name: Get vLLM container logs |
270 | 276 | ansible.builtin.command: |
271 | 277 | cmd: "podman logs {{ vllm_container_name }}" |
|
277 | 283 | content: "{{ vllm_logs.stdout }}" |
278 | 284 | dest: "{{ log_dir }}/vllm-{{ core_configuration.name }}-{{ test_run_id }}.log" |
279 | 285 |
|
| 286 | + - name: Collect system metrics snapshot |
| 287 | + ansible.builtin.shell: | |
| 288 | + echo "=== CPU Info ===" > {{ log_dir }}/system-metrics-{{ test_run_id }}.log |
| 289 | + lscpu >> {{ log_dir }}/system-metrics-{{ test_run_id }}.log |
| 290 | + echo "" >> {{ log_dir }}/system-metrics-{{ test_run_id }}.log |
| 291 | + echo "=== Memory Usage ===" >> {{ log_dir }}/system-metrics-{{ test_run_id }}.log |
| 292 | + free -h >> {{ log_dir }}/system-metrics-{{ test_run_id }}.log |
| 293 | + echo "" >> {{ log_dir }}/system-metrics-{{ test_run_id }}.log |
| 294 | + echo "=== Container Stats ===" >> {{ log_dir }}/system-metrics-{{ test_run_id }}.log |
| 295 | + podman stats --no-stream {{ vllm_container_name }} >> {{ log_dir }}/system-metrics-{{ test_run_id }}.log 2>&1 || true |
| 296 | + args: |
| 297 | + executable: /bin/bash |
| 298 | + changed_when: false |
| 299 | + |
| 300 | + - name: Fetch vLLM logs to local results |
| 301 | + ansible.builtin.fetch: |
| 302 | + src: "{{ log_dir }}/vllm-{{ core_configuration.name }}-{{ test_run_id }}.log" |
| 303 | + dest: "{{ playbook_dir }}/../../../results/llm/{{ test_model | replace('/', '__') }}/{{ workload_type }}-{{ test_run_id }}/vllm-server.log" |
| 304 | + flat: true |
| 305 | + |
| 306 | + - name: Fetch system metrics to local results |
| 307 | + ansible.builtin.fetch: |
| 308 | + src: "{{ log_dir }}/system-metrics-{{ test_run_id }}.log" |
| 309 | + dest: "{{ playbook_dir }}/../../../results/llm/{{ test_model | replace('/', '__') }}/{{ workload_type }}-{{ test_run_id }}/system-metrics.log" |
| 310 | + flat: true |
| 311 | + |
280 | 312 | when: hostvars['localhost']['vllm_mode'] | default('managed') == 'managed' |
281 | 313 | # ============================================================================== |
282 | 314 | # STEP 8: Optional Cleanup (Managed Mode Only) |
|
0 commit comments