deepwiki-open icon indicating copy to clipboard operation
deepwiki-open copied to clipboard

Just using docker-compose doesn't work - macbook arm64

Open cteodor opened this issue 1 year ago • 11 comments

Steps: git clone https://github.com/AsyncFuncAI/deepwiki-open.git cd deepwiki-open echo "GOOGLE_API_KEY=actual-api-key" > .env docker-compose up

Env: Darwin MacBookPro.local 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 arm64

Errors: [...] [+] Running 2/2 ✔ Network deepwiki-open_default Created 0.0s ✔ Container deepwiki-open-deepwiki-1 Created 0.0s Attaching to deepwiki-open-deepwiki-1 deepwiki-open-deepwiki-1 | 2025-05-01 03:38:36,647 - main - WARNING - Missing environment variables: GOOGLE_API_KEY, OPENAI_API_KEY deepwiki-open-deepwiki-1 | 2025-05-01 03:38:36,647 - main - WARNING - Some functionality may not work correctly without these variables. deepwiki-open-deepwiki-1 | deepwiki-open-deepwiki-1 | > [email protected] start deepwiki-open-deepwiki-1 | > next start [...] deepwiki-open-deepwiki-1 | 2025-05-01 03:38:38,874 - faiss.loader - INFO - Loading faiss. deepwiki-open-deepwiki-1 | 2025-05-01 03:38:38,886 - faiss.loader - INFO - Successfully loaded faiss. deepwiki-open-deepwiki-1 | 2025-05-01 03:38:38,888 - faiss - INFO - Failed to load GPU Faiss: name 'GpuIndexIVFFlat' is not defined. Will not load constructor refs for GPU indexes. This is only an error if you're trying to use GPU Faiss. [...] deepwiki-open-deepwiki-1 | File "/usr/local/lib/python3.11/site-packages/adalflow/components/model_client/openai_client.py", line 26, in deepwiki-open-deepwiki-1 | openai = safe_import(OptionalPackages.OPENAI.value[0], OptionalPackages.OPENAI.value[1]) deepwiki-open-deepwiki-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deepwiki-open-deepwiki-1 | File "/usr/local/lib/python3.11/site-packages/adalflow/utils/lazy_import.py", line 224, in safe_import deepwiki-open-deepwiki-1 | raise ImportError(f"{install_message}") deepwiki-open-deepwiki-1 | ImportError: Please install openai with: pip install openai

cteodor avatar May 01 '25 03:05 cteodor

I had the same issue. Adding - GOOGLE_API_KEY=${GOOGLE_API_KEY} - OPENAI_API_KEY=${OPENAI_API_KEY} under the environment key in the docker-compose.yml got rid of the missing environment variable error. Adding openai to api/requirements.txt got rid of the ImportError.

I had one more issue: "Address already in use"

deepwiki-1 | deepwiki-1 | > [email protected] start deepwiki-1 | > next start deepwiki-1 | deepwiki-1 | ▲ Next.js 15.3.1 deepwiki-1 | - Local: http://localhost:8001 deepwiki-1 | - Network: http://172.18.0.2:8001 deepwiki-1 | deepwiki-1 | ✓ Starting... deepwiki-1 | ✓ Ready in 350ms deepwiki-1 | 2025-05-01 07:07:56,238 - faiss.loader - INFO - Loading faiss with AVX2 support. deepwiki-1 | 2025-05-01 07:07:56,252 - faiss.loader - INFO - Successfully loaded faiss with AVX2 support. deepwiki-1 | 2025-05-01 07:07:56,254 - faiss - INFO - Failed to load GPU Faiss: name 'GpuIndexIVFFlat' is not defined. Will not load constructor refs for GPU indexes. This is only an error if you're trying to use GPU Faiss. deepwiki-1 | 2025-05-01 07:07:56,514 - main - INFO - Starting Streaming API on port 8001 deepwiki-1 | INFO: Will watch for changes in these directories: ['/app'] deepwiki-1 | ERROR: [Errno 98] Address already in use

I solved this by editing the package.json under the scripts --> start key, changing it to "start": "next start -p 3000"

mkoeck avatar May 01 '25 07:05 mkoeck

I encountered a similar problem when starting up my Mac device.

Image

League2EB avatar May 01 '25 11:05 League2EB

Published a new bugfix to address the docker-compose up issue, let me know if it works.

sng-asyncfunc avatar May 01 '25 13:05 sng-asyncfunc

Published a new bugfix to address the docker-compose up issue, let me know if it works.

Regarding the warning has indeed been eliminated

"WARNING - Missing environment variables: GOOGLE_API_KEY, OPENAI_API_KEY" But I still receive an error message that openai should be installed. The steps I used are the ones below. May I ask what I am missing or what I have overlooked?

# Clone the repository
git clone https://github.com/AsyncFuncAI/deepwiki-open.git
cd deepwiki-open

# Create a .env file with your API keys
echo "GOOGLE_API_KEY=your_google_api_key" > .env
echo "OPENAI_API_KEY=your_openai_api_key" >> .env

# Run with Docker Compose
docker-compose up

In addition, when I visit http://localhost:8001/, it is normal. However, I received another error.

Image

Thank you for your patient answers.🙇‍♂️

League2EB avatar May 01 '25 15:05 League2EB

What repository url are you trying? If it's a private repository you have to provide your github api token.

sng-asyncfunc avatar May 01 '25 15:05 sng-asyncfunc

It is still not working for me, any idea?

Docker-compose file: services: deepwiki: build: . ports: - "8001:8001" # API port - "3001:3001" # Next.js port env_file: - .env environment: - PORT=8001 - NODE_ENV=production volumes: - ~/.adalflow:/root/.adalflow # Persist repository and embedding data

Error: `

[email protected] start next start -p 3001

▲ Next.js 15.3.1

  • Local: http://localhost:3001
  • Network: http://172.24.0.2:3001

✓ Starting... ✓ Ready in 1987ms 2025-05-02 00:31:49,519 - faiss.loader - INFO - Loading faiss. 2025-05-02 00:31:49,610 - faiss.loader - INFO - Successfully loaded faiss. 2025-05-02 00:31:49,625 - faiss - INFO - Failed to load GPU Faiss: name 'GpuIndexIVFFlat' is not defined. Will not load constructor refs for GPU indexes. This is only an error if you're trying to use GPU Faiss. 2025-05-02 00:31:51,307 - main - INFO - Starting Streaming API on port 8001 INFO: Will watch for changes in these directories: ['/app'] INFO: Uvicorn running on http://0.0.0.0:8001 (Press CTRL+C to quit) INFO: Started reloader process [11] using StatReload 2025-05-02 00:31:55,065 - faiss.loader - INFO - Loading faiss. 2025-05-02 00:31:55,121 - faiss.loader - INFO - Successfully loaded faiss. 2025-05-02 00:31:55,135 - faiss - INFO - Failed to load GPU Faiss: name 'GpuIndexIVFFlat' is not defined. Will not load constructor refs for GPU indexes. This is only an error if you're trying to use GPU Faiss. INFO: Started server process [43] INFO: Waiting for application startup. INFO: Application startup complete. `

spydisec avatar May 02 '25 00:05 spydisec

@spydisec I think i found out why, we are missing

Image

PORT=3000 or in your case 3001 in the .env

P/S: Pushed a new fix to explicitly specify port 3000.

sng-asyncfunc avatar May 02 '25 00:05 sng-asyncfunc

What repository url are you trying? If it's a private repository you have to provide your github api token.

https://github.com/openai/codex I tried to use a public repository.

I suspect that you seem to have overlooked the error message in the screenshot, especially the one that occurred at the end: "deepwiki-1 | ImportError: Please install openai with: pip install openai."

deepwiki-1  | 2025-05-02 01:48:50,702 - faiss - INFO - Failed to load GPU Faiss: name 'GpuIndexIVFFlat' is not defined. Will not load constructor refs for GPU indexes. This is only an error if you're trying to use GPU Faiss.
deepwiki-1  | Traceback (most recent call last):
deepwiki-1  |   File "/usr/local/lib/python3.11/site-packages/adalflow/utils/lazy_import.py", line 222, in safe_import
deepwiki-1  |     return_modules.append(importlib.import_module(module_name))
deepwiki-1  |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deepwiki-1  |   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
deepwiki-1  |     return _bootstrap._gcd_import(name[level:], package, level)
deepwiki-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deepwiki-1  |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
deepwiki-1  |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
deepwiki-1  |   File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
deepwiki-1  | ModuleNotFoundError: No module named 'openai'
deepwiki-1  | 
deepwiki-1  | During handling of the above exception, another exception occurred:
deepwiki-1  | 
deepwiki-1  | Traceback (most recent call last):
deepwiki-1  |   File "<frozen runpy>", line 198, in _run_module_as_main
deepwiki-1  |   File "<frozen runpy>", line 88, in _run_code
deepwiki-1  |   File "/app/api/main.py", line 32, in <module>
deepwiki-1  |     from api.api import app
deepwiki-1  |   File "/app/api/api.py", line 10, in <module>
deepwiki-1  |     from api.rag import RAG
deepwiki-1  |   File "/app/api/rag.py", line 13, in <module>
deepwiki-1  |     from api.config import configs
deepwiki-1  |   File "/app/api/config.py", line 2, in <module>
deepwiki-1  |     from adalflow.components.model_client.openai_client import OpenAIClient
deepwiki-1  |   File "/usr/local/lib/python3.11/site-packages/adalflow/components/model_client/openai_client.py", line 26, in <module>
deepwiki-1  |     openai = safe_import(OptionalPackages.OPENAI.value[0], OptionalPackages.OPENAI.value[1])
deepwiki-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
deepwiki-1  |   File "/usr/local/lib/python3.11/site-packages/adalflow/utils/lazy_import.py", line 224, in safe_import
deepwiki-1  |     raise ImportError(f"{install_message}")
deepwiki-1  | ImportError: Please install openai with: pip install openai

League2EB avatar May 02 '25 01:05 League2EB

@spydisec I think i found out why, we are missing

Image

PORT=3000 or in your case 3001 in the .env

P/S: Pushed a new fix to explicitly specify port 3000.

The reason I am using 3001 is I already have another app which is running on 3000.

Web app is working but getting error when I put GitHub repo.

spydisec avatar May 02 '25 03:05 spydisec

I found a similar issue. So my problem is when I am running this app on another machine, the frontend is trying to connect to the backend at localhost? Literally just followed the docker instructions and that's it.

Image

achhabra2 avatar May 02 '25 20:05 achhabra2

I found a similar issue. So my problem is when I am running this app on another machine, the frontend is trying to connect to the backend at localhost? Literally just followed the docker instructions and that's it.

Image

I have a PR created that should solve this issue: https://github.com/AsyncFuncAI/deepwiki-open/pull/31

JNLei avatar May 05 '25 00:05 JNLei