Merge "Allow ara-report to run on any node"

This commit is contained in:
Zuul 2020-08-11 18:18:00 +00:00 committed by Gerrit Code Review
commit 2975f163f5
3 changed files with 7 additions and 14 deletions

View File

@ -51,9 +51,7 @@ If ARA is enabled, generates a report or saves a copy of the ARA database.
.. _mimetypes: https://opendev.org/opendev/puppet-openstackci/src/commit/5fe1f3d2d5e40c2458721e7dcf8631d62ea2525f/templates/logs.vhost.erb#L24 .. _mimetypes: https://opendev.org/opendev/puppet-openstackci/src/commit/5fe1f3d2d5e40c2458721e7dcf8631d62ea2525f/templates/logs.vhost.erb#L24
.. zuul:rolevar:: ara_report_path .. zuul:rolevar:: ara_report_path
:default: ``ara`` :default: ``{{ zuul.executor.log_root }}/ara``
This path is relative to the root of the log directory.
When report_type is 'html' directory where the HTML report will be generated. When report_type is 'html' directory where the HTML report will be generated.
When report_type is 'database', directory where the database is saved. When report_type is 'database', directory where the database is saved.

View File

@ -19,8 +19,7 @@ ara_report_type: 'html'
# Note that when using 'database', an ARA web application can load the database # Note that when using 'database', an ARA web application can load the database
# dynamically. See the ARA documentation for details: # dynamically. See the ARA documentation for details:
# https://ara.readthedocs.io/en/latest/advanced.html#serving-ara-sqlite-databases-over-http # https://ara.readthedocs.io/en/latest/advanced.html#serving-ara-sqlite-databases-over-http
# This path is relative to the root of the log directory. ara_report_path: '{{ zuul.executor.log_root }}/ara'
ara_report_path: 'ara'
# When report_type is 'html', whether to compress the ARA HTML output or not # When report_type is 'html', whether to compress the ARA HTML output or not
ara_compress_html: true ara_compress_html: true

View File

@ -7,7 +7,7 @@
- name: Warn if ARA is not installed - name: Warn if ARA is not installed
debug: debug:
msg: | msg: |
ARA is not installed on the executor node, no report will be available. ARA is not installed, no report will be available.
when: ara_installed.rc != 0 when: ara_installed.rc != 0
- name: Check that the ARA database exists - name: Check that the ARA database exists
@ -36,10 +36,6 @@
It is likely that no report will be available, please verify the It is likely that no report will be available, please verify the
execution and the parameters of the role for details. execution and the parameters of the role for details.
- name: Prefix the log path with the log root
set_fact:
final_ara_report_path: "{{ zuul.executor.log_root }}/{{ ara_report_path }}"
- when: - when:
- ara_installed.rc == 0 - ara_installed.rc == 0
- ara_db.stat.exists - ara_db.stat.exists
@ -48,7 +44,7 @@
# Always generate (true), never (false) or only on failure ('failure') # Always generate (true), never (false) or only on failure ('failure')
# Additionally cover for edge cases where zuul_success might be undefined # Additionally cover for edge cases where zuul_success might be undefined
- name: Generate ARA HTML output - name: Generate ARA HTML output
command: "{{ ara_report_executable }} generate html {{ final_ara_report_path }}" command: "{{ ara_report_executable }} generate html {{ ara_report_path }}"
environment: environment:
ARA_DATABASE: "sqlite:///{{ ara_database_path }}" ARA_DATABASE: "sqlite:///{{ ara_database_path }}"
when: ara_report_run | bool or when: ara_report_run | bool or
@ -56,7 +52,7 @@
register: ara_generated register: ara_generated
- name: Compress ARA HTML output - name: Compress ARA HTML output
command: gzip --recursive --best {{ final_ara_report_path }} command: gzip --recursive --best {{ ara_report_path }}
when: when:
- ara_compress_html | bool - ara_compress_html | bool
- not ara_generated is skipped - not ara_generated is skipped
@ -83,11 +79,11 @@
block: block:
- name: Create the ARA database report directory - name: Create the ARA database report directory
file: file:
path: "{{ final_ara_report_path }}" path: "{{ ara_report_path }}"
state: directory state: directory
- name: Save the ARA database - name: Save the ARA database
command: cp {{ ara_database_path }} {{ final_ara_report_path }} command: cp {{ ara_database_path }} {{ ara_report_path }}
- name: Return ARA report - name: Return ARA report
zuul_return: zuul_return:
data: data: