Skip to content

Commit

Permalink
add healtcheck with timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Mar 6, 2024
1 parent 2b3af43 commit 87f849d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/ollama.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,20 @@ jobs:
run: |
curl -fsSL https://ollama.com/install.sh | sh
ollama serve &
sleep 10
# Check if the service is up and running with a timeout of 60 seconds
timeout=60
while [ $timeout -gt 0 ] && ! curl -sSf http://localhost:11434/ > /dev/null; do
echo "Waiting for Ollama service to start..."
sleep 5
((timeout-=5))
done
if [ $timeout -eq 0 ]; then
echo "Timed out waiting for Ollama service to start."
exit 1
fi
ollama pull ${{ env.LLM_FOR_TESTS }}
ollama pull ${{ env.EMBEDDER_FOR_TESTS }}
Expand Down

0 comments on commit 87f849d

Please sign in to comment.