Skip to content

Docker build failing on mac #444

@shep920

Description

@shep920

LocalAI version:1.17.1

commit ssh: fa58965

Environment, CPU architecture, OS, and Version:
Mac 12.6.1 Montery
Describe the bug
When trying to run docker-compose up -d --build it fails. Note that this occured sequentially in the steps provided in the tutorial, and im using gpt-4all like the examples
To Reproduce

git clone https://github.com/go-skynet/LocalAI.git

cd LocalAI

wget https://gpt4all.io/models/ggml-gpt4all-j.bin -O models/ggml-gpt4all-j.bin

docker-compose up -d --build

Expected behavior

the build to succeed

Logs

logs from the docker build:

 => [api builder 7/8] COPY . .                                                                                                                                               55.3s
 => ERROR [api builder 8/8] RUN make build                                                                                                                                   51.9s
 => [api stage-1 8/9] RUN make prepare-sources                                                                                                                               51.6s
------                                                                                                                                                                             
 > [api builder 8/8] RUN make build:                                                                                                                                               
#0 4.805 go mod edit -replace github.com/go-skynet/go-llama.cpp=/build/go-llama                                                                                                    
#0 4.962 go mod edit -replace github.com/nomic-ai/gpt4all/gpt4all-bindings/golang=/build/gpt4all/gpt4all-bindings/golang                                                           
#0 5.008 go mod edit -replace github.com/go-skynet/go-ggml-transformers.cpp=/build/go-ggml-transformers                                                                            
#0 5.173 go mod edit -replace github.com/donomii/go-rwkv.cpp=/build/go-rwkv                                                                                                        
#0 5.325 go mod edit -replace github.com/ggerganov/whisper.cpp=/build/whisper.cpp                                                                                                  
#0 5.342 go mod edit -replace github.com/go-skynet/go-bert.cpp=/build/go-bert                                                                                                      
#0 5.358 go mod edit -replace github.com/go-skynet/bloomz.cpp=/build/bloomz                                                                                                        
#0 5.422 go mod edit -replace github.com/mudler/go-stable-diffusion=/build/go-stable-diffusion                                                                                     
#0 5.470 go mod download                                                                                                                                                           
#0 51.06 make -C gpt4all/gpt4all-bindings/golang/ libgpt4all.a                                                                                                                     
#0 51.45 make[1]: Entering directory '/build/gpt4all/gpt4all-bindings/golang'
#0 51.60 I go-gpt4all build info: 
#0 51.60 I UNAME_S:  Linux
#0 51.62 I UNAME_P:  unknown
#0 51.62 I UNAME_M:  x86_64
#0 51.62 I CFLAGS:   -I. -I../../gpt4all-backend/llama.cpp -I../../gpt4all-backend -I -O3 -DNDEBUG -std=c11 -fPIC -Wall -Wextra -Wpedantic -Wcast-qual -Wdouble-promotion -Wshadow -Wstrict-prototypes -Wpointer-arith -Wno-unused-function -pthread -march=native -mtune=native
#0 51.62 I CXXFLAGS: -I. -I../../gpt4all-backend/llama.cpp -I../../gpt4all-backend -O3 -DNDEBUG -std=c++17 -fPIC -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -pthread -march=native -mtune=native
#0 51.62 I LDFLAGS:  
#0 51.62 I CMAKEFLAGS:  
#0 51.62 I CC:       cc (Debian 10.2.1-6) 10.2.1 20210110
#0 51.62 I CXX:      g++ (Debian 10.2.1-6) 10.2.1 20210110
#0 51.62 
#0 51.62 mkdir buildllm
#0 51.65 mkdir: cannot create directory 'buildllm': File exists
#0 51.66 make[1]: Leaving directory '/build/gpt4all/gpt4all-bindings/golang'
#0 51.66 make[1]: *** [Makefile:146: llmodel.o] Error 1
#0 51.66 make: *** [Makefile:128: gpt4all/gpt4all-bindings/golang/libgpt4all.a] Error 2
------
failed to solve: process "/bin/sh -c make build" did not complete successfully: exit code: 2

log from make test:

I CXXFLAGS: -I. -I../../gpt4all-backend/llama.cpp -I../../gpt4all-backend -O3 -DNDEBUG -std=c++17 -fPIC -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -pthread -march=native -mtune=native
I LDFLAGS:   -framework Accelerate
I CMAKEFLAGS:  
I CC:       Apple clang version 14.0.0 (clang-1400.0.29.202)
I CXX:      Apple clang version 14.0.0 (clang-1400.0.29.202)

c++ -I. -I../../gpt4all-backend/llama.cpp -I../../gpt4all-backend -O3 -DNDEBUG -std=c++17 -fPIC -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -pthread -march=native -mtune=native binding.cpp -o binding.o -c  -framework Accelerate
clang: warning: -framework Accelerate: 'linker' input unused [-Wunused-command-line-argument]
In file included from binding.cpp:2:
./../../gpt4all-backend/llmodel.h:17:39: warning: unused parameter 'dest' [-Wunused-parameter]
    virtual size_t saveState(uint8_t *dest) const { return 0; }
                                      ^
./../../gpt4all-backend/llmodel.h:18:48: warning: unused parameter 'src' [-Wunused-parameter]
    virtual size_t restoreState(const uint8_t *src) { return 0; }
                                               ^
./../../gpt4all-backend/llmodel.h:39:41: warning: unused parameter 'n_threads' [-Wunused-parameter]
    virtual void setThreadCount(int32_t n_threads) {}
                                        ^
In file included from binding.cpp:4:
./../../gpt4all-backend/llmodel_c.cpp:63:14: warning: variable 'model' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    else if (magic == 0x67676d6d) { model = llmodel_mpt_create();   }
             ^~~~~~~~~~~~~~~~~~~
./../../gpt4all-backend/llmodel_c.cpp:66:12: note: uninitialized use occurs here
    return model;
           ^~~~~
./../../gpt4all-backend/llmodel_c.cpp:63:10: note: remove the 'if' if its condition is always true
    else if (magic == 0x67676d6d) { model = llmodel_mpt_create();   }
         ^~~~~~~~~~~~~~~~~~~~~~~~~
./../../gpt4all-backend/llmodel_c.cpp:57:24: note: initialize the variable 'model' to silence this warning
    llmodel_model model;
                       ^
                        = nullptr
In file included from binding.cpp:6:
./../../gpt4all-backend/mpt.cpp:296:19: warning: unused variable 'n_ctx' [-Wunused-variable]
        const int n_ctx   = hparams.n_ctx;
                  ^
./../../gpt4all-backend/mpt.cpp:340:19: warning: unused variable 'n_elements' [-Wunused-variable]
        const int n_elements = n_embd*n_mem;
                  ^
./../../gpt4all-backend/mpt.cpp:462:15: warning: unused variable 'd_key' [-Wunused-variable]
    const int d_key = n_embd/n_head;
              ^
./../../gpt4all-backend/mpt.cpp:460:15: warning: unused variable 'expand' [-Wunused-variable]
    const int expand  = hparams.expand;
              ^
./../../gpt4all-backend/mpt.cpp:698:18: warning: unused variable 'expected' [-Wunused-variable]
    const size_t expected = mpt_get_state_size(model);
                 ^
./../../gpt4all-backend/mpt.cpp:748:18: warning: unused variable 'expected' [-Wunused-variable]
    const size_t expected = mpt_get_state_size(*model);
                 ^
./../../gpt4all-backend/mpt.cpp:754:1: warning: 'MPTPrivate' defined as a struct here but previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
struct MPTPrivate {
^
./../../gpt4all-backend/mpt.h:9:1: note: did you mean struct here?
class MPTPrivate;
^~~~~
struct
In file included from binding.cpp:6:
./../../gpt4all-backend/mpt.cpp:839:13: warning: variable 't_predict_us' set but not used [-Wunused-but-set-variable]
    int64_t t_predict_us = 0;
            ^
./../../gpt4all-backend/mpt.cpp:905:9: warning: unused variable 'p_instructFound' [-Wunused-variable]
    int p_instructFound = 0;
        ^
./../../gpt4all-backend/mpt.cpp:840:13: warning: variable 't_prompt_us' set but not used [-Wunused-but-set-variable]
    int64_t t_prompt_us = 0;
            ^
./../../gpt4all-backend/mpt.cpp:836:19: warning: unused variable 't_main_start_us' [-Wunused-variable]
    const int64_t t_main_start_us = ggml_gptj_time_us();
                  ^
./../../gpt4all-backend/mpt.cpp:838:13: warning: variable 't_sample_us' set but not used [-Wunused-but-set-variable]
    int64_t t_sample_us  = 0;
            ^
./../../gpt4all-backend/mpt.cpp:906:9: warning: unused variable 'r_instructFound' [-Wunused-variable]
    int r_instructFound = 0;
        ^
./../../gpt4all-backend/mpt.cpp:876:45: warning: comparison of integers of different signs: 'unsigned long' and 'int32_t' (aka 'int') [-Wsign-compare]
        if (promptCtx.n_past + batch.size() > promptCtx.n_ctx) {
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
./../../gpt4all-backend/mpt.cpp:894:41: warning: comparison of integers of different signs: 'std::vector<int>::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
            if (promptCtx.tokens.size() == promptCtx.n_ctx)
                ~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
./../../gpt4all-backend/mpt.cpp:991:41: warning: comparison of integers of different signs: 'std::vector<int>::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
            if (promptCtx.tokens.size() == promptCtx.n_ctx)
                ~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
binding.cpp:68:33: warning: unused parameter 'token_id' [-Wunused-parameter]
    auto lambda_prompt = [](int token_id)  {
                                ^
binding.cpp:76:27: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
        res.append((char*)responsechars);
                          ^
binding.cpp:77:46: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
        return !!getTokenCallback(mm, (char*)responsechars);
                                             ^
binding.cpp:75:35: warning: unused parameter 'token_id' [-Wunused-parameter]
    auto lambda_response = [](int token_id, const char *responsechars) {
                                  ^
24 warnings generated.
mkdir buildllm
cd buildllm && cmake ../../../gpt4all-backend/  && make VERBOSE=1 llmodel ggml common
/bin/sh: cmake: command not found
make[1]: *** [llmodel.o] Error 127
make: *** [gpt4all/gpt4all-bindings/golang/libgpt4all.a] Error 2

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions