-
Notifications
You must be signed in to change notification settings - Fork 935
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
GenAI changes to allow it to run on Debian GNU/Linux unstable #51
Open
HaakonME
wants to merge
1
commit into
docker:main
Choose a base branch
from
HaakonME:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+35
−29
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
* | ||
!pull_model.clj | ||
!*.py | ||
!requirements.txt | ||
!images/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(ns pull-model | ||
(:require [babashka.process :as process] | ||
[clojure.core.async :as async])) | ||
|
||
(try | ||
(let [llm (get (System/getenv) "LLM") | ||
url (get (System/getenv) "OLLAMA_BASE_URL")] | ||
(println (format "pulling ollama model %s using %s" llm url)) | ||
(if (and llm url (not (#{"gpt-4" "gpt-3.5"} llm))) | ||
|
||
;; ---------------------------------------------------------------------- | ||
;; just call `ollama pull` here - create OLLAMA_HOST from OLLAMA_BASE_URL | ||
;; ---------------------------------------------------------------------- | ||
;; TODO - this still doesn't show progress properly when run from docker compose | ||
|
||
(let [done (async/chan)] | ||
(async/go-loop [n 0] | ||
(let [[v _] (async/alts! [done (async/timeout 5000)])] | ||
(if (= :stop v) :stopped (do (println (format "... pulling model (%ss) - will take several minutes" (* n 10))) (recur (inc n)))))) | ||
(process/shell {:env {"OLLAMA_HOST" url} :out :inherit :err :inherit} (format "./bin/ollama pull %s" llm)) | ||
(async/>!! done :stop)) | ||
|
||
(println "OLLAMA model only pulled if both LLM and OLLAMA_BASE_URL are set and the LLM model is not gpt"))) | ||
(catch Throwable _ (System/exit 1))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# docker run -d --name neo4j -e NEO4J_AUTH=neo4j/password -p 7687:7687 -p 7474:7474 neo4j:latest | ||
# docker ps -qaf name=neo4j | ||
docker run -d --name neo4j -e NEO4J_AUTH=neo4j/password -p 7687:7687 -p 7474:7474 neo4j:latest | ||
docker ps -qaf name=neo4j | ||
|
||
docker compose up --build --force-recreate | ||
docker-compose up --build --force-recreate | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't
docker-compose
deprecated fordocker compose
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"docker compose" is the updated version from Docker, yes. However, in the latest version of Debian GNU/Linux and the Unstable branch, it is still a separate command for "docker" and "docker-compose". That is why I suggested, if possible, to create an extra profile, e.g. --profile debianunstable, rather than assume every Linux can use --profile linux. I do not know if this is possible, but it would be nice. As a general rule, "docker compose", with the space is the updated way. I hope this helps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant is we should encourage the use of
docker compose
. But if it is available on Debian Unstable, why not use it ?Anyway, the changes you made should work even when using
docker compose
(thecontext: .
is implicit indocker compose
, don't know fordocker-compose
). The only thing I would do differently is creating another start script for the olddocker-compose
instead of changing the actual one.I would still be interested in what error you had before, maybe there is another workaround!