TEN-framework / TEN-Agent

TEN Agent is a world-class multimodal AI agent integrated with the OpenAI Realtime API, RTC, and features weather checks, web search, vision, and RAG.
https://agent.theten.ai/
Apache License 2.0
1.79k stars 209 forks source link

[Bug] Build Failed in container `astra_agents_dev` with non-root user #307

Open Lensual opened 1 month ago

Lensual commented 1 month ago

Description

Run command make build failed in container astra_agents_dev with non-root user cloned project.

The container user is root, But the directory owner is non-root.

git output fatal: detected dubious ownership in repository at '/app'

Version

git branch: main

git commit id: 897f85430a463dd1fc0968494fca6c19f652a407

docker image: ghcr.io/ten-framework/ten_agent_build:0.1.0

Step

  1. Clone project with non-root user
  2. Follow the README.md
  3. On step 4. Enter container and build agent
  4. When run command make build, its failed.

Log

$ docker exec -it astra_agents_dev bash
root@fe1d0023211c:/app# make build
>> build agents
cd agents && ./scripts/install_deps_and_build.sh linux x64 && mv bin/main bin/worker
install dependencies...
  Resolving packages...
  The following local packages do not appear in the dependency tree:
 extension:chat_transcriber@0.4.0
 extension:interrupt_detector_python@0.4.0
 extension:cosy_tts@0.4.0
 extension:aliyun_analyticdb_vector_storage@0.4.0
 extension:http_server_python@0.5.0
 extension:openai_v2v_python@0.1.0
 extension:gemini_llm_python@0.4.0
 extension:elevenlabs_tts@0.4.0
 extension:bedrock_llm_python@0.4.0
 extension:llama_index_chat_engine@0.4.0
 extension:file_chunker@0.4.0
 extension:transcribe_asr_python@0.4.0
 extension:polly_tts@0.4.0
 extension:interrupt_detector@0.4.0
 extension:message_collector@0.1.0
 extension:chat_transcriber_python@0.4.0
 extension:openai_chatgpt_python@0.1.0
 extension:qwen_llm_python@0.4.0
 extension:aliyun_text_embedding@0.4.0
 extension:openai_chatgpt@0.4.0
 extension:elevenlabs_tts_python@0.4.0
  Creating manifest-lock.json...
+  Installing packages...
  [00:00:17] [########################################]      10/10      Done                                                                                              :-)  Install successfully in 28 seconds
build_cxx_extensions...
Generating compile_commands took 0ms
Done. Made 11 targets from 14 files in 486ms
ninja: Entering directory `/app/agents/out/linux/x64'
[20/20](1) GEN obj/default_app_go.stamp
build_go_app...
16:32:32 Go version [1.22.3] is found.
16:32:32 Go app [/app/agents] is found.
16:32:32 /app/agents/ten_packages/extension/agora_rtc is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/aliyun_analyticdb_vector_storage is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/aliyun_text_embedding is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/azure_tts is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/bedrock_llm_python is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/chat_transcriber_python is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/cosy_tts is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/elevenlabs_tts_python is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/file_chunker is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/gemini_llm_python is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/http_server_python is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/interrupt_detector_python is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/llama_index_chat_engine is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/message_collector is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/openai_chatgpt_python is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/openai_v2v_python is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/polly_tts is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/py_init_extension_cpp is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/qwen_llm_python is not a GO extension, no go.mod
16:32:32 /app/agents/ten_packages/extension/transcribe_asr_python is not a GO extension, no go.mod
16:32:32 Go Extensions are detected:
16:32:32        chat_transcriber @ /app/agents/ten_packages/extension/chat_transcriber
16:32:32        elevenlabs_tts @ /app/agents/ten_packages/extension/elevenlabs_tts
16:32:32        interrupt_detector @ /app/agents/ten_packages/extension/interrupt_detector
16:32:32        openai_chatgpt @ /app/agents/ten_packages/extension/openai_chatgpt
16:32:32 Go env:
16:32:32        GOHOSTARCH='amd64'
16:32:32        GOHOSTOS='linux'
16:32:32        GOSUMDB='sum.golang.org'
16:32:32        CC='gcc'
16:32:32        GOAMD64='v1'
16:32:32        GOENV='/root/.config/go/env'
16:32:32        GOFLAGS=''
16:32:32        GCCGO='gccgo'
16:32:32        GOEXPERIMENT=''
16:32:32        AR='ar'
16:32:32        CGO_CPPFLAGS=''
16:32:32        CGO_CXXFLAGS='-O2 -g'
16:32:32        CGO_FFLAGS='-O2 -g'
16:32:32        GOPRIVATE='*.agoralab.co'
16:32:32        GOPROXY='https://proxy.golang.org,direct'
16:32:32        GOVERSION='go1.22.3'
16:32:32        GOARCH='amd64'
16:32:32        GOINSECURE=''
16:32:32        GOMODCACHE='/root/go/pkg/mod'
16:32:32        GOPATH='/root/go'
16:32:32        GONOSUMDB='*.agoralab.co'
16:32:32        PKG_CONFIG='pkg-config'
16:32:32        CGO_LDFLAGS='-Lten_packages/system/ten_runtime_go/lib -lten_runtime_go -Wl,-rpath=$ORIGIN/../ten_packages/system/ten_runtime_go/lib -O2 -g'
16:32:32        GOBIN=''
16:32:32        GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3209668069=/tmp/go-build -gno-record-gcc-switches'
16:32:32        GONOPROXY='*.agoralab.co'
16:32:32        GOWORK=''
16:32:32        CGO_ENABLED='1'
16:32:32        GOTMPDIR=''
16:32:32        GOTOOLCHAIN='auto'
16:32:32        GOVCS=''
16:32:32        GOCACHE='/root/.cache/go-build'
16:32:32        GOMOD='/app/agents/go.mod'
16:32:32        GOROOT='/usr/local/go'
16:32:32        GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
16:32:32        GOOS='linux'
16:32:32        CGO_CFLAGS='-O2 -g'
16:32:32        CXX='g++'
16:32:32        GO111MODULE=''
16:32:32        GOEXE=''
16:32:32 Run 'go mod tidy' on [/app/agents/ten_packages/extension/chat_transcriber].
16:32:32        go: downloading google.golang.org/protobuf v1.34.2
16:32:34        go: downloading github.com/google/go-cmp v0.5.5
16:32:35        go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
16:32:35 Run 'go generate' on [/app/agents/ten_packages/extension/chat_transcriber].
16:32:35 Run 'go mod tidy' on [/app/agents/ten_packages/extension/elevenlabs_tts].
16:32:35        go: downloading github.com/haguro/elevenlabs-go v0.2.4
16:32:36 Run 'go generate' on [/app/agents/ten_packages/extension/elevenlabs_tts].
16:32:36 Run 'go mod tidy' on [/app/agents/ten_packages/extension/interrupt_detector].
16:32:36 Run 'go generate' on [/app/agents/ten_packages/extension/interrupt_detector].
16:32:36 Run 'go mod tidy' on [/app/agents/ten_packages/extension/openai_chatgpt].
16:32:36        go: downloading github.com/sashabaranov/go-openai v1.24.1
16:32:36        go: downloading github.com/stretchr/testify v1.9.0
16:32:37        go: downloading gopkg.in/yaml.v3 v3.0.1
16:32:37        go: downloading github.com/davecgh/go-spew v1.1.1
16:32:37        go: downloading github.com/pmezard/go-difflib v1.0.0
16:32:37        go: downloading gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
16:32:38 Run 'go generate' on [/app/agents/ten_packages/extension/openai_chatgpt].
16:32:38 Run 'go mod tidy' on [/app/agents].
16:32:38 Run 'go generate' on [/app/agents].
16:32:38 Auto-import file is generated at [/app/agents/generated_auto_import_addons.go].
16:32:38 Add extension modules to app successfully.
16:32:38 Run 'go mod tidy' on [/app/agents].
16:32:41 Build GO app with command: go build -o bin/main -v .
16:32:42        # cd /app; git status --porcelain
16:32:42        fatal: detected dubious ownership in repository at '/app'
16:32:42        To add an exception for this directory, call:
16:32:42 
16:32:42                git config --global --add safe.directory /app
16:32:42        error obtaining VCS status: exit status 128
16:32:42                Use -buildvcs=false to disable VCS stamping.
16:32:42 Error: exit status 1
exit status 1
FATAL: failed to build go app, see logs for detail.
make: *** [Makefile:11: build-agents] Error 1
root@fe1d0023211c:/app#
wangyoucao577 commented 1 month ago

As the error log suggested, run git config --global --add safe.directory /app before make build will solve it.

Lensual commented 1 month ago

I think abusing root privileges is not good. But currently it looks like this is a dev container.

cyfyifanchen commented 1 month ago

I thought we've updated the container name to ten_agent_dev.