Merge "Capture logs and install docker in kata-runsh job"

This commit is contained in:
Zuul 2018-06-19 06:17:23 +00:00 committed by Gerrit Code Review
commit 0fc2f72833
3 changed files with 120 additions and 0 deletions

View 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

View File

@ -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

View File

@ -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: