Skip to content

Commit 4ecff3c

Browse files
improve: check /tmp/buildkit/bin/buildctl instead of global buildctl
Changed buildctl detection to specifically look for /tmp/buildkit/bin/buildctl to diagnose if the binary is downloaded but not yet copied to /usr/local/bin. Also added more detailed diagnostic output including: - /tmp/buildkit/ directory contents - /tmp/buildkit/bin/ directory contents - /tmp/buildkit.tar.gz status - Better debugging information
1 parent f405b14 commit 4ecff3c

1 file changed

Lines changed: 45 additions & 16 deletions

File tree

.github/workflows/test-cpu-32-runner.yaml

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -122,34 +122,63 @@ jobs:
122122
run: |
123123
echo ""
124124
echo "=== 🚀 Checking buildctl at job start ==="
125-
which buildctl && echo "✅ buildctl found" || echo "❌ buildctl NOT found"
125+
126+
# Check global buildctl
127+
which buildctl && echo "✅ buildctl found in PATH" || echo "❌ buildctl NOT found in PATH"
128+
129+
# Check /tmp/buildkit/bin/buildctl (the download location)
130+
if [ -f "/tmp/buildkit/bin/buildctl" ]; then
131+
echo "✅ /tmp/buildkit/bin/buildctl exists"
132+
/tmp/buildkit/bin/buildctl --version
133+
else
134+
echo "❌ /tmp/buildkit/bin/buildctl NOT found"
135+
fi
136+
126137
buildctl --version 2>/dev/null || echo "⏳ buildctl --version failed (may still be installing)"
127138
128139
# Wait for buildctl if not available
129-
if ! command -v buildctl &> /dev/null; then
130-
echo ""
131-
echo "buildctl not found at start, waiting up to 5 minutes..."
132-
for i in {1..300}; do
133-
if command -v buildctl &> /dev/null; then
134-
echo "✅ buildctl appeared after $i seconds"
135-
buildctl --version
136-
break
137-
fi
138-
[ $((i % 30)) -eq 0 ] && echo "Waiting... ($i/300 sec)"
139-
sleep 1
140-
done
141-
fi
140+
echo ""
141+
echo "Waiting for /tmp/buildkit/bin/buildctl to appear..."
142+
for i in {1..300}; do
143+
if [ -f "/tmp/buildkit/bin/buildctl" ]; then
144+
echo "✅ /tmp/buildkit/bin/buildctl appeared after $i seconds"
145+
/tmp/buildkit/bin/buildctl --version
146+
break
147+
fi
148+
if command -v buildctl &> /dev/null; then
149+
echo "✅ buildctl appeared in PATH after $i seconds"
150+
buildctl --version
151+
break
152+
fi
153+
[ $((i % 30)) -eq 0 ] && echo "Waiting... ($i/300 sec)"
154+
sleep 1
155+
done
142156
143157
# Final check
144-
if command -v buildctl &> /dev/null; then
145-
echo "✅ buildctl is available"
158+
echo ""
159+
echo "=== Final Status ==="
160+
if [ -f "/tmp/buildkit/bin/buildctl" ]; then
161+
echo "✅ /tmp/buildkit/bin/buildctl is available"
162+
/tmp/buildkit/bin/buildctl --version
163+
elif command -v buildctl &> /dev/null; then
164+
echo "✅ buildctl is available in PATH"
146165
buildctl --version
147166
else
148167
echo "⚠️ buildctl still not available after 5 minutes"
168+
echo ""
169+
echo "Diagnostics:"
170+
echo " - /tmp/buildkit/ contents:"
171+
ls -la /tmp/buildkit/ 2>/dev/null || echo " /tmp/buildkit/ does not exist"
172+
echo " - /tmp/buildkit/bin/ contents:"
173+
ls -la /tmp/buildkit/bin/ 2>/dev/null || echo " /tmp/buildkit/bin/ does not exist"
174+
echo " - /tmp/buildkit.tar.gz:"
175+
ls -la /tmp/buildkit.tar.gz 2>/dev/null || echo " /tmp/buildkit.tar.gz not found"
176+
echo ""
149177
echo "This may indicate:"
150178
echo " - postStart hook is taking too long"
151179
echo " - Network issue downloading buildkit binary"
152180
echo " - Vault certificate injection failed"
181+
echo " - Permission issue copying to /usr/local/bin"
153182
fi
154183
155184
- name: Test buildkitd connection

0 commit comments

Comments
 (0)