/
action.yaml
42 lines (40 loc) · 1.36 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: "Sosreport logs"
description: "Generate and retrieve sosreport logs"
inputs:
NODES_COUNT:
description: number of nodes
required: false
default: "0"
runs:
using: composite
steps:
## Here we cannot use the ssh-command action as we need to run this in a loop
## that is generated at the runtime.
- shell: bash
run: test -f ssh_config
- name: build hosts list
shell: bash
run: |
export HOSTS_LIST=""
echo "HOSTS_LIST=bootstrap$(seq -s '' --format ' node-%g' 1 ${{ inputs.NODES_COUNT }})" >> $GITHUB_ENV
- name: generate sosreport on each node
shell: bash
run: |
for host in ${HOSTS_LIST}; do
ssh -F ssh_config ${host} \
"sudo sosreport --all-logs \
-o metalk8s -kmetalk8s.k8s-resources -kmetalk8s.pod-logs -k metalk8s.describe -k metalk8s.metrics \
-o metalk8s_containerd -kmetalk8s_containerd.all -kmetalk8s_containerd.logs \
--batch --tmp-dir /var/tmp && \
sudo chown -R 1000:1000 /var/tmp/sosreport*"
done
- name: collect sosreport on each node
shell: bash
run: |
export DEST_DIR="artifacts/sosreport/${{ github.job }}"
mkdir -p ${DEST_DIR}
for host in ${HOSTS_LIST}; do
scp -F ssh_config \
"${host}:/var/tmp/sosreport-*" \
"${DEST_DIR}/"
done