Capture logs and install docker in kata-runsh job
This captures the kata, docker, crio, and kubelet logs for the kata runsh job. We also pre install docker because .ci/setup.sh installs a version of docker that is too old to pass ci testing :( Change-Id: I23b9a17dd622b28c7fedc08047190e4a7a0ecd6c
This commit is contained in:
parent
c9a19d564f
commit
fecf36767f
85
playbooks/kata-runsh/post.yaml
Normal file
85
playbooks/kata-runsh/post.yaml
Normal file
@ -0,0 +1,85 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Ensure logs directory
|
||||
file:
|
||||
path: '{{ ansible_user_dir }}/logs'
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
# TODO use with items
|
||||
- name: Write runtime log
|
||||
shell: |
|
||||
set -x
|
||||
journalctl -b -o short-precise -t kata-runtime | gzip > {{ ansible_user_dir }}/logs/kata-runtime.log.gz
|
||||
become: yes
|
||||
- name: Make runtime log readable
|
||||
file:
|
||||
path: '{{ ansible_user_dir }}/logs/kata-runtime.log.gz'
|
||||
mode: 'u+r,g+r,o+r'
|
||||
become: yes
|
||||
|
||||
- name: Write agent and proxy log
|
||||
shell: |
|
||||
set -x
|
||||
journalctl -b -o short-precise -t kata-proxy | gzip > {{ ansible_user_dir }}/logs/kata-proxy.log.gz
|
||||
become: yes
|
||||
- name: Make proxy log readable
|
||||
file:
|
||||
path: '{{ ansible_user_dir }}/logs/kata-proxy.log.gz'
|
||||
mode: 'u+r,g+r,o+r'
|
||||
become: yes
|
||||
|
||||
- name: Write shim log
|
||||
shell: |
|
||||
set -x
|
||||
journalctl -b -o short-precise -t kata-shim | gzip > {{ ansible_user_dir }}/logs/kata-shim.log.gz
|
||||
become: yes
|
||||
- name: Make shim log readable
|
||||
file:
|
||||
path: '{{ ansible_user_dir }}/logs/kata-shim.log.gz'
|
||||
mode: 'u+r,g+r,o+r'
|
||||
become: yes
|
||||
|
||||
- name: Write docker log
|
||||
shell: |
|
||||
set -x
|
||||
journalctl -b -o short-precise -u docker.service | gzip > {{ ansible_user_dir }}/logs/docker.log.gz
|
||||
become: yes
|
||||
- name: Make docker log readable
|
||||
file:
|
||||
path: '{{ ansible_user_dir }}/logs/docker.log.gz'
|
||||
mode: 'u+r,g+r,o+r'
|
||||
become: yes
|
||||
|
||||
- name: Write crio log
|
||||
shell: |
|
||||
set -x
|
||||
journalctl -b -o short-precise -u crio | gzip > {{ ansible_user_dir }}/logs/crio.log.gz
|
||||
become: yes
|
||||
- name: Make crio log readable
|
||||
file:
|
||||
path: '{{ ansible_user_dir }}/logs/crio.log.gz'
|
||||
mode: 'u+r,g+r,o+r'
|
||||
become: yes
|
||||
|
||||
- name: Write kubelet log
|
||||
shell: |
|
||||
set -x
|
||||
journalctl -b -o short-precise -u kubelet | gzip > {{ ansible_user_dir }}/logs/kubelet.log.gz
|
||||
become: yes
|
||||
- name: Make kubelet log readable
|
||||
file:
|
||||
path: '{{ ansible_user_dir }}/logs/kubelet.log.gz'
|
||||
mode: 'u+r,g+r,o+r'
|
||||
become: yes
|
||||
|
||||
- name: Copy log files from test node to executor
|
||||
synchronize:
|
||||
src: '{{ ansible_user_dir }}/logs'
|
||||
dest: '{{ zuul.executor.log_root }}'
|
||||
mode: pull
|
||||
copy_links: true
|
||||
verify_host: true
|
||||
rsync_opts:
|
||||
- --prune-empty-dirs
|
||||
|
@ -18,6 +18,40 @@
|
||||
mode: 0755
|
||||
state: directory
|
||||
become: yes
|
||||
|
||||
# Install docker because .ci/setup.sh installs a version that is too old
|
||||
# to pass CI testing with.
|
||||
# TODO have .ci/setup.sh do the right thing
|
||||
- name: Install apt-transport-https
|
||||
package:
|
||||
name: apt-transport-https
|
||||
state: present
|
||||
become: yes
|
||||
- name: Install ca-certificates
|
||||
package:
|
||||
name: ca-certificates
|
||||
state: present
|
||||
become: yes
|
||||
- name: Install software-properties-common
|
||||
package:
|
||||
name: software-properties-common
|
||||
state: present
|
||||
become: yes
|
||||
- name: Add docker-ce repo
|
||||
args:
|
||||
executable: /bin/bash
|
||||
shell: |
|
||||
set -x
|
||||
curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -
|
||||
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||
apt-get update
|
||||
become: yes
|
||||
- name: Install docker-ce
|
||||
package:
|
||||
name: docker-ce
|
||||
state: present
|
||||
become: yes
|
||||
|
||||
- name: Run kata setup.sh
|
||||
args:
|
||||
executable: /bin/bash
|
||||
|
@ -1449,6 +1449,7 @@
|
||||
Run kata's setup.sh and run.sh CI scripts
|
||||
pre-run: playbooks/kata-runsh/pre.yaml
|
||||
run: playbooks/kata-runsh/run.yaml
|
||||
post-run: playbooks/kata-runsh/post.yaml
|
||||
timeout: 3600
|
||||
nodeset:
|
||||
nodes:
|
||||
|
Loading…
x
Reference in New Issue
Block a user