Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-36371: Run ppc node collection in parallel #430

Open
wants to merge 1 commit into
base: release-4.15
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions collection-scripts/gather_ppc
Original file line number Diff line number Diff line change
Expand Up @@ -136,31 +136,21 @@ EOF
done

COLLECTABLE_NODES=()
NODE_PIDS=()
for line in $(oc get pod -o=custom-columns=NODE:.spec.nodeName,NAME:.metadata.name --no-headers -l name=perf-node-gather-daemonset --field-selector=status.phase=Running -n $NAMESPACE)
do
node=$(echo $line | awk -F ' ' '{print $1}')
pod=$(echo $line | awk -F ' ' '{print $2}')
NODE_PATH=${NODES_PATH}/$node
mkdir -p "${NODE_PATH}"

echo "Collecting performance related data for node $line"

oc exec $pod -n $NAMESPACE -- lspci -nvv > $NODE_PATH/lspci
oc exec $pod -n $NAMESPACE -- lscpu -e > $NODE_PATH/lscpu
oc exec $pod -n $NAMESPACE -- cat /proc/cmdline > $NODE_PATH/proc_cmdline
oc exec $pod -n $NAMESPACE -- dmesg > $NODE_PATH/dmesg
oc exec $pod -n $NAMESPACE -- ethtool -k eth0 > $NODE_PATH/ethtool_features
oc exec $pod -n $NAMESPACE -- ethtool -l eth0 > $NODE_PATH/ethtool_channels

COLLECTABLE_NODES+=($node)

oc exec $pod -n $NAMESPACE -- gather-sysinfo --json cpuaff --procfs=/host/proc --sysfs=/host/sys > $NODE_PATH/cpu_affinities.json
oc exec $pod -n $NAMESPACE -- gather-sysinfo --json irqaff --procfs=/host/proc --sysfs=/host/sys > $NODE_PATH/irq_affinities.json
oc exec $pod -n $NAMESPACE -- gather-sysinfo --json podres --socket-path=unix:///host/podresources/kubelet.sock > $NODE_PATH/podresources.json

oc exec $pod -n $NAMESPACE -- gather-sysinfo snapshot --debug --root=/host --output=- > $NODE_PATH/sysinfo.tgz 2> $NODE_PATH/sysinfo.log
oc exec $pod -n $NAMESPACE -- gather-sysinfo podinfo --node-name $node > $NODE_PATH/pods_info.json
# Run per node data collection in parallel
timeout -k 1m 5m /usr/bin/gather_ppc_single_node "${pod}" "${NAMESPACE}" "${node}" "${NODE_PATH}" &
NODE_PIDS+=($!)
done
wait "${NODE_PIDS[@]}"

# Collect journal logs for specified units for all nodes
NODE_UNITS=(kubelet)
Expand All @@ -169,6 +159,7 @@ EOF
NODE_PATH=${NODES_PATH}/$NODE
mkdir -p ${NODE_PATH}
for UNIT in ${NODE_UNITS[@]}; do
echo "Collecting ${UNIT} logs for node ${NODE}"
timeout -k 5m 30m bash -c "oc adm node-logs $NODE -u $UNIT --since '-8h' | gzip" > ${NODE_PATH}/${NODE}_logs_$UNIT.gz &
ADM_PIDS+=($!)
done
Expand Down
25 changes: 25 additions & 0 deletions collection-scripts/gather_ppc_single_node
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# This script is not supposed to be executed manually. It is used from
# the gather_ppc collection script.

pod=$1
NAMESPACE=$2
node=$3
NODE_PATH=$4

echo "Collecting performance related data for node $node"

oc exec $pod -n $NAMESPACE -- lspci -nvv > $NODE_PATH/lspci
oc exec $pod -n $NAMESPACE -- lscpu -e > $NODE_PATH/lscpu
oc exec $pod -n $NAMESPACE -- cat /proc/cmdline > $NODE_PATH/proc_cmdline
oc exec $pod -n $NAMESPACE -- dmesg > $NODE_PATH/dmesg
oc exec $pod -n $NAMESPACE -- ethtool -k eth0 > $NODE_PATH/ethtool_features
oc exec $pod -n $NAMESPACE -- ethtool -l eth0 > $NODE_PATH/ethtool_channels

oc exec $pod -n $NAMESPACE -- gather-sysinfo --json cpuaff --procfs=/host/proc --sysfs=/host/sys > $NODE_PATH/cpu_affinities.json
oc exec $pod -n $NAMESPACE -- gather-sysinfo --json irqaff --procfs=/host/proc --sysfs=/host/sys > $NODE_PATH/irq_affinities.json
oc exec $pod -n $NAMESPACE -- gather-sysinfo --json podres --socket-path=unix:///host/podresources/kubelet.sock > $NODE_PATH/podresources.json

oc exec $pod -n $NAMESPACE -- gather-sysinfo snapshot --debug --root=/host --output=- > $NODE_PATH/sysinfo.tgz 2> $NODE_PATH/sysinfo.log
oc exec $pod -n $NAMESPACE -- gather-sysinfo podinfo --node-name $node > $NODE_PATH/pods_info.json