base-jobs/playbooks/base-test/post-logs.yaml
Clark Boylan 7bd42d37c4 Fixup CI jobs
Several things have bit rotted in here that we need to take care of.

First is that we updated the default nodeset to Noble which breaks our
ability to install Pillow<10 for blockdiag. To fix this we need to
install libjpeg-dev so that we can build a Pillow wheel locally during
testing.

Next old ansible-lint doesn't run on Noble's python3.12. We bump up
Ansible lint to a modern version that matches Zuul's current default
Ansible. We also stop installing zuul to get zuul_console and
zuul_return and instead simply mock them in the linter. To make this
work we have to drop the ansible-playbook syntax check run which is fine
because ansible-lint runs this too, but when done via ansible-lint the
mocked modules are respected [0].

Finally we have to clean up/ignore some of the new linter
warnings/errors.

[0] https://ansible.readthedocs.io/projects/lint/rules/syntax-check/

Change-Id: Ia0e936fefc9e2b0f2fa614c93a2f168e14b2825b
2024-09-19 14:18:01 -07:00

46 lines
1.6 KiB
YAML

- name: Upload build logs to swift
hosts: localhost
tasks:
- name: Include Zuul manifest role
include_role:
name: generate-zuul-manifest
- name: Generate bulk log download script
include_role:
name: local-log-download
vars:
local_log_download_api: 'https://zuul.opendev.org/api/tenant/{{ zuul.tenant }}'
- name: Select random swift provider for logs upload
set_fact:
_swift_provider_name: "{{ opendev_base_item }}"
with_random_choice:
- 'ovh_bhs'
- 'ovh_gra'
- 'rax_dfw'
- 'rax_iad'
- 'rax_ord'
loop_control:
loop_var: 'opendev_base_item'
- name: Upload swift logs to {{ _swift_provider_name }}
no_log: true
include_role:
name: test-upload-logs-swift
vars:
zuul_log_path_shard_build: true
zuul_log_cloud_config: "{{ lookup('ansible.builtin.vars', 'opendev_cloud_' ~ _swift_provider_name) }}"
zuul_log_partition: true
zuul_log_delete_after: 2592000
# Unique log prefix to avoid container name collisions when ceph is
# used.
zuul_log_container: zuul_opendev_logs
# NOTE(ianw): file generated by local-log-download, upload_results
# is registered by the upload-logs-swift role
- name: Register quick-download link
zuul_return:
data:
zuul:
artifacts:
- name: Download all logs
url: 'download-logs.sh'
metadata:
command: 'curl "{{ upload_results.url }}/download-logs.sh" | bash'