Ghanshyam Mann | 580fec5 | 2021-04-08 11:03:37 -0500 | [diff] [blame] | 1 | - name: Process Stackviz |
Ghanshyam Mann | 264d2a2 | 2020-06-19 10:31:38 -0500 | [diff] [blame] | 2 | block: |
Ghanshyam Mann | 264d2a2 | 2020-06-19 10:31:38 -0500 | [diff] [blame] | 3 | |
Ghanshyam Mann | 580fec5 | 2021-04-08 11:03:37 -0500 | [diff] [blame] | 4 | - name: Devstack checks if stackviz archive exists |
| 5 | stat: |
| 6 | path: "/opt/cache/files/stackviz-latest.tar.gz" |
| 7 | register: stackviz_archive |
Ghanshyam Mann | 264d2a2 | 2020-06-19 10:31:38 -0500 | [diff] [blame] | 8 | |
Ghanshyam Mann | 580fec5 | 2021-04-08 11:03:37 -0500 | [diff] [blame] | 9 | - debug: |
| 10 | msg: "Stackviz archive could not be found in /opt/cache/files/stackviz-latest.tar.gz" |
| 11 | when: not stackviz_archive.stat.exists |
Ghanshyam Mann | 264d2a2 | 2020-06-19 10:31:38 -0500 | [diff] [blame] | 12 | |
Ghanshyam Mann | 580fec5 | 2021-04-08 11:03:37 -0500 | [diff] [blame] | 13 | - name: Check if subunit data exists |
| 14 | stat: |
| 15 | path: "{{ zuul_work_dir }}/testrepository.subunit" |
| 16 | register: subunit_input |
Ghanshyam Mann | 264d2a2 | 2020-06-19 10:31:38 -0500 | [diff] [blame] | 17 | |
Ghanshyam Mann | 580fec5 | 2021-04-08 11:03:37 -0500 | [diff] [blame] | 18 | - debug: |
| 19 | msg: "Subunit file could not be found at {{ zuul_work_dir }}/testrepository.subunit" |
| 20 | when: not subunit_input.stat.exists |
Ghanshyam Mann | 264d2a2 | 2020-06-19 10:31:38 -0500 | [diff] [blame] | 21 | |
Ghanshyam Mann | 580fec5 | 2021-04-08 11:03:37 -0500 | [diff] [blame] | 22 | - name: Install stackviz |
| 23 | when: |
| 24 | - stackviz_archive.stat.exists |
| 25 | - subunit_input.stat.exists |
| 26 | block: |
| 27 | - include_role: |
| 28 | name: ensure-pip |
| 29 | |
| 30 | - pip: |
| 31 | name: "file://{{ stackviz_archive.stat.path }}" |
| 32 | virtualenv: /tmp/stackviz |
| 33 | virtualenv_command: '{{ ensure_pip_virtualenv_command }}' |
| 34 | extra_args: -U |
| 35 | |
| 36 | - name: Deploy stackviz static html+js |
| 37 | command: cp -pR /tmp/stackviz/share/stackviz-html {{ stage_dir }}/stackviz |
| 38 | when: |
| 39 | - stackviz_archive.stat.exists |
| 40 | - subunit_input.stat.exists |
| 41 | |
| 42 | - name: Check if dstat data exists |
| 43 | stat: |
| 44 | path: "{{ devstack_base_dir }}/logs/dstat-csv.log" |
| 45 | register: dstat_input |
| 46 | when: |
| 47 | - stackviz_archive.stat.exists |
| 48 | - subunit_input.stat.exists |
| 49 | |
| 50 | - name: Run stackviz with dstat |
| 51 | shell: | |
| 52 | cat {{ subunit_input.stat.path }} | \ |
| 53 | /tmp/stackviz/bin/stackviz-export \ |
| 54 | --dstat "{{ devstack_base_dir }}/logs/dstat-csv.log" \ |
| 55 | --env --stdin \ |
| 56 | {{ stage_dir }}/stackviz/data |
| 57 | when: |
| 58 | - stackviz_archive.stat.exists |
| 59 | - subunit_input.stat.exists |
| 60 | - dstat_input.stat.exists |
| 61 | |
| 62 | - name: Run stackviz without dstat |
| 63 | shell: | |
| 64 | cat {{ subunit_input.stat.path }} | \ |
| 65 | /tmp/stackviz/bin/stackviz-export \ |
| 66 | --env --stdin \ |
| 67 | {{ stage_dir }}/stackviz/data |
| 68 | when: |
| 69 | - stackviz_archive.stat.exists |
| 70 | - subunit_input.stat.exists |
| 71 | - not dstat_input.stat.exists |
| 72 | |
| 73 | ignore_errors: yes |