Only upload logs when jobs fail
We're having some major disk issues. Help the situation by only uploading failure logs. Change-Id: I4156fb59570d98b16c775752639c2fe23e5777c5
This commit is contained in:
parent
6283695966
commit
c999f9325f
@ -2,47 +2,52 @@
|
||||
include_role:
|
||||
name: set-zuul-log-path-fact
|
||||
|
||||
- name: Create log directories
|
||||
file:
|
||||
path: "{{zuul_logserver_root}}/{{ zuul_log_path }}"
|
||||
state: directory
|
||||
recurse: yes
|
||||
mode: 0775
|
||||
# NOTE(mordred) Temporary hack to only upload logs on failures to work around
|
||||
# unfortunately timed disk outage.
|
||||
- when: not zuul_success|bool
|
||||
block:
|
||||
|
||||
- name: Ensure logs are readable before uploading
|
||||
delegate_to: localhost
|
||||
file:
|
||||
path: "{{ zuul.executor.log_root }}/"
|
||||
mode: u=rwX,g=rX,o=rX
|
||||
state: directory
|
||||
recurse: yes
|
||||
- name: Create log directories
|
||||
file:
|
||||
path: "{{zuul_logserver_root}}/{{ zuul_log_path }}"
|
||||
state: directory
|
||||
recurse: yes
|
||||
mode: 0775
|
||||
|
||||
- name: Upload logs to log server
|
||||
synchronize:
|
||||
src: "{{ zuul.executor.log_root }}/"
|
||||
dest: "{{zuul_logserver_root}}/{{ zuul_log_path }}/"
|
||||
rsync_opts:
|
||||
- "--exclude=job-output.txt"
|
||||
- "--exclude=job-output.json"
|
||||
no_log: true
|
||||
- name: Ensure logs are readable before uploading
|
||||
delegate_to: localhost
|
||||
file:
|
||||
path: "{{ zuul.executor.log_root }}/"
|
||||
mode: u=rwX,g=rX,o=rX
|
||||
state: directory
|
||||
recurse: yes
|
||||
|
||||
# After this point there are no more logs
|
||||
- name: gzip console log and json output
|
||||
delegate_to: localhost
|
||||
archive:
|
||||
path: "{{ zuul.executor.log_root }}/{{ item }}"
|
||||
with_items:
|
||||
- job-output.txt
|
||||
- job-output.json
|
||||
- name: Upload logs to log server
|
||||
synchronize:
|
||||
src: "{{ zuul.executor.log_root }}/"
|
||||
dest: "{{zuul_logserver_root}}/{{ zuul_log_path }}/"
|
||||
rsync_opts:
|
||||
- "--exclude=job-output.txt"
|
||||
- "--exclude=job-output.json"
|
||||
no_log: true
|
||||
|
||||
- name: Upload console log and json output
|
||||
synchronize:
|
||||
src: "{{ zuul.executor.log_root }}/{{ item }}.gz"
|
||||
dest: "{{zuul_logserver_root}}/{{ zuul_log_path }}/{{ item }}.gz"
|
||||
verify_host: true
|
||||
with_items:
|
||||
- job-output.txt
|
||||
- job-output.json
|
||||
# After this point there are no more logs
|
||||
- name: gzip console log and json output
|
||||
delegate_to: localhost
|
||||
archive:
|
||||
path: "{{ zuul.executor.log_root }}/{{ item }}"
|
||||
with_items:
|
||||
- job-output.txt
|
||||
- job-output.json
|
||||
|
||||
- name: Upload console log and json output
|
||||
synchronize:
|
||||
src: "{{ zuul.executor.log_root }}/{{ item }}.gz"
|
||||
dest: "{{zuul_logserver_root}}/{{ zuul_log_path }}/{{ item }}.gz"
|
||||
verify_host: true
|
||||
with_items:
|
||||
- job-output.txt
|
||||
- job-output.json
|
||||
|
||||
- name: Return log URL to Zuul
|
||||
delegate_to: localhost
|
||||
|
Loading…
Reference in New Issue
Block a user