Skip to content

Commit 71abf8b

Browse files
authored
Merge branch 'main' into ladithyav-go-upgrade
2 parents edcb656 + 7ca075d commit 71abf8b

2 files changed

Lines changed: 33 additions & 7 deletions

File tree

demos/local-fault-injection-demo/scripts/00-setup.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,20 @@ EOF
374374
# Wait for fake DCGM to be ready before continuing
375375
# The readiness probe checks if port 5555 is actually listening
376376
log "Waiting for fake DCGM to be ready..."
377-
kubectl wait --for=condition=ready pod \
377+
if kubectl wait --for=condition=ready pod \
378378
-l app=nvidia-dcgm \
379379
-n gpu-operator \
380-
--timeout=120s > /dev/null 2>&1
381-
382-
success "Fake DCGM deployed and ready (port 5555 is listening)"
380+
--timeout=120s > /dev/null 2>&1; then
381+
success "Fake DCGM deployed and ready (port 5555 is listening)"
382+
else
383+
echo ""
384+
echo "The image may still be pulling on slower connections. Check with:"
385+
echo " kubectl get pods -n gpu-operator"
386+
echo ""
387+
echo "Once it shows Running, continue with ./scripts/01-show-cluster.sh"
388+
echo ""
389+
error "Fake DCGM did not become ready within 120s"
390+
fi
383391
}
384392

385393
label_demo_nodes() {

demos/local-fault-injection-demo/scripts/03-verify-cordon.sh

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ verify_cordon() {
7878
echo ""
7979

8080
# Poll for cordon status with retries
81-
local max_attempts=7 # 7 attempts x 3 seconds = 21 seconds
81+
local max_attempts=7 # 7 attempts, 3s apart = ~18 seconds
8282
local attempt=1
8383
local is_unschedulable="false"
8484

@@ -106,13 +106,17 @@ verify_cordon() {
106106
((attempt++))
107107
done
108108

109-
if [ "$is_unschedulable" = "true" ]; then
109+
# Capture the target node's result before $is_unschedulable is reused
110+
# by the all-nodes summary loop further down.
111+
local cordon_verified="$is_unschedulable"
112+
113+
if [ "$cordon_verified" = "true" ]; then
110114
echo " 🔒 No new pods will be scheduled on this node"
111115
echo " ✅ Existing workloads continue running (safe mode)"
112116
echo " 🎯 NVSentinel successfully quarantined the faulty node!"
113117
echo ""
114118
else
115-
warn "Node $TARGET_NODE is NOT cordoned yet"
119+
warn "Node $TARGET_NODE was not cordoned after $max_attempts attempts"
116120
echo ""
117121
echo "This could mean:"
118122
echo " - The event is still being processed (wait a few seconds)"
@@ -177,6 +181,20 @@ verify_cordon() {
177181
fi
178182
done
179183

184+
if [ "$cordon_verified" != "true" ]; then
185+
section "Demo Incomplete"
186+
187+
echo "The node was not cordoned, so the demo did not complete successfully."
188+
echo ""
189+
echo "Most common cause is insufficient resources - fault-quarantine needs"
190+
echo "MongoDB to hold primary in order to watch the change stream. Check with:"
191+
echo " kubectl get pods -n $NAMESPACE"
192+
echo ""
193+
echo "When you're done, clean up: ./scripts/99-cleanup.sh"
194+
echo ""
195+
return 1
196+
fi
197+
180198
section "Demo Complete! 🎉"
181199

182200
echo "You've successfully completed the NVSentinel local demo!"

0 commit comments

Comments
 (0)