Step: baremetalds-sno-gather

Log gather from remote packet server.

Container image used for this step: assisted-test-infra

assisted-test-infra resolves to an image built or imported by the ci-operator configuration (documentation).

Environment

Step exposes no environmental variables except the defaults.

Source Code

 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
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

echo "************ baremetalds single-node gather command ************"

if [[ ! -e "${SHARED_DIR}/server-ip" ]]; then
  echo "No server IP found; skipping log gathering."
  exit 0
fi

# Fetch packet basic configuration
# shellcheck source=/dev/null
source "${SHARED_DIR}/packet-conf.sh"

function getlogs() {
  echo "### Downloading logs..."
  scp -r "${SSHOPTS[@]}" "root@${IP}:/tmp/artifacts/*" "${ARTIFACT_DIR}"
}

# Gather logs regardless of what happens after this
trap getlogs EXIT

echo "### Gathering logs..."
timeout -s 9 20m ssh "${SSHOPTS[@]}" "root@${IP}" bash - << "EOF" |& sed -e 's/.*auths.*/*** PULL_SECRET ***/g'

set -xeo pipefail

# Get sosreport including sar data
sos report --batch --tmp-dir /tmp/artifacts \
  -o container_log,filesys,kvm,libvirt,logs,networkmanager,networking,podman,processor,rpm,sar,virsh,yum \
  -k podman.all -k podman.logs

# TODO: remove when https://github.com/sosreport/sos/pull/2594 is available
cp -r /var/lib/libvirt/dnsmasq /tmp/artifacts/libvirt-dnsmasq

echo "Copy content from setup step to artifacts dir..."
cp -r /home/sno/build/ /tmp/artifacts/

export KUBECONFIG=/home/sno/build/ibip/auth/kubeconfig

echo "Waiting for cluster API to be responsive..."
timeout 5m bash -c 'until oc version; do sleep 10; done' || true

must_gather_dir=/tmp/artifacts/post-tests-must-gather
mkdir -p "${must_gather_dir}"

echo "Gathering must-gather data..."
oc adm must-gather \
  --insecure-skip-tls-verify \
  --dest-dir "${must_gather_dir}" > "${must_gather_dir}/must-gather.log"

EOF

Properties

Property Value Description
Termination grace period[?] 10m0s Period of time until SIGKILL signal is sent to the test pod (after SIGTERM signal is sent).
Resource requests (cpu) 1000m Used in .resources.requests of the pod running this step.
Resource requests (memory) 500Mi Used in .resources.requests of the pod running this step.

GitHub Link:

https://github.com/openshift/release/blob/master/ci-operator/step-registry/baremetalds/sno/gather/baremetalds-sno-gather-ref.yaml

Owners:

Approvers:

Source code for this page located on GitHub