File tree Expand file tree Collapse file tree 1 file changed +1
-32
lines changed Expand file tree Collapse file tree 1 file changed +1
-32
lines changed Original file line number Diff line number Diff line change 3535 - -ec
3636 - |
3737 #!/usr/bin/env bash
38- ollama serve &
39- serve_pid=$!
40-
41- # Initialize retry count
42- retry_count=0
43- max_retries=15
44-
45- # Retry ollama list until it succeeds or retries exceed max retries
46- until ollama list
47- do
48- ((retry_count++))
49- echo "Retry $retry_count of $max_retries..."
50- if [ $retry_count -eq $max_retries ]; then
51- echo "Failed to execute 'ollama list' after $max_retries attempts."
52- kill $serve_pid
53- wait $serve_pid
54- exit 1
55- fi
56- sleep 1
57- done
58-
59- # Pull the default tag or 'llama3'
60- ollama pull {{ .Tag | default "llama3" }}
61-
62- # Wait for ollama serve to exit
63- wait $serve_pid
64- serve_exit_status=$?
65- if [ $serve_exit_status -ne 0 ]; then
66- echo "ollama serve command failed with exit status $serve_exit_status"
67- exit $serve_exit_status
68- fi
69- echo "ollama serve command exited"
38+ ollama serve & sleep 1 && ollama run {{ .Tag | default "llama3" }} && wait
7039 ports :
7140 - {{ .Port | default "11434" }}:11434
7241 volumes :
You can’t perform that action at this time.
0 commit comments