OpenHands
OpenHands copied to clipboard
Add docker compose
Removes the need for having a locally installed python and node and instead leverages docker compose.
Builds off the good work done in https://github.com/OpenDevin/OpenDevin/pull/377 however is cleaner and simpler.
Hi @spuder,
I tried your changes, error :
WARN[0000] /home/kurtisone/OpenDevin/compose.yaml: version is obsolete
service "frontend" depends on undefined service "devin-backend": invalid compose project
links command is deprecated
Remove those two lines from compose.yaml :
21: links: 22: - devin-backend:backend
Source : https://docs.docker.com/network/links/
And docker compose works !
Thanks for testing @Kurtisone
I've made some more changes and that issue should be fixed.
I'm still finding one issue when I try and send a message in the terminal.
Failed to start container: 500 Server Error for http+docker://localhost/v1.41/containers/create?name=sandbox-default: Internal Server Error ("make cli opts(): making volume mountpoint for volume /workspace4: mkdir /workspace4: operation not permitted")
Once I have that fixed this should largly be ready.
I tried to get my host IP and not the container to work with from daily, thank you for your contribution !
@spuder I believe you would need to start the backend image from a docker base image and install python, to achieve docker in docker.
Also, as Pipfile already specifies uvicorn as a dependency, you should not need to build the image from tiangolo/uvicorn-gunicorn:python3.11-slim
I just hardcoded my host IP and it works.
But I always got this error :
ERROR: Failed connection to server. Please ensure the server is reachable at ws://192.168.1.42:3001/ws.
Before I tried your docker, it was on port 3000, maybe it was llama.cpp server's fault
ERROR: Failed connection to server. Please ensure the server is reachable at ws://192.168.1.42:3001/ws.
This is normal because the frontend starts before the backend (despite the depends_on line). After a few seconds refresh the page and it will work.
The frontend is on 3001, whereas the backend is on 3000.
This looks like a good DOOD setup!
IMO we'll want to move to DIND at some point for safety (e.g. hosting OpenDevin in a multi-tenant scenario, like on a kubernetes cluster). But DOOD probably works well for now.
I'll give this a shot soon and see how it works
This looks like a good DOOD setup!
IMO we'll want to move to DIND at some point for safety (e.g. hosting OpenDevin in a multi-tenant scenario, like on a kubernetes cluster). But DOOD probably works well for now.
I'll give this a shot soon and see how it works
Are you sure about DIND ? Too many security concerns
Worth discussing DIND vs DOOD. But IIUC running a privileged DIND container is probably safer than a DOOD container. Need to research a bit more.
@spuder do you want to open this PR as ready for review?
Check out our Makefile syntax for building images: https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/sandbox/Makefile
I think just adding that alongside a Dockerfile will cause it to get built and pushed
@rbren
do you want to open this PR as ready for review?
Yes, I still need to solve an issue. While I'm able to get the containers to start, I get an error. Once I figure that out I'll mark as ready for review.
ERROR: Failed connection to server. Please ensure the server is reachable at ws://192.168.1.42:3001/ws.
This is normal because the frontend starts before the backend (despite the
depends_online). After a few seconds refresh the page and it will work.The frontend is on 3001, whereas the backend is on 3000.
Same error even if I wait a few minutes
Attaching to devin-backend, devin-frontend
devin-frontend |
devin-frontend | > [email protected] start
devin-frontend | > vite --host 0.0.0.0
devin-frontend |
devin-frontend |
devin-frontend | VITE v5.2.7 ready in 526 ms
devin-frontend |
devin-frontend | β Local: http://localhost:3001/
devin-frontend | β Network: http://172.19.0.3:3001/
devin-frontend | 10:32:13 AM [vite] ws proxy error:
devin-frontend | AggregateError [ECONNREFUSED]:
devin-frontend | at internalConnectMultiple (node:net:1116:18)
devin-frontend | at afterConnectMultiple (node:net:1683:7)
devin-frontend | 10:32:13 AM [vite] http proxy error: /litellm-models
devin-frontend | AggregateError [ECONNREFUSED]:
devin-frontend | at internalConnectMultiple (node:net:1116:18)
devin-frontend | at afterConnectMultiple (node:net:1683:7)
devin-frontend | 10:32:13 AM [vite] http proxy error: /litellm-models
devin-frontend | AggregateError [ECONNREFUSED]:
devin-frontend | at internalConnectMultiple (node:net:1116:18)
devin-frontend | at afterConnectMultiple (node:net:1683:7)
devin-backend | INFO: Started server process [7]
devin-backend | INFO: Waiting for application startup.
devin-backend | INFO: Application startup complete.
devin-backend | INFO: Uvicorn running on http://0.0.0.0:3000 (Press CTRL+C to quit)
devin-frontend | 10:32:32 AM [vite] ws proxy error:
devin-frontend | AggregateError [ECONNREFUSED]:
devin-frontend | at internalConnectMultiple (node:net:1116:18)
devin-frontend | at afterConnectMultiple (node:net:1683:7)
devin-frontend | 10:32:32 AM [vite] http proxy error: /litellm-models
devin-frontend | AggregateError [ECONNREFUSED]:
devin-frontend | at internalConnectMultiple (node:net:1116:18)
devin-frontend | at afterConnectMultiple (node:net:1683:7)
devin-frontend | 10:32:32 AM [vite] http proxy error: /litellm-models
devin-frontend | AggregateError [ECONNREFUSED]:
devin-frontend | at internalConnectMultiple (node:net:1116:18)
devin-frontend | at afterConnectMultiple (node:net:1683:7)
devin-frontend | 10:32:35 AM [vite] ws proxy error:
Worth discussing DIND vs DOOD. But IIUC running a privileged DIND container is probably safer than a DOOD container. Need to research a bit more.
@spuder do you want to open this PR as ready for review?
Check out our Makefile syntax for building images: https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/sandbox/Makefile
I think just adding that alongside a Dockerfile will cause it to get built and pushed
And I understand the opposite, haha !
I will do the same, more research.
@Kurtisone your error might be because you are hitting 192.168.1.4 instead of 127.0.0.1.
You might open your browser developer tools and see if the console is reporting CORS errors. If so, then itβs likely related to the server only supporting 127.0.0.1:
see https://github.com/OpenDevin/OpenDevin/pull/481#discussion_r1546736533
app.add_middleware( CORSMiddleware, allow_origins=["http://localhost:3001"], allow_credentials=True, allow_methods=[""], allow_headers=[""], )
@spuder how are you feeling about the PR at this point? Ready for a review?
@spuder how are you feeling about the PR at this point? Ready for a review?
This was almost there, however I rebased against master and there were some breaking changes introduced. I need to fix those first.
-
Something changed with the way websockets are handled where using
localhost:3000forBACKEND_HOSTinvite.config.jsbreaks the websocket connection. I'm able to work around it by modifying my /etc/hosts and changingBACKEND_HOSTto the docker internal name and comment out the test, but I want a more durable solution. Working on that now. -
npm caching issue. About 50% of the times I build there are problems with node modules installing properly. (Only seems to affect my intel mac, not my M1 macbook π€ ).
Got this when I try to compose :
[+] Running 2/0
! frontend Warning Get "http://localhost/v2/": dial tcp [::1]:80: connect: connection refused
! backend Warning Get "http://localhost/v2/": dial tcp [::1]:80: connect: connection refused
EDIT : Nvm, I'm stupid. Totally normal at first launch.
But I got this :
Attaching to devin-backend, devin-frontend
devin-frontend |
devin-frontend | > [email protected] start
devin-frontend | > vite --host 0.0.0.0
devin-frontend |
devin-backend | Traceback (most recent call last):
devin-backend | File "/usr/src/app/.venv/bin/uvicorn", line 8, in <module>
devin-backend | sys.exit(main())
devin-backend | ^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
devin-backend | return self.main(*args, **kwargs)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
devin-backend | rv = self.invoke(ctx)
devin-backend | ^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
devin-backend | return ctx.invoke(self.callback, **ctx.params)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
devin-backend | return __callback(*args, **kwargs)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/main.py", line 409, in main
devin-backend | run(
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/main.py", line 575, in run
devin-backend | server.run()
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
devin-backend | return asyncio.run(self.serve(sockets=sockets))
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
devin-backend | return runner.run(main)
devin-backend | ^^^^^^^^^^^^^^^^
devin-backend | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
devin-backend | return self._loop.run_until_complete(task)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
devin-backend | await self._serve(sockets)
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
devin-backend | config.load()
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/config.py", line 433, in load
devin-backend | self.loaded_app = import_from_string(self.app)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
devin-backend | module = importlib.import_module(module_str)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
devin-backend | return _bootstrap._gcd_import(name[level:], package, level)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
devin-backend | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
devin-backend | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
devin-backend | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
devin-backend | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
devin-backend | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
devin-backend | File "/usr/src/app/opendevin/server/listen.py", line 1, in <module>
devin-backend | from opendevin.server.session import Session
devin-backend | File "/usr/src/app/opendevin/server/session.py", line 7, in <module>
devin-backend | from opendevin import config
devin-backend | File "/usr/src/app/opendevin/config.py", line 25, in <module>
devin-backend | with open("config.toml", "rb") as f:
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | IsADirectoryError: [Errno 21] Is a directory: 'config.toml'
devin-frontend |
devin-frontend | VITE v5.2.7 ready in 331 ms
devin-frontend |
devin-frontend | β Local: http://localhost:3001/
devin-frontend | β Network: http://172.19.0.3:3001/
devin-backend exited with code 1
If I add the config.toml from the Dockerfile I got another error :
devin-backend | Traceback (most recent call last):
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/torch/__init__.py", line 176, in _load_global_deps
devin-backend | ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
devin-backend | File "/usr/local/lib/python3.11/ctypes/__init__.py", line 376, in __init__
devin-backend | self._handle = _dlopen(self._name, mode)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | OSError: libcudart.so.12: cannot open shared object file: No such file or directory
devin-backend |
devin-backend | During handling of the above exception, another exception occurred:
devin-backend |
devin-backend | Traceback (most recent call last):
devin-backend | File "/usr/src/app/.venv/bin/uvicorn", line 8, in <module>
devin-backend | sys.exit(main())
devin-backend | ^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
devin-backend | return self.main(*args, **kwargs)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
devin-backend | rv = self.invoke(ctx)
devin-backend | ^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
devin-backend | return ctx.invoke(self.callback, **ctx.params)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
devin-backend | return __callback(*args, **kwargs)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/main.py", line 409, in main
devin-backend | run(
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/main.py", line 575, in run
devin-backend | server.run()
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
devin-backend | return asyncio.run(self.serve(sockets=sockets))
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
devin-backend | return runner.run(main)
devin-backend | ^^^^^^^^^^^^^^^^
devin-backend | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
devin-backend | return self._loop.run_until_complete(task)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
devin-backend | await self._serve(sockets)
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
devin-backend | config.load()
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/config.py", line 433, in load
devin-backend | self.loaded_app = import_from_string(self.app)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
devin-backend | module = importlib.import_module(module_str)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
devin-backend | return _bootstrap._gcd_import(name[level:], package, level)
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
devin-backend | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
devin-backend | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
devin-backend | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
devin-backend | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
devin-backend | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
devin-backend | File "/usr/src/app/opendevin/server/listen.py", line 4, in <module>
devin-backend | import agenthub # noqa F401 (we import this to get the agents registered)
devin-backend | ^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/agenthub/__init__.py", line 5, in <module>
devin-backend | from . import monologue_agent # noqa: E402
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/agenthub/monologue_agent/__init__.py", line 2, in <module>
devin-backend | from .agent import MonologueAgent
devin-backend | File "/usr/src/app/agenthub/monologue_agent/agent.py", line 28, in <module>
devin-backend | from agenthub.monologue_agent.utils.memory import LongTermMemory
devin-backend | File "/usr/src/app/agenthub/monologue_agent/utils/memory.py", line 2, in <module>
devin-backend | from llama_index.core import Document
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/core/__init__.py", line 19, in <module>
devin-backend | from llama_index.core.indices import (
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/core/indices/__init__.py", line 4, in <module>
devin-backend | from llama_index.core.indices.composability.graph import ComposableGraph
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/core/indices/composability/__init__.py", line 4, in <module>
devin-backend | from llama_index.core.indices.composability.graph import ComposableGraph
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/core/indices/composability/graph.py", line 7, in <module>
devin-backend | from llama_index.core.indices.base import BaseIndex
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/core/indices/base.py", line 12, in <module>
devin-backend | from llama_index.core.ingestion import run_transformations
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/core/ingestion/__init__.py", line 2, in <module>
devin-backend | from llama_index.core.ingestion.pipeline import (
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/core/ingestion/pipeline.py", line 31, in <module>
devin-backend | from llama_index.core.ingestion.api_utils import get_client
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/core/ingestion/api_utils.py", line 23, in <module>
devin-backend | from llama_index.core.ingestion.transformations import (
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/core/ingestion/transformations.py", line 267, in <module>
devin-backend | ConfigurableTransformations = build_configurable_transformation_enum()
devin-backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/core/ingestion/transformations.py", line 247, in build_configurable_transformation_enum
devin-backend | from llama_index.embeddings.huggingface import (
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/embeddings/huggingface/__init__.py", line 1, in <module>
devin-backend | from llama_index.embeddings.huggingface.base import (
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/llama_index/embeddings/huggingface/base.py", line 27, in <module>
devin-backend | from sentence_transformers import SentenceTransformer
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/sentence_transformers/__init__.py", line 3, in <module>
devin-backend | from .datasets import SentencesDataset, ParallelSentencesDataset
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/sentence_transformers/datasets/__init__.py", line 1, in <module>
devin-backend | from .DenoisingAutoEncoderDataset import DenoisingAutoEncoderDataset
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/sentence_transformers/datasets/DenoisingAutoEncoderDataset.py", line 1, in <module>
devin-backend | from torch.utils.data import Dataset
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/torch/__init__.py", line 236, in <module>
devin-backend | _load_global_deps()
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/torch/__init__.py", line 197, in _load_global_deps
devin-backend | _preload_cuda_deps(lib_folder, lib_name)
devin-backend | File "/usr/src/app/.venv/lib/python3.11/site-packages/torch/__init__.py", line 162, in _preload_cuda_deps
devin-backend | raise ValueError(f"{lib_name} not found in the system path {sys.path}")
devin-backend | ValueError: libcublas.so.*[0-9] not found in the system path ['', '/usr/src/app/.venv/bin', '/usr/local/lib/python311.zip', '/usr/local/lib/python3.11', '/usr/local/lib/python3.11/lib-dynload', '/usr/src/app/.venv/lib/python3.11/site-packages', '/usr/src/app']
devin-backend exited with code 1
@Kurtisone Thanks for the feedback. I too was seeing the same error last night. Could you pull the latest changes and try again?
I'm down to 1 remaining bug and I could use help isolating if it is just my workstation (podman 5.0.0) or if it is a problem with the compose.
I find after doing a podman compose up, that everything appears to work, however when actually sending devin the first prompt, it fails with this error in the logs:
devin-backend | Failed to start container: 500 Server Error for http+docker://localhost/v1.41/containers/create?name=sandbox-default: Internal Server Error ("make cli opts(): making volume mountpoint for volume /usr/src/app/workspace: mkdir /usr/src/app: read-only file system")
@spuder Already done, I tried to change your Dockerfile (backend) and compose.yaml.
If it's work, I'll do a PR to your repo
Sadly this will probably have to change a bit for the new Poetry dependency mgmt, but hopefully not too hard
Not a problem. Pipenv is a bit finicky, I'll refactor for poetry.
I believe I have this working with poetry, ~however I'm currently blocked by the pymupdfb issue~. https://github.com/OpenDevin/OpenDevin/issues/791
Last remaining issue is a permission problem
devin-backend | INFO: 10.89.0.90:46274 - "GET /messages/total HTTP/1.1" 200 OK
devin-backend | DEBUG: < TEXT '{"action":"initialize","args":{"model":"gpt-3.5...ectory":"./workspace"}}' [116 bytes]
devin-backend | DEBUG: > TEXT '{"error":true,"message":"Error creating control...ng using `docker ps`."}' [103 bytes]
devin-backend | Failed to start container: 500 Server Error for http+docker://localhost/v1.41/containers/create?name=sandbox-de5ffae6-e77f-470b-9c4b-cfb6923f4616: Internal Server Error ("make cli opts(): making volume mountpoint for volume /usr/src/app/workspace: mkdir /usr/src/app: read-only file system")
@rbren Docker compose is ready for review
@spuder I might be doing something wrong, but I get this error:
β docker compose run frontend backend
node:internal/modules/cjs/loader:1145
throw err;
^
Error: Cannot find module '/usr/src/app/backend'
at Module._resolveFilename (node:internal/modules/cjs/loader:1142:15)
at Module._load (node:internal/modules/cjs/loader:983:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v21.7.2
Pretty sure I have the command wrong. But I tried
docker compose run backend
and sadly hit the old pymupdf problem. I'm on Ubuntu ARM
422.4 - Installing uvicorn (0.29.0)
954.3
954.3 ChefBuildError
954.3
954.3 Backend subprocess exited when trying to invoke build_wheel
954.3
954.3 PyMuPDF-1.24.1/setup.py: ### Starting.
954.3 PyMuPDF-1.24.1/setup.py: __name__: 'setup'
954.3 PyMuPDF-1.24.1/setup.py: platform.platform(): 'Linux-6.6.16-linuxkit-aarch64-with-glibc2.36'
954.3 PyMuPDF-1.24.1/setup.py: platform.python_version(): '3.11.9'
954.3 PyMuPDF-1.24.1/setup.py: sys.executable: '/tmp/tmprofwyl0t/.venv/bin/python'
954.3 PyMuPDF-1.24.1/setup.py: CPU bits: 64 sys.maxsize=9223372036854775807
954.3 PyMuPDF-1.24.1/setup.py: __file__: '/tmp/tmpn4y0tr_8/PyMuPDF-1.24.1/setup.py'
954.3 PyMuPDF-1.24.1/setup.py: os.getcwd(): '/tmp/tmpn4y0tr_8/PyMuPDF-1.24.1'
954.3 PyMuPDF-1.24.1/setup.py: sys.argv (3):
954.3 PyMuPDF-1.24.1/setup.py: 0: '/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py'
954.3 PyMuPDF-1.24.1/setup.py: 1: 'build_wheel'
954.3 PyMuPDF-1.24.1/setup.py: 2: '/tmp/tmprimjm3sf'
954.3 PyMuPDF-1.24.1/setup.py: os.environ (14):
954.3 PyMuPDF-1.24.1/setup.py: GPG_KEY: 'A035C8C19219BA821ECEA86B64E628F8D684696D'
954.3 PyMuPDF-1.24.1/setup.py: HOME: '/root'
954.3 PyMuPDF-1.24.1/setup.py: LANG: 'C.UTF-8'
954.3 PyMuPDF-1.24.1/setup.py: PATH: '/tmp/tmprofwyl0t/.venv/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
954.3 PyMuPDF-1.24.1/setup.py: PEP517_BACKEND_PATH: '/tmp/tmpn4y0tr_8/PyMuPDF-1.24.1'
954.3 PyMuPDF-1.24.1/setup.py: PEP517_BUILD_BACKEND: 'setup'
954.3 PyMuPDF-1.24.1/setup.py: PIP_REQUESTS_TIMEOUT: '100'
954.3 PyMuPDF-1.24.1/setup.py: POETRY_REQUESTS_TIMEOUT: '100'
954.3 PyMuPDF-1.24.1/setup.py: PWD: '/usr/src/app'
954.3 PyMuPDF-1.24.1/setup.py: PYTHON_GET_PIP_SHA256: 'dfe9fd5c28dc98b5ac17979a953ea550cec37ae1b47a5116007395bfacff2ab9'
954.3 PyMuPDF-1.24.1/setup.py: PYTHON_GET_PIP_URL: 'https://github.com/pypa/get-pip/raw/dbf0c85f76fb6e1ab42aa672ffca6f0a675d9ee4/public/get-pip.py'
954.3 PyMuPDF-1.24.1/setup.py: PYTHON_PIP_VERSION: '24.0'
954.3 PyMuPDF-1.24.1/setup.py: PYTHON_SETUPTOOLS_VERSION: '65.5.1'
954.3 PyMuPDF-1.24.1/setup.py: PYTHON_VERSION: '3.11.9'
954.3 pipcl.py: build_wheel(): wheel_directory='/root/.cache/pypoetry/artifacts/d0/66/87/d9cc62435a3fa54160fcfcee6650e1184db01eb8e2ec137b6dc362c94e' config_settings=None metadata_directory=None
954.3 pipcl.py: _call_fn_build(): calling self.fn_build=<function build at 0xffff93746660>
954.3 PyMuPDF-1.24.1/setup.py: get_mupdf_internal(): out='dir' location=None sha=None
954.3 PyMuPDF-1.24.1/setup.py: Download location='https://mupdf.com/downloads/archive/mupdf-1.24.1-source.tar.gz' local_tgz='mupdf-1.24.1-source.tar.gz' name='mupdf-1.24.1-source'
954.3 PyMuPDF-1.24.1/setup.py: Downloading from location='https://mupdf.com/downloads/archive/mupdf-1.24.1-source.tar.gz' to local_tgz='mupdf-1.24.1-source.tar.gz'.
954.3 Traceback (most recent call last):
954.3 File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
954.3 main()
954.3 File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
954.3 json_out['return_val'] = hook(**hook_input['kwargs'])
954.3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
954.3 File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
954.3 return _build_backend().build_wheel(wheel_directory, config_settings,
954.3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
954.3 File "/tmp/tmpn4y0tr_8/PyMuPDF-1.24.1/pipcl.py", line 642, in build_wheel
954.3 items = self._call_fn_build(config_settings)
954.3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
954.3 File "/tmp/tmpn4y0tr_8/PyMuPDF-1.24.1/pipcl.py", line 804, in _call_fn_build
954.3 ret = self.fn_build()
954.3 ^^^^^^^^^^^^^^^
954.3 File "/tmp/tmpn4y0tr_8/PyMuPDF-1.24.1/setup.py", line 513, in build
954.3 mupdf_local = get_mupdf()
954.3 ^^^^^^^^^^^
954.3 File "/tmp/tmpn4y0tr_8/PyMuPDF-1.24.1/setup.py", line 490, in get_mupdf
954.3 return get_mupdf_internal('dir', m)
954.3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
954.3 File "/tmp/tmpn4y0tr_8/PyMuPDF-1.24.1/setup.py", line 428, in get_mupdf_internal
954.3 urllib.request.urlretrieve( location, local_tgz)
954.3 File "/usr/local/lib/python3.11/urllib/request.py", line 280, in urlretrieve
954.3 raise ContentTooShortError(
954.3 urllib.error.ContentTooShortError: <urlopen error retrieval incomplete: got only 21759913 out of 55310618 bytes>
954.3
954.3
954.3 at /usr/local/lib/python3.11/site-packages/poetry/installation/chef.py:164 in _prepare
954.3 160β
954.3 161β error = ChefBuildError("\n\n".join(message_parts))
954.3 162β
954.3 163β if error is not None:
954.3 β 164β raise error from None
954.3 165β
954.3 166β return path
954.3 167β
954.3 168β def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
954.3
954.3 Note: This error originates from the build backend, and is likely not a problem with poetry but with pymupdf (1.24.1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pymupdf (==1.24.1)"'.
954.3
------
failed to solve: process "/bin/sh -c poetry install --without evaluation" did not complete successfully: exit code: 1
Seems like a download timeout...did it take longer than the 100s timeout set for poetry?
954.3 urllib.error.ContentTooShortError: <urlopen error retrieval incomplete: got only 21759913 out of 55310618 bytes>
docker compose up
Or
docker compose up --build
As far as timeouts, I did see those occasionally. The nvidia stuff has to compile and it will fail if running in a vm with only 2gb of ram. I haven't seen that happen since I increased the size of the docker machine vm
I took a slightly different approach and jammed frontend and backend in one container. If anyone has a minute or two to try it out, I'd appreciate feedback.
See here: https://github.com/OpenDevin/OpenDevin/issues/110#issuecomment-2041299595