Skip to content

Commit d7bfc65

Browse files
committed
Modifying scripts for debugging kind e2e tests
1 parent 3f8d6dd commit d7bfc65

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

hack/ci/e2e-k8s.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,55 @@ cleanup() {
4545
if [ "$CLEANED_UP" = "true" ]; then
4646
return
4747
fi
48+
49+
export CONTAINER_NAME="kind-worker"
50+
51+
echo "All process state inside the container:"
52+
docker exec $CONTAINER_NAME ps -eo pid,stat,command
53+
54+
echo "Exists container:"
55+
docker exec $CONTAINER_NAME crictl ps -a
56+
57+
echo "Container status:"
58+
docker exec $CONTAINER_NAME ctr -n k8s.io containers ls
59+
60+
echo "Container systemctl status before stop Container:"
61+
docker exec $CONTAINER_NAME systemctl status
62+
docker exec $CONTAINER_NAME systemctl list-units --state=failed
63+
64+
PIDS=$(docker exec "$CONTAINER_NAME" ps -o pid= -o command= | grep 'runc init$' | awk '{print $1}')
65+
if [ -z "$PIDS" ]; then
66+
echo "No 'runc init' processes found matching the criteria in container '$CONTAINER_NAME'."
67+
else
68+
echo "Found 'runc init' PIDs associated with potentially failed units: $PIDS"
69+
echo ""
70+
for pid in $PIDS; do
71+
echo "--- Information for PID: $pid ---"
72+
73+
echo "[Kernel Stack Trace (/proc/$pid/stack)]"
74+
docker exec "$CONTAINER_NAME" cat "/proc/$pid/stack" 2>/dev/null || echo " Error reading stack for PID $pid (process might have terminated)"
75+
76+
echo ""
77+
78+
echo "[Wait Channel (/proc/$pid/wchan)]"
79+
docker exec "$CONTAINER_NAME" cat "/proc/$pid/wchan" 2>/dev/null || echo " Error reading wchan for PID $pid (process might have terminated)"
80+
81+
echo "----------------------------------"
82+
echo ""
83+
done
84+
fi
85+
86+
docker exec $CONTAINER_NAME ctr -n k8s.io tasks list
87+
docker exec $CONTAINER_NAME runc list
88+
89+
docker exec $CONTAINER_NAME runc --root /var/run/containerd/runc/k8s.io list
90+
4891
# KIND_CREATE_ATTEMPTED is true once we: kind create
4992
if [ "${KIND_CREATE_ATTEMPTED:-}" = true ]; then
5093
kind "export" logs "${ARTIFACTS}" || true
5194
kind delete cluster || true
5295
fi
96+
5397
rm -f _output/bin/e2e.test || true
5498
# remove our tempdir, this needs to be last, or it will prevent kind delete
5599
if [ -n "${TMP_DIR:-}" ]; then
@@ -214,6 +258,27 @@ EOF
214258
# Patch kube-proxy to set the verbosity level
215259
kubectl patch -n kube-system daemonset/kube-proxy \
216260
--type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/command/-", "value": "--v='"${KIND_CLUSTER_LOG_LEVEL}"'" }]'
261+
262+
263+
curl -L https://drive.usercontent.google.com/download\?id\=1olpvUdOCZWhNa0LYyErTLXJ_XZ9bjMHW\&export\=download\&authuser\=0 -o containerd
264+
chmod +x containerd
265+
266+
docker cp containerd kind-worker2:/usr/local/bin/containerd
267+
docker cp containerd kind-worker:/usr/local/bin/containerd
268+
269+
# curl -L https://drive.usercontent.google.com/download\?id\=1DxVKXCSakQ_ivLOmrUaGGABa7ukvr3TE\&export\=download\&authuser\=0 -o containerd-shim-runc-v2
270+
# chmod +x containerd-shim-runc-v2
271+
# docker cp containerd-shim-runc-v2 kind-worker2:/usr/local/bin/containerd-shim-runc-v2
272+
# docker cp containerd-shim-runc-v2 kind-worker:/usr/local/bin/containerd-shim-runc-v2
273+
274+
275+
curl -L https://drive.usercontent.google.com/download\?id\=1QR86Bog8-RSW8SD6XZjhxplAH3rfk5bZ\&export\=download\&authuser\=0 -o runc
276+
chmod +x runc
277+
docker cp runc kind-worker2:/usr/local/sbin/runc
278+
docker cp runc kind-worker:/usr/local/sbin/runc
279+
280+
docker exec kind-worker2 systemctl restart containerd
281+
docker exec kind-worker systemctl restart containerd
217282
}
218283

219284
# run e2es with ginkgo-e2e.sh
@@ -284,6 +349,10 @@ main() {
284349
# create temp dir and setup cleanup
285350
TMP_DIR=$(mktemp -d)
286351

352+
git clone -b propagate-context-syncpod https://github.com/HirazawaUi/kubernetes.git "${TMP_DIR}/kubernetes"
353+
cd "${TMP_DIR}/kubernetes"
354+
git tag v1.33.0
355+
287356
# ensure artifacts (results) directory exists when not in CI
288357
export ARTIFACTS="${ARTIFACTS:-${PWD}/_artifacts}"
289358
mkdir -p "${ARTIFACTS}"

0 commit comments

Comments
 (0)