Implement ARA logging and reporting for openstack-ansible gate jobs

ARA[1] is a tool that records ansible-playbook runs and makes the
data available over CLI or through a web application that can also
be statically generated.
It's purpose is to help visualize and understand playbook runs in
order to make them easier to troubleshoot.

[1]: https://ara.readthedocs.io/en/latest/faq.html#what-is-ara

Change-Id: Ie364212a915d51713e85b75c13ace42674840561
This commit is contained in:
David Moreau-Simard 2016-11-10 12:20:48 -05:00
parent 42ea34774c
commit 1053adfa77
2 changed files with 7 additions and 0 deletions

View File

@ -72,6 +72,11 @@ fi
# Bootstrap Ansible # Bootstrap Ansible
source "$(dirname "${0}")/bootstrap-ansible.sh" source "$(dirname "${0}")/bootstrap-ansible.sh"
# Install ARA and add it to the callback path provided by bootstrap-ansible.sh/openstack-ansible.rc
# This is added *here* instead of bootstrap-ansible so it's used for CI purposes only.
/opt/ansible-runtime/bin/pip install ara
export ANSIBLE_CALLBACK_PLUGINS="/etc/ansible/roles/plugins/callback:/opt/ansible-runtime/lib/python2.7/site-packages/ara/plugins/callbacks"
# Log some data about the instance and the rest of the system # Log some data about the instance and the rest of the system
log_instance_info log_instance_info

View File

@ -143,6 +143,8 @@ function gate_job_exit_tasks {
# Rename all files gathered to have a .txt suffix so that the compressed # Rename all files gathered to have a .txt suffix so that the compressed
# files are viewable via a web browser in OpenStack-CI. # files are viewable via a web browser in OpenStack-CI.
find "${GATE_LOG_DIR}/" -type f -exec mv {} {}.txt \; find "${GATE_LOG_DIR}/" -type f -exec mv {} {}.txt \;
# Generate the ARA report
/opt/ansible-runtime/bin/ara generate html "${GATE_LOG_DIR}/ara" || true
# Compress the files gathered so that they do not take up too much space. # Compress the files gathered so that they do not take up too much space.
# We use 'command' to ensure that we're not executing with some sort of alias. # We use 'command' to ensure that we're not executing with some sort of alias.
command gzip --best --recursive "${GATE_LOG_DIR}/" command gzip --best --recursive "${GATE_LOG_DIR}/"