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

Docker preserve sources #658

Merged
merged 4 commits into from
Jun 26, 2023
Merged

Docker preserve sources #658

merged 4 commits into from
Jun 26, 2023

Conversation

samm81
Copy link
Contributor

@samm81 samm81 commented Jun 22, 2023

Description

Redoes #590 in a way so as to not cause #615 (see explanation here in #620 )

Testing

tested both with and without REBUILD env var set

% docker run -it --rm -v ./models:/build/models --publish 8080:8080 local-ai-dev
go mod edit -replace github.com/go-skynet/go-llama.cpp=/build/go-llama
go mod edit -replace github.com/nomic-ai/gpt4all/gpt4all-bindings/golang=/build/gpt4all/gpt4all-bindings/golang
go mod edit -replace github.com/go-skynet/go-ggml-transformers.cpp=/build/go-ggml-transformers
go mod edit -replace github.com/donomii/go-rwkv.cpp=/build/go-rwkv
go mod edit -replace github.com/ggerganov/whisper.cpp=/build/whisper.cpp
go mod edit -replace github.com/go-skynet/go-bert.cpp=/build/go-bert
go mod edit -replace github.com/go-skynet/bloomz.cpp=/build/bloomz
go mod edit -replace github.com/mudler/go-stable-diffusion=/build/go-stable-diffusion
go mod download
touch prepare
I local-ai build info:
I BUILD_TYPE:
I GO_TAGS: stablediffusion
CGO_LDFLAGS="" C_INCLUDE_PATH=/build/go-llama:/build/go-stable-diffusion/:/build/gpt4all/gpt4all-bindings/golang/:/build/go-ggml-transformers:/build/go-rwkv:/build/whisper.cpp:/build/go-bert:/build/bloomz LIBRARY_PATH=/build/go-llama:/build/go-stable-diffusion/:/build/gpt4all/gpt4all-bindings/golang/:/build/go-ggml-transformers:/build/go-rwkv:/build/whisper.cpp:/build/go-bert:/build/bloomz go build -ldflags "?=" -tags "stablediffusion" -o local-ai ./
Starting LocalAI using 4 threads, with models path: /build/models

 ┌───────────────────────────────────────────────────┐
 │                   Fiber v2.47.0                   │
 │               http://127.0.0.1:8080               │
 │       (bound on host 0.0.0.0 and port 8080)       │
 │                                                   │
 │ Handlers ............ 23  Processes ........... 1 │
 │ Prefork ....... Disabled  PID ............... 227 │
 └───────────────────────────────────────────────────┘

^C%

% docker run -it --rm -v ./models:/build/models --publish 8080:8080 --env REBUILD=false local-ai-dev
Starting LocalAI using 4 threads, with models path: /build/models

 ┌───────────────────────────────────────────────────┐
 │                   Fiber v2.47.0                   │
 │               http://127.0.0.1:8080               │
 │       (bound on host 0.0.0.0 and port 8080)       │
 │                                                   │
 │ Handlers ............ 23  Processes ........... 1 │
 │ Prefork ....... Disabled  PID ................. 6 │
 └───────────────────────────────────────────────────┘

^C%

Signed commits

  • Yes, I signed my commits.

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
samm81 added 4 commits June 26, 2023 12:30
since dependency hashes are kept in the `Makefile`, changing them will
make `docker` start from the `COPY Makefile .` line, which will then
correctly refetch sources

however, if only go source files are touched, `docker` won't throwaway
all the fetching and compiling it did previously
so as to not break the `entrypoint.sh` script when `REBUILD!=false` and
it calls `make build`
@samm81
Copy link
Contributor Author

samm81 commented Jun 26, 2023

having some trouble testing locally due to #662

Copy link
Owner

@mudler mudler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good!

@mudler mudler merged commit e130b20 into mudler:master Jun 26, 2023
@samm81 samm81 deleted the docker-preserve-sources branch June 26, 2023 22:45
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

Successfully merging this pull request may close these issues.

2 participants