Skip to content

Commit

Permalink
template
Browse files Browse the repository at this point in the history
  • Loading branch information
rusenask committed Aug 7, 2024
1 parent adf23f6 commit 85f9092
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions gallery/templates/llama3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,7 @@ spec:
- -ec
- |
#!/usr/bin/env bash
ollama serve &
serve_pid=$!
# Initialize retry count
retry_count=0
max_retries=15
# Retry ollama list until it succeeds or retries exceed max retries
until ollama list
do
((retry_count++))
echo "Retry $retry_count of $max_retries..."
if [ $retry_count -eq $max_retries ]; then
echo "Failed to execute 'ollama list' after $max_retries attempts."
kill $serve_pid
wait $serve_pid
exit 1
fi
sleep 1
done
# Pull the default tag or 'llama3'
ollama pull {{ .Tag | default "llama3" }}
# Wait for ollama serve to exit
wait $serve_pid
serve_exit_status=$?
if [ $serve_exit_status -ne 0 ]; then
echo "ollama serve command failed with exit status $serve_exit_status"
exit $serve_exit_status
fi
echo "ollama serve command exited"
ollama serve & sleep 1 && ollama run {{ .Tag | default "llama3" }} && wait
ports:
- {{ .Port | default "11434" }}:11434
volumes:
Expand Down

0 comments on commit 85f9092

Please sign in to comment.