mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
fix(docker): ollama-init best-effort pull, gate startup on cached models present
A degraded/slow ollama registry made the model manifest re-check fail under set -e, so ollama-init exited 1 and blocked the orchestrator's service_completed_successfully gate — taking the whole stack down even though both models were already cached. Pulls are now best-effort; success is gated on the models being present, so a flaky registry can't down a cached deployment.
This commit is contained in:
@@ -84,20 +84,26 @@ services:
|
|||||||
entrypoint: ["/bin/sh", "-c"]
|
entrypoint: ["/bin/sh", "-c"]
|
||||||
command:
|
command:
|
||||||
- |
|
- |
|
||||||
set -e
|
# NO `set -e`: pulls are best-effort. Cached models persist in the ollama
|
||||||
echo "=== Pulling embedding model (qwen3-embedding:0.6b) ==="
|
# volume and MUST survive a slow/unreachable ollama registry — a manifest
|
||||||
|
# re-check failure there must never down a fully-cached deployment (it
|
||||||
|
# used to: a degraded registry made `ollama pull` fail under set -e, which
|
||||||
|
# blocked the orchestrator's service_completed_successfully gate). Success
|
||||||
|
# is gated on the models being PRESENT (verify step), not on the pull.
|
||||||
|
# Note: $$ escapes $ for docker-compose variable substitution.
|
||||||
|
echo "=== Pulling embedding model (qwen3-embedding:0.6b) — best-effort ==="
|
||||||
curl -sN http://ollama:11434/api/pull -d '{"name":"qwen3-embedding:0.6b"}' | while read -r line; do
|
curl -sN http://ollama:11434/api/pull -d '{"name":"qwen3-embedding:0.6b"}' | while read -r line; do
|
||||||
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
||||||
[ -n "$$status" ] && echo " $$status"
|
[ -n "$$status" ] && echo " $$status"
|
||||||
done
|
done || echo " (pull failed — relying on the cached model)"
|
||||||
echo "=== Pulling LLM model (glm-5:cloud) ==="
|
echo "=== Pulling LLM model (glm-5:cloud) — best-effort ==="
|
||||||
curl -sN http://ollama:11434/api/pull -d '{"name":"glm-5:cloud"}' | while read -r line; do
|
curl -sN http://ollama:11434/api/pull -d '{"name":"glm-5:cloud"}' | while read -r line; do
|
||||||
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
||||||
[ -n "$$status" ] && echo " $$status"
|
[ -n "$$status" ] && echo " $$status"
|
||||||
done
|
done || echo " (pull failed — relying on the cached model)"
|
||||||
echo "=== Verifying models are available ==="
|
echo "=== Verifying models are present (the real success gate) ==="
|
||||||
curl -sf http://ollama:11434/api/tags | grep -q "qwen3-embedding" && echo " qwen3-embedding: OK"
|
curl -sf http://ollama:11434/api/tags | grep -q "qwen3-embedding" || { echo "FATAL: qwen3-embedding missing and could not be pulled"; exit 1; }
|
||||||
curl -sf http://ollama:11434/api/tags | grep -q "glm-5" && echo " glm-5: OK"
|
curl -sf http://ollama:11434/api/tags | grep -q "glm-5" || { echo "FATAL: glm-5 missing and could not be pulled"; exit 1; }
|
||||||
echo "=== All models ready! ==="
|
echo "=== All models ready! ==="
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
|||||||
+14
-10
@@ -71,22 +71,26 @@ services:
|
|||||||
entrypoint: ["/bin/sh", "-c"]
|
entrypoint: ["/bin/sh", "-c"]
|
||||||
command:
|
command:
|
||||||
- |
|
- |
|
||||||
set -e
|
# NO `set -e`: pulls are best-effort. Cached models persist in the ollama
|
||||||
echo "=== Pulling embedding model (qwen3-embedding:0.6b) ==="
|
# volume and MUST survive a slow/unreachable ollama registry — a manifest
|
||||||
# Ollama /api/pull streams JSON lines until complete - consume full stream
|
# re-check failure there must never down a fully-cached deployment (it
|
||||||
# Note: $$ escapes $ for docker-compose variable substitution
|
# used to: a degraded registry made `ollama pull` fail under set -e, which
|
||||||
|
# blocked the orchestrator's service_completed_successfully gate). Success
|
||||||
|
# is gated on the models being PRESENT (verify step), not on the pull.
|
||||||
|
# Note: $$ escapes $ for docker-compose variable substitution.
|
||||||
|
echo "=== Pulling embedding model (qwen3-embedding:0.6b) — best-effort ==="
|
||||||
curl -sN http://ollama:11434/api/pull -d '{"name":"qwen3-embedding:0.6b"}' | while read -r line; do
|
curl -sN http://ollama:11434/api/pull -d '{"name":"qwen3-embedding:0.6b"}' | while read -r line; do
|
||||||
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
||||||
[ -n "$$status" ] && echo " $$status"
|
[ -n "$$status" ] && echo " $$status"
|
||||||
done
|
done || echo " (pull failed — relying on the cached model)"
|
||||||
echo "=== Pulling LLM model (glm-5:cloud) ==="
|
echo "=== Pulling LLM model (glm-5:cloud) — best-effort ==="
|
||||||
curl -sN http://ollama:11434/api/pull -d '{"name":"glm-5:cloud"}' | while read -r line; do
|
curl -sN http://ollama:11434/api/pull -d '{"name":"glm-5:cloud"}' | while read -r line; do
|
||||||
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
||||||
[ -n "$$status" ] && echo " $$status"
|
[ -n "$$status" ] && echo " $$status"
|
||||||
done
|
done || echo " (pull failed — relying on the cached model)"
|
||||||
echo "=== Verifying models are available ==="
|
echo "=== Verifying models are present (the real success gate) ==="
|
||||||
curl -sf http://ollama:11434/api/tags | grep -q "qwen3-embedding" && echo " qwen3-embedding: OK"
|
curl -sf http://ollama:11434/api/tags | grep -q "qwen3-embedding" || { echo "FATAL: qwen3-embedding missing and could not be pulled"; exit 1; }
|
||||||
curl -sf http://ollama:11434/api/tags | grep -q "glm-5" && echo " glm-5: OK"
|
curl -sf http://ollama:11434/api/tags | grep -q "glm-5" || { echo "FATAL: glm-5 missing and could not be pulled"; exit 1; }
|
||||||
echo "=== All models ready! ==="
|
echo "=== All models ready! ==="
|
||||||
|
|
||||||
# ==========================================================================
|
# ==========================================================================
|
||||||
|
|||||||
+14
-10
@@ -71,22 +71,26 @@ services:
|
|||||||
entrypoint: ["/bin/sh", "-c"]
|
entrypoint: ["/bin/sh", "-c"]
|
||||||
command:
|
command:
|
||||||
- |
|
- |
|
||||||
set -e
|
# NO `set -e`: pulls are best-effort. Cached models persist in the ollama
|
||||||
echo "=== Pulling embedding model (qwen3-embedding:0.6b) ==="
|
# volume and MUST survive a slow/unreachable ollama registry — a manifest
|
||||||
# Ollama /api/pull streams JSON lines until complete - consume full stream
|
# re-check failure there must never down a fully-cached deployment (it
|
||||||
# Note: $$ escapes $ for docker-compose variable substitution
|
# used to: a degraded registry made `ollama pull` fail under set -e, which
|
||||||
|
# blocked the orchestrator's service_completed_successfully gate). Success
|
||||||
|
# is gated on the models being PRESENT (verify step), not on the pull.
|
||||||
|
# Note: $$ escapes $ for docker-compose variable substitution.
|
||||||
|
echo "=== Pulling embedding model (qwen3-embedding:0.6b) — best-effort ==="
|
||||||
curl -sN http://ollama:11434/api/pull -d '{"name":"qwen3-embedding:0.6b"}' | while read -r line; do
|
curl -sN http://ollama:11434/api/pull -d '{"name":"qwen3-embedding:0.6b"}' | while read -r line; do
|
||||||
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
||||||
[ -n "$$status" ] && echo " $$status"
|
[ -n "$$status" ] && echo " $$status"
|
||||||
done
|
done || echo " (pull failed — relying on the cached model)"
|
||||||
echo "=== Pulling LLM model (glm-5:cloud) ==="
|
echo "=== Pulling LLM model (glm-5:cloud) — best-effort ==="
|
||||||
curl -sN http://ollama:11434/api/pull -d '{"name":"glm-5:cloud"}' | while read -r line; do
|
curl -sN http://ollama:11434/api/pull -d '{"name":"glm-5:cloud"}' | while read -r line; do
|
||||||
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
||||||
[ -n "$$status" ] && echo " $$status"
|
[ -n "$$status" ] && echo " $$status"
|
||||||
done
|
done || echo " (pull failed — relying on the cached model)"
|
||||||
echo "=== Verifying models are available ==="
|
echo "=== Verifying models are present (the real success gate) ==="
|
||||||
curl -sf http://ollama:11434/api/tags | grep -q "qwen3-embedding" && echo " qwen3-embedding: OK"
|
curl -sf http://ollama:11434/api/tags | grep -q "qwen3-embedding" || { echo "FATAL: qwen3-embedding missing and could not be pulled"; exit 1; }
|
||||||
curl -sf http://ollama:11434/api/tags | grep -q "glm-5" && echo " glm-5: OK"
|
curl -sf http://ollama:11434/api/tags | grep -q "glm-5" || { echo "FATAL: glm-5 missing and could not be pulled"; exit 1; }
|
||||||
echo "=== All models ready! ==="
|
echo "=== All models ready! ==="
|
||||||
|
|
||||||
# ==========================================================================
|
# ==========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user