Add retry logic and port-conflict fix for Ollama CI setup

- Kill any auto-started Ollama before launching serve (fixes port
  conflict: 'address already in use')
- Retry ollama pull up to 3 times with 15s backoff (fixes 429 rate
  limit failures)
- Applied to both python-merge-tests.yml and python-integration-tests.yml

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Giles Odigwe
2026-04-28 16:51:07 -07:00
Unverified
parent 386e08ed64
commit e2eba0bacc
2 changed files with 26 additions and 4 deletions
+13 -2
View File
@@ -183,6 +183,9 @@ jobs:
key: ollama-models-qwen2.5-1.5b-nomic-embed-text-v1
- name: Start Ollama and pull models
run: |
# Stop any Ollama instance auto-started by the install script
pkill ollama || true
sleep 2
ollama serve &
for i in $(seq 1 30); do
if curl -sf http://localhost:11434/api/tags > /dev/null 2>&1; then
@@ -190,8 +193,16 @@ jobs:
fi
sleep 1
done
ollama pull qwen2.5:1.5b
ollama pull nomic-embed-text
# Pull models with retry for transient 429 rate limits
for model in qwen2.5:1.5b nomic-embed-text; do
for attempt in 1 2 3; do
if ollama pull "$model"; then
break
fi
echo "Retry $attempt for $model (waiting 15s)..."
sleep 15
done
done
working-directory: .
- name: Start local MCP server
id: local-mcp