Commit 70184799 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #48204 from shyamjvs/logdump-only-n-nodes

Automatic merge from submit-queue Allow log-dumping only N randomly-chosen nodes in the cluster This should let us save "lots" (~3-4 hours) of time in our 5000-node cluster scale tests as we copy logs from all the nodes to jenkins worker and then upload all of them to gcs (while we don't need too many). This will also prevent the jenkins container facing "No space left on device" error while dumping logs, that we saw in runs 12-13 of gce-enormous-cluster. The longterm fix will be to enable [logexporter](https://github.com/kubernetes/test-infra/tree/master/logexporter) for our tests. cc @kubernetes/sig-scalability-misc @kubernetes/test-infra-maintainers @gmarek @fejta
parents c9ad8dcd b960a0da
...@@ -224,8 +224,19 @@ function dump_nodes() { ...@@ -224,8 +224,19 @@ function dump_nodes() {
return return
fi fi
nodes_selected_for_logs=()
if [[ -n "${LOGDUMP_ONLY_N_RANDOM_NODES:-}" ]]; then
# We randomly choose 'LOGDUMP_ONLY_N_RANDOM_NODES' many nodes for fetching logs.
for index in `shuf -i 0-$(( ${#node_names[*]} - 1 )) -n ${LOGDUMP_ONLY_N_RANDOM_NODES}`
do
nodes_selected_for_logs+=("${node_names[$index]}")
done
else
nodes_selected_for_logs=( "${node_names[@]}" )
fi
proc=${max_scp_processes} proc=${max_scp_processes}
for node_name in "${node_names[@]}"; do for node_name in "${nodes_selected_for_logs[@]}"; do
node_dir="${report_dir}/${node_name}" node_dir="${report_dir}/${node_name}"
mkdir -p "${node_dir}" mkdir -p "${node_dir}"
# Save logs in the background. This speeds up things when there are # Save logs in the background. This speeds up things when there are
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment