Docker log collection

Collect logs for zuul jobs that use docker

Change-Id: I8da05be5e84c0d565655721c4545ca7446794858
This commit is contained in:
Wahlstedt, Walter (ww229g) 2023-02-21 12:13:04 -05:00
parent c925341518
commit d132d708e9
2 changed files with 8 additions and 1 deletions

View File

@ -29,6 +29,13 @@
brctl show > {{ logs_dir }}/system/brctl-show.txt
ps aux --sort=-%mem > {{ logs_dir }}/system/ps.txt
dpkg -l > {{ logs_dir }}/system/packages.txt
CONTAINERS=($(docker ps -a --format {% raw %}'{{ .Names }}'{% endraw %} --filter label=zuul))
if [ ! -z "$CONTAINERS" ]; then
mkdir -p "{{ logs_dir }}/system/containers"
for CONTAINER in ${CONTAINERS}; do
docker logs "${CONTAINER}" > "{{ logs_dir }}/system/containers/${CONTAINER}.txt"
done
fi
args:
executable: /bin/bash
ignore_errors: True

View File

@ -21,7 +21,7 @@
path: "{{ logs_dir }}/pod-logs/failed-pods"
state: directory
- name: "retrieve all container logs, current and previous (if they exist)"
- name: "retrieve all kubernetes logs, current and previous (if they exist)"
shell: |-
set -e
PARALLELISM_FACTOR=2