Add timeout for containers logs collection
When containers logs collection is stuck we lose all logs without possibility to see the failure reasons. Set timeout for logs collection of containers, by default 30 min. Change-Id: I9082e9361f650a6bd9d1ddfe73963a696b849f39
This commit is contained in:
@@ -151,6 +151,7 @@ artcl_artifact_url: "file://{{ local_working_dir }}"
|
||||
artcl_full_artifact_url: "{{ artcl_artifact_url }}/{{ lookup('env', 'BUILD_TAG') }}/"
|
||||
artcl_use_rsync: false
|
||||
artcl_rsync_use_daemon: false
|
||||
artcl_container_collect_timeout: 1800 # 30 mins
|
||||
|
||||
artcl_use_swift: false
|
||||
# clean up the logs after 31 days
|
||||
|
||||
@@ -30,8 +30,13 @@
|
||||
journalctl -u opendaylight > /var/log/extra/odl/odl_journal.log
|
||||
when: odl_rpm_enabled.rc == 0
|
||||
|
||||
- name: Collect container info and logs
|
||||
script: collect-container-logs.sh
|
||||
args:
|
||||
# full path varies across distros
|
||||
executable: bash
|
||||
- name: Copy collection logs script for containers
|
||||
copy:
|
||||
src: collect-container-logs.sh
|
||||
dest: /tmp/collect-container-logs.sh
|
||||
|
||||
- name: Run container logs collection with timeout
|
||||
command: >-
|
||||
timeout --preserve-status -s 15 -k {{ (artcl_container_collect_timeout|int + 30)|string }}
|
||||
{{ artcl_container_collect_timeout|string }} bash -x /tmp/collect-container-logs.sh
|
||||
changed_when: true
|
||||
|
||||
Reference in New Issue
Block a user