This is an automated email from the ASF dual-hosted git repository.

wenjin272 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-agents.git


The following commit(s) were added to refs/heads/main by this push:
     new d5e60582 [ci] Retry Ollama install and propagate download failures 
(#891)
d5e60582 is described below

commit d5e6058275498e2e4b3609888749054905ec5346
Author: Weiqing Yang <[email protected]>
AuthorDate: Mon Jul 13 00:13:39 2026 -0700

    [ci] Retry Ollama install and propagate download failures (#891)
---
 tools/start_ollama_server.sh | 31 ++++++++++++++++++++++++-------
 1 file changed, 24 insertions(+), 7 deletions(-)

diff --git a/tools/start_ollama_server.sh b/tools/start_ollama_server.sh
index a80afcfc..3c35a41c 100644
--- a/tools/start_ollama_server.sh
+++ b/tools/start_ollama_server.sh
@@ -17,12 +17,29 @@
 
#################################################################################
 
 # only works on linux
+set -euo pipefail
+
 os=$(uname -s)
-echo $os
+echo "$os"
+
+install_script=$(mktemp)
+trap 'rm -f "$install_script"' EXIT
+
+# The upstream installer probes for the .tar.zst asset with a silent HEAD 
request, and on
+# any failure of that probe falls back to a .tgz that current releases no 
longer publish.
+# A single transient network error therefore turns into a hard 404, so retry 
the install.
+attempts=3
+for attempt in $(seq 1 "$attempts"); do
+  if curl -fsSL https://ollama.com/install.sh -o "$install_script" && sh 
"$install_script"; then
+    exit 0
+  fi
+
+  if [ "$attempt" -lt "$attempts" ]; then
+    delay=$((attempt * 10))
+    echo "ollama install attempt ${attempt}/${attempts} failed; retrying in 
${delay}s" >&2
+    sleep "$delay"
+  fi
+done
 
-curl -fsSL https://ollama.com/install.sh | sh
-ret=$?
-if [ "$ret" != "0" ]
-then
-  exit $ret
-fi
\ No newline at end of file
+echo "ollama install failed after ${attempts} attempts" >&2
+exit 1

Reply via email to