Andrea Frittoli (andreaf) | e4fdd2f | 2017-10-04 23:36:20 +0100 | [diff] [blame] | 1 | - name: Check if stackviz archive exists |
| 2 | stat: |
| 3 | path: "/opt/cache/files/stackviz-latest.tar.gz" |
| 4 | register: stackviz_archive |
| 5 | |
| 6 | - debug: |
| 7 | msg: "Stackviz archive could not be found in /opt/cache/files/stackviz-latest.tar.gz" |
| 8 | when: not stackviz_archive.stat.exists |
| 9 | |
| 10 | - name: Check if subunit data exists |
| 11 | stat: |
Michel Peterson | ac140fe | 2018-02-27 21:02:36 +0200 | [diff] [blame] | 12 | path: "{{ zuul_work_dir }}/testrepository.subunit" |
Andrea Frittoli (andreaf) | e4fdd2f | 2017-10-04 23:36:20 +0100 | [diff] [blame] | 13 | register: subunit_input |
| 14 | |
| 15 | - debug: |
Michel Peterson | ac140fe | 2018-02-27 21:02:36 +0200 | [diff] [blame] | 16 | msg: "Subunit file could not be found at {{ zuul_work_dir }}/testrepository.subunit" |
Andrea Frittoli (andreaf) | e4fdd2f | 2017-10-04 23:36:20 +0100 | [diff] [blame] | 17 | when: not subunit_input.stat.exists |
| 18 | |
| 19 | - name: Install stackviz |
Andrea Frittoli (andreaf) | e4fdd2f | 2017-10-04 23:36:20 +0100 | [diff] [blame] | 20 | when: |
| 21 | - stackviz_archive.stat.exists |
| 22 | - subunit_input.stat.exists |
Ian Wienand | 08a40ad | 2020-04-29 08:57:13 +1000 | [diff] [blame] | 23 | block: |
| 24 | - include_role: |
| 25 | name: ensure-pip |
| 26 | |
| 27 | - pip: |
| 28 | name: "file://{{ stackviz_archive.stat.path }}" |
| 29 | virtualenv: /tmp/stackviz |
| 30 | virtualenv_command: '{{ ensure_pip_virtualenv_command }}' |
| 31 | extra_args: -U |
Andrea Frittoli (andreaf) | e4fdd2f | 2017-10-04 23:36:20 +0100 | [diff] [blame] | 32 | |
| 33 | - name: Deploy stackviz static html+js |
| 34 | command: cp -pR /tmp/stackviz/share/stackviz-html {{ stage_dir }}/stackviz |
| 35 | when: |
| 36 | - stackviz_archive.stat.exists |
| 37 | - subunit_input.stat.exists |
| 38 | |
| 39 | - name: Check if dstat data exists |
| 40 | stat: |
| 41 | path: "{{ devstack_base_dir }}/logs/dstat-csv.log" |
| 42 | register: dstat_input |
| 43 | when: |
| 44 | - stackviz_archive.stat.exists |
| 45 | - subunit_input.stat.exists |
| 46 | |
| 47 | - name: Run stackviz with dstat |
| 48 | shell: | |
| 49 | cat {{ subunit_input.stat.path }} | \ |
| 50 | /tmp/stackviz/bin/stackviz-export \ |
| 51 | --dstat "{{ devstack_base_dir }}/logs/dstat-csv.log" \ |
| 52 | --env --stdin \ |
| 53 | {{ stage_dir }}/stackviz/data |
| 54 | when: |
| 55 | - stackviz_archive.stat.exists |
| 56 | - subunit_input.stat.exists |
| 57 | - dstat_input.stat.exists |
Jens Harbott | aacf6e8 | 2018-03-22 14:09:46 +0000 | [diff] [blame] | 58 | failed_when: False |
Andrea Frittoli (andreaf) | e4fdd2f | 2017-10-04 23:36:20 +0100 | [diff] [blame] | 59 | |
| 60 | - name: Run stackviz without dstat |
| 61 | shell: | |
| 62 | cat {{ subunit_input.stat.path }} | \ |
| 63 | /tmp/stackviz/bin/stackviz-export \ |
| 64 | --env --stdin \ |
| 65 | {{ stage_dir }}/stackviz/data |
| 66 | when: |
| 67 | - stackviz_archive.stat.exists |
| 68 | - subunit_input.stat.exists |
| 69 | - not dstat_input.stat.exists |
Jens Harbott | aacf6e8 | 2018-03-22 14:09:46 +0000 | [diff] [blame] | 70 | failed_when: False |