summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-06-19 06:17:23 +0000
committerGerrit Code Review <review@openstack.org>2018-06-19 06:17:23 +0000
commit0fc2f72833d0beb62fb7912a7fceaca0d0dee743 (patch)
tree1666db5603a77daa5943e424eeb1f011a642d81f
parentd9d3414cb8ca8219706b63df006285712fe879b8 (diff)
parentfecf36767ffbef9a1e3eed12f1c631635b368975 (diff)
Merge "Capture logs and install docker in kata-runsh job"
-rw-r--r--playbooks/kata-runsh/post.yaml85
-rw-r--r--playbooks/kata-runsh/pre.yaml34
-rw-r--r--zuul.d/jobs.yaml1
3 files changed, 120 insertions, 0 deletions
diff --git a/playbooks/kata-runsh/post.yaml b/playbooks/kata-runsh/post.yaml
new file mode 100644
index 0000000..4553e9a
--- /dev/null
+++ b/playbooks/kata-runsh/post.yaml
@@ -0,0 +1,85 @@
1- hosts: all
2 tasks:
3 - name: Ensure logs directory
4 file:
5 path: '{{ ansible_user_dir }}/logs'
6 state: directory
7 mode: 0755
8
9 # TODO use with items
10 - name: Write runtime log
11 shell: |
12 set -x
13 journalctl -b -o short-precise -t kata-runtime | gzip > {{ ansible_user_dir }}/logs/kata-runtime.log.gz
14 become: yes
15 - name: Make runtime log readable
16 file:
17 path: '{{ ansible_user_dir }}/logs/kata-runtime.log.gz'
18 mode: 'u+r,g+r,o+r'
19 become: yes
20
21 - name: Write agent and proxy log
22 shell: |
23 set -x
24 journalctl -b -o short-precise -t kata-proxy | gzip > {{ ansible_user_dir }}/logs/kata-proxy.log.gz
25 become: yes
26 - name: Make proxy log readable
27 file:
28 path: '{{ ansible_user_dir }}/logs/kata-proxy.log.gz'
29 mode: 'u+r,g+r,o+r'
30 become: yes
31
32 - name: Write shim log
33 shell: |
34 set -x
35 journalctl -b -o short-precise -t kata-shim | gzip > {{ ansible_user_dir }}/logs/kata-shim.log.gz
36 become: yes
37 - name: Make shim log readable
38 file:
39 path: '{{ ansible_user_dir }}/logs/kata-shim.log.gz'
40 mode: 'u+r,g+r,o+r'
41 become: yes
42
43 - name: Write docker log
44 shell: |
45 set -x
46 journalctl -b -o short-precise -u docker.service | gzip > {{ ansible_user_dir }}/logs/docker.log.gz
47 become: yes
48 - name: Make docker log readable
49 file:
50 path: '{{ ansible_user_dir }}/logs/docker.log.gz'
51 mode: 'u+r,g+r,o+r'
52 become: yes
53
54 - name: Write crio log
55 shell: |
56 set -x
57 journalctl -b -o short-precise -u crio | gzip > {{ ansible_user_dir }}/logs/crio.log.gz
58 become: yes
59 - name: Make crio log readable
60 file:
61 path: '{{ ansible_user_dir }}/logs/crio.log.gz'
62 mode: 'u+r,g+r,o+r'
63 become: yes
64
65 - name: Write kubelet log
66 shell: |
67 set -x
68 journalctl -b -o short-precise -u kubelet | gzip > {{ ansible_user_dir }}/logs/kubelet.log.gz
69 become: yes
70 - name: Make kubelet log readable
71 file:
72 path: '{{ ansible_user_dir }}/logs/kubelet.log.gz'
73 mode: 'u+r,g+r,o+r'
74 become: yes
75
76 - name: Copy log files from test node to executor
77 synchronize:
78 src: '{{ ansible_user_dir }}/logs'
79 dest: '{{ zuul.executor.log_root }}'
80 mode: pull
81 copy_links: true
82 verify_host: true
83 rsync_opts:
84 - --prune-empty-dirs
85
diff --git a/playbooks/kata-runsh/pre.yaml b/playbooks/kata-runsh/pre.yaml
index 5c64427..4cc51e5 100644
--- a/playbooks/kata-runsh/pre.yaml
+++ b/playbooks/kata-runsh/pre.yaml
@@ -18,6 +18,40 @@
18 mode: 0755 18 mode: 0755
19 state: directory 19 state: directory
20 become: yes 20 become: yes
21
22 # Install docker because .ci/setup.sh installs a version that is too old
23 # to pass CI testing with.
24 # TODO have .ci/setup.sh do the right thing
25 - name: Install apt-transport-https
26 package:
27 name: apt-transport-https
28 state: present
29 become: yes
30 - name: Install ca-certificates
31 package:
32 name: ca-certificates
33 state: present
34 become: yes
35 - name: Install software-properties-common
36 package:
37 name: software-properties-common
38 state: present
39 become: yes
40 - name: Add docker-ce repo
41 args:
42 executable: /bin/bash
43 shell: |
44 set -x
45 curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -
46 add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
47 apt-get update
48 become: yes
49 - name: Install docker-ce
50 package:
51 name: docker-ce
52 state: present
53 become: yes
54
21 - name: Run kata setup.sh 55 - name: Run kata setup.sh
22 args: 56 args:
23 executable: /bin/bash 57 executable: /bin/bash
diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml
index c00b9f3..ae75405 100644
--- a/zuul.d/jobs.yaml
+++ b/zuul.d/jobs.yaml
@@ -1449,6 +1449,7 @@
1449 Run kata's setup.sh and run.sh CI scripts 1449 Run kata's setup.sh and run.sh CI scripts
1450 pre-run: playbooks/kata-runsh/pre.yaml 1450 pre-run: playbooks/kata-runsh/pre.yaml
1451 run: playbooks/kata-runsh/run.yaml 1451 run: playbooks/kata-runsh/run.yaml
1452 post-run: playbooks/kata-runsh/post.yaml
1452 timeout: 3600 1453 timeout: 3600
1453 nodeset: 1454 nodeset:
1454 nodes: 1455 nodes: