Skip to content

Commit

Permalink
Merge pull request #89 from firstbatchxyz/startsh-ollama-host-os-fix …
Browse files Browse the repository at this point in the history
…[skip ci]

startsh updates
  • Loading branch information
erhant authored Aug 15, 2024
2 parents 41e5407 + b340655 commit 98931bb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
docs() {
echo "
start.sh starts the compute node with given environment and parameters using docker-compose.
Loads the .env file as base environment and creates a .env.compose file for final environment to run with docker-compose.
Required environment variables in .env file; DKN_WALLET_SECRET_KEY
Required environment variables in .env file; DKN_WALLET_SECRET_KEY, DKN_ADMIN_PUBLIC_KEY
Arguments:
-h | --help: Displays this help message
Expand Down Expand Up @@ -52,7 +51,6 @@ check_os() {
esac
}
check_os
echo "OS: ${OS}"

# if .env exists, load it first
ENV_FILE="./.env"
Expand Down Expand Up @@ -140,12 +138,13 @@ handle_compute_env() {
DKN_ADMIN_PUBLIC_KEY
OPENAI_API_KEY
SERPER_API_KEY
JINA_API_KEY
BROWSERLESS_TOKEN
ANTHROPIC_API_KEY
RUST_LOG
DKN_MODELS
"
temp=$(as_pairs $compute_env_vars)
as_pairs $compute_env_vars > /dev/null 2>&1

# handle DKN_MODELS
if [ -n "$MODELS_LIST" ]; then
Expand All @@ -164,7 +163,7 @@ handle_ollama_env() {
OLLAMA_PORT
OLLAMA_AUTO_PULL
"
temp=$(as_pairs $ollama_env_vars)
as_pairs "$ollama_env_vars" > /dev/null 2>&1

# if there is no ollama model given, do not add any ollama compose profile
ollama_needed=false
Expand All @@ -182,6 +181,10 @@ handle_ollama_env() {
# check local ollama
if [ "$DOCKER_OLLAMA" = false ]; then
if command -v ollama >/dev/null 2>&1; then
# host machine has ollama installed
# we first going to check whether its serving or not
# if not script runs ollama serve command manually and store its pid

# prepare local ollama url
OLLAMA_HOST="${OLLAMA_HOST:-http://localhost}"
OLLAMA_PORT="${OLLAMA_PORT:-11434}"
Expand Down

0 comments on commit 98931bb

Please sign in to comment.