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

chore(ci): rollback earthly prune #6208

Merged
merged 2 commits into from
May 3, 2024
Merged
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
12 changes: 5 additions & 7 deletions scripts/earthly-ci
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ while [ $ATTEMPT_COUNT -lt $MAX_ATTEMPTS ]; do
echo "Attempt #$ATTEMPT_COUNT failed."

# Check the output for specific errors
if grep 'failed to get edge: inconsistent graph state' $OUTPUT_FILE >/dev/null; then
if grep 'failed to get edge: inconsistent graph state' $OUTPUT_FILE >/dev/null || grep 'failed to get state for index' $OUTPUT_FILE >/dev/null ; then
INCONSISTENT_GRAPH_STATE_COUNT=$((INCONSISTENT_GRAPH_STATE_COUNT + 1))
echo "Got 'inconsistent graph state'."
if [ "$INCONSISTENT_GRAPH_STATE_COUNT" -eq 2 ]; then
echo "Performing 'earthly prune' due to repeated 'inconsistent graph state' errors."
earthly prune
if earthly $@ 2>&1 | tee $OUTPUT_FILE >&2 ; then
exit 0 # Post-prune success
fi
echo "Unable to recover from 'inconsistent graph state' or 'failed to get state for index'. Connect to spot runner and run 'earthly prune'."
exit 1
fi
echo "Got 'inconsistent graph state' or 'failed to get state for index'. Sleeping for 20 seconds and retrying."
sleep 20
elif grep 'Error: pull ping error: pull ping response' $OUTPUT_FILE >/dev/null; then
echo "Got 'Error: pull ping error: pull ping response', intermittent failure when writing out images to docker"
elif grep '================================= System Info ==================================' $OUTPUT_FILE >/dev/null; then
Expand Down
Loading