Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pulling ollama model llama2 using http://host.docker.internal:11434 pull-model-1 panic: $HOME is not defined #176

Open
mishagavron opened this issue Aug 15, 2024 · 8 comments

Comments

@mishagavron
Copy link

I am running genai-stack on my Mac and getting this error when I do: docker-compose up --build

pull-model-1 | pulling ollama model llama2 using http://host.docker.internal:11434
pull-model-1 | panic: $HOME is not defined
pull-model-1 |
pull-model-1 | goroutine 1 [running]:
pull-model-1 | github.com/ollama/ollama/envconfig.Models()
pull-model-1 | github.com/ollama/ollama/envconfig/config.go:93 +0xa9
pull-model-1 | github.com/ollama/ollama/envconfig.AsMap()
pull-model-1 | github.com/ollama/ollama/envconfig/config.go:253 +0x699
pull-model-1 | github.com/ollama/ollama/cmd.NewCLI()
pull-model-1 | github.com/ollama/ollama/cmd/cmd.go:1329 +0xb68
pull-model-1 | main.main()
pull-model-1 | github.com/ollama/ollama/main.go:12 +0x13
pull-model-1 | panic: $HOME is not defined
pull-model-1 |
pull-model-1 | goroutine 1 [running]:
pull-model-1 | github.com/ollama/ollama/envconfig.Models()
pull-model-1 | github.com/ollama/ollama/envconfig/config.go:93 +0xa9
pull-model-1 | github.com/ollama/ollama/envconfig.AsMap()
pull-model-1 | github.com/ollama/ollama/envconfig/config.go:253 +0x699
pull-model-1 | github.com/ollama/ollama/cmd.NewCLI()
pull-model-1 | github.com/ollama/ollama/cmd/cmd.go:1329 +0xb68
pull-model-1 | main.main()
pull-model-1 | github.com/ollama/ollama/main.go:12 +0x13
pull-model-1 exited with code 1

@aubrey-ford-nutrien
Copy link

Same here

@aubrey-ford-nutrien
Copy link

I removed the inline comments in my .env and it works now

image

@gingaramo
Copy link

Same, but removing the comments on the non-comment lines in .env didn't fix it.

@gingaramo
Copy link

gingaramo commented Aug 23, 2024

Followed #175, the fix was to add

(process/shell {:env {"OLLAMA_HOST" url "HOME" (System/getProperty "user.home")} :out :inherit :err :inherit} (format "bash -c './bin/ollama show %s --modelfile > /dev/null || ./bin/ollama pull %s'" llm llm))

In pull_model.Dockerfile. The run two commands:

docker compose down

docker compose up --build

@flyboyer
Copy link

same issue

@popalex
Copy link

popalex commented Sep 22, 2024

same issue here.

@hamedmiir
Copy link

Followed #175, the fix was to add

(process/shell {:env {"OLLAMA_HOST" url "HOME" (System/getProperty "user.home")} :out :inherit :err :inherit} (format "bash -c './bin/ollama show %s --modelfile > /dev/null || ./bin/ollama pull %s'" llm llm))

In pull_model.Dockerfile. The run two commands:

docker compose down

docker compose up --build

Same issue here. Didn't resolve by changing pull_model.Dockerfile.
.env just includes OLLAMA_BASE_URL=http://llm:11434

Is there any update?

@a8mark
Copy link

a8mark commented Oct 25, 2024

I got it running on Ubuntu by:

  1. updating OLLAMA_BASE_URL to the correct machine name

docker ps (note NAME)
in .env file
OLLAMA_BASE_URL=http://machine name:11434 (e.g. OLLAMA_BASE_URL=http://genai-stack-llm-1:11434)

  1. explicitly setting HOME in pull_model.Dockerfile
#syntax = docker/dockerfile:1.4

# Stage 1: Use ollama as the base to get the ollama binary
FROM ollama/ollama:latest AS ollama

# Stage 2: Use babashka as the main image
FROM babashka/babashka:latest

# Set the working directory to /root
WORKDIR /root

# Set the HOME environment variable explicitly
ENV HOME /root

[ continue with existing file ... ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants