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

[v0.0.7] Unable to get started #24

Closed
Moep90 opened this issue Sep 5, 2023 · 7 comments
Closed

[v0.0.7] Unable to get started #24

Moep90 opened this issue Sep 5, 2023 · 7 comments

Comments

@Moep90
Copy link

Moep90 commented Sep 5, 2023

Describe the bug
I encounterer several errors when starting the v.0.0.7 initially without changing anything besides the paths of my docker-compose volumes.

NOTE
I assume this might cause the issue. I ran this on a server VM which may or may not have all devices required for this tool to run.

To Reproduce

wget https://github.com/trypromptly/LLMStack/archive/refs/tags/v0.0.7.zip
unzip v0.0.7.zip
cd LLMStack-0.0.7/
cp .env.prod .env
./run-llmstack.sh

.env file

# Change the secrets below before running LLMStack
SECRET_KEY='3!4^11rgx0-53)!n#18(1_^)&pj-3n^Afpc#mbm(+!fj4r$rp7ea!s'
CIPHER_KEY_SALT=salt
DATABASE_PASSWORD=llmstack

# Update the location of the persistent volumes to non-temporary locations
POSTGRES_VOLUME=./data/postgres_llmstack
REDIS_VOLUME=./data/redis_llmstack
WEAVIATE_VOLUME=./data/weaviate_llmstack

# LLMStack port
LLMSTACK_PORT=3000

# Platform default keys (optional)
DEFAULT_OPENAI_API_KEY=
DEFAULT_DREAMSTUDIO_API_KEY=
DEFAULT_AZURE_OPENAI_API_KEY=
DEFAULT_COHERE_API_KEY=
DEFAULT_FOREFRONTAI_API_KEY=
DEFAULT_ELEVENLABS_APiI_KEY=

Expected behavior
LLM Stack should start without having errors.

Version
v0.0.7

Environment
PRETTY_NAME="Ubuntu 22.04.3 LTS"
Docker version 20.10.7, build f0df350
Docker Compose version v2.20.3

Screenshots

Additional context
I used ./data so I could easiely reset my setup with rm -rf ./data


I had to add OPENBLAS_NUM_THREADS=1 as I encountered

llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 1 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 2 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 3 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 4 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 5 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 6 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 7 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 8 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 9 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 10 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 11 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 12 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 13 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 14 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 15 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 16 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 17 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 18 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 19 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 20 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 21 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 22 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 23 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 24 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 25 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 26 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 27 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 28 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 29 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 30 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 31 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 32 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 33 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 34 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 35 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 36 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 37 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 38 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: pthread_create failed for thread 39 of 40: Operation not permitted
llmstack-007-rqworker-1    | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-rqworker-1    | Traceback (most recent call last):
llmstack-007-rqworker-1    |   File "/code/manage.py", line 22, in <module>
llmstack-007-rqworker-1    |     main()
llmstack-007-rqworker-1    |   File "/code/manage.py", line 18, in main
llmstack-007-rqworker-1    |     execute_from_command_line(sys.argv)
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
llmstack-007-rqworker-1    |     utility.execute()
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
llmstack-007-rqworker-1    |     django.setup()
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
llmstack-007-rqworker-1    |     apps.populate(settings.INSTALLED_APPS)
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/django/apps/registry.py", line 91, in populate
llmstack-007-rqworker-1    |     app_config = AppConfig.create(entry)
llmstack-007-rqworker-1    |                  ^^^^^^^^^^^^^^^^^^^^^^^
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/django/apps/config.py", line 111, in create
llmstack-007-rqworker-1    |     app_module = import_module(entry)
llmstack-007-rqworker-1    |                  ^^^^^^^^^^^^^^^^^^^^
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
llmstack-007-rqworker-1    |     return _bootstrap._gcd_import(name[level:], package, level)
llmstack-007-rqworker-1    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
llmstack-007-rqworker-1    |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
llmstack-007-rqworker-1    |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
llmstack-007-rqworker-1    |   File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
llmstack-007-rqworker-1    |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
llmstack-007-rqworker-1    |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
llmstack-007-rqworker-1    |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
llmstack-007-rqworker-1    |   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
llmstack-007-rqworker-1    |   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
llmstack-007-rqworker-1    |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
llmstack-007-rqworker-1    |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
llmstack-007-rqworker-1    |   File "/code/processors/apps.py", line 7, in <module>
llmstack-007-rqworker-1    |     from .providers.api_processor_interface import ApiProcessorInterface
llmstack-007-rqworker-1    |   File "/code/processors/providers/api_processor_interface.py", line 11, in <module>
llmstack-007-rqworker-1    |     from common.utils.utils import hydrate_input
llmstack-007-rqworker-1    |   File "/code/common/utils/utils.py", line 16, in <module>
llmstack-007-rqworker-1    |     from common.utils.crawlers import run_sitemap_spider_in_process
llmstack-007-rqworker-1    |   File "/code/common/utils/crawlers.py", line 13, in <module>
llmstack-007-rqworker-1    |     from unstructured.partition.auto import partition_html
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/unstructured/partition/auto.py", line 16, in <module>
llmstack-007-rqworker-1    |     from unstructured.partition.email import partition_email
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/unstructured/partition/email.py", line 54, in <module>
llmstack-007-rqworker-1    |     from unstructured.partition.html import partition_html
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/unstructured/partition/html.py", line 6, in <module>
llmstack-007-rqworker-1    |     from unstructured.documents.html import HTMLDocument
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/unstructured/documents/html.py", line 24, in <module>
llmstack-007-rqworker-1    |     from unstructured.documents.xml import VALID_PARSERS, XMLDocument
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/unstructured/documents/xml.py", line 8, in <module>
llmstack-007-rqworker-1    |     from unstructured.partition.text import (
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/unstructured/partition/text.py", line 20, in <module>
llmstack-007-rqworker-1    |     from unstructured.nlp.tokenize import sent_tokenize
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/unstructured/nlp/tokenize.py", line 10, in <module>
llmstack-007-rqworker-1    |     import nltk
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/nltk/__init__.py", line 133, in <module>
llmstack-007-rqworker-1    |     from nltk.collocations import *
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/nltk/collocations.py", line 36, in <module>
llmstack-007-rqworker-1    |     from nltk.metrics import (
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/nltk/metrics/__init__.py", line 17, in <module>
llmstack-007-rqworker-1    |     from nltk.metrics.aline import align
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/nltk/metrics/aline.py", line 41, in <module>
llmstack-007-rqworker-1    |     import numpy as np
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/numpy/__init__.py", line 139, in <module>
llmstack-007-rqworker-1    |     from . import core
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/numpy/core/__init__.py", line 23, in <module>
llmstack-007-rqworker-1    |     from . import multiarray
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/numpy/core/multiarray.py", line 10, in <module>
llmstack-007-rqworker-1    |     from . import overrides
llmstack-007-rqworker-1    |   File "/usr/local/lib/python3.11/site-packages/numpy/core/overrides.py", line 8, in <module>
llmstack-007-rqworker-1    |     from numpy.core._multiarray_umath import (
llmstack-007-rqworker-1    |   File "<frozen importlib._bootstrap>", line 216, in _lock_unlock_module
llmstack-007-rqworker-1    | KeyboardInterrupt

After that, it seams to get further but dies at:

llmstack-007-api-1         | [2023-09-05 05:58:06 +0000] [29] [ERROR] Exception in ASGI application
llmstack-007-api-1         | Traceback (most recent call last):
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 436, in run_asgi
llmstack-007-api-1         |     result = await app(  # type: ignore[func-returns-value]
llmstack-007-api-1         |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
llmstack-007-api-1         |     return await self.app(scope, receive, send)
llmstack-007-api-1         |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/channels/routing.py", line 62, in __call__
llmstack-007-api-1         |     return await application(scope, receive, send)
llmstack-007-api-1         |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/asgi.py", line 160, in __call__
llmstack-007-api-1         |     await self.handle(scope, receive, send)
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/asgi.py", line 173, in handle
llmstack-007-api-1         |     await sync_to_async(signals.request_started.send, thread_sensitive=True)(
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/asgiref/sync.py", line 436, in __call__
llmstack-007-api-1         |     future = loop.run_in_executor(
llmstack-007-api-1         |              ^^^^^^^^^^^^^^^^^^^^^
llmstack-007-api-1         |   File "uvloop/loop.pyx", line 2729, in uvloop.loop.Loop.run_in_executor
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 176, in submit
llmstack-007-api-1         |     self._adjust_thread_count()
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 199, in _adjust_thread_count
llmstack-007-api-1         |     t.start()
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/threading.py", line 957, in start
llmstack-007-api-1         |     _start_new_thread(self._bootstrap, ())
llmstack-007-api-1         | RuntimeError: can't start new thread
@vignesh-makerdojo
Copy link
Contributor

@Moep90 are you still seeing this issue ? What is the per process thread limit on your VM ?

@Moep90
Copy link
Author

Moep90 commented Sep 6, 2023

@vignesh-makerdojo Yeah its still the same error on the VM.
However it starts on my laptop (equal ulimits and threads-max) but its not powerfull enough to make this service available to the team.

$ cat /proc/sys/kernel/threads-max
2061725
$ ulimit -a
real-time non-blocking time  (microseconds, -R) unlimited
core file size              (blocks, -c) 0
data seg size               (kbytes, -d) unlimited
scheduling priority                 (-e) 0
file size                   (blocks, -f) unlimited
pending signals                     (-i) 1030862
max locked memory           (kbytes, -l) 33002112
max memory size             (kbytes, -m) unlimited
open files                          (-n) 8192
pipe size                (512 bytes, -p) 8
POSIX message queues         (bytes, -q) 819200
real-time priority                  (-r) 0
stack size                  (kbytes, -s) 8192
cpu time                   (seconds, -t) unlimited
max user processes                  (-u) 1030862
virtual memory              (kbytes, -v) unlimited
file locks                          (-x) unlimited

@ajhai
Copy link
Contributor

ajhai commented Sep 6, 2023

@Moep90 did you try setting OPENBLAS_NUM_THREADS to a higher value than 1? We start 6 worker threads in gunicorn. So maybe try setting it to a value > 6 and try.

@Moep90
Copy link
Author

Moep90 commented Sep 6, 2023

@ajhai higher values then 1 cause the following:

lmstack-007-api-1         | postgres:5432 - accepting connections
llmstack-007-api-1         | Postgres is up - continuing
llmstack-007-api-1         | Starting API server
llmstack-007-api-1         | OpenBLAS blas_thread_init: pthread_create failed for thread 1 of 6: Operation not permitted
llmstack-007-api-1         | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-api-1         | OpenBLAS blas_thread_init: pthread_create failed for thread 2 of 6: Operation not permitted
llmstack-007-api-1         | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-api-1         | OpenBLAS blas_thread_init: pthread_create failed for thread 3 of 6: Operation not permitted
llmstack-007-api-1         | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-api-1         | OpenBLAS blas_thread_init: pthread_create failed for thread 4 of 6: Operation not permitted
llmstack-007-api-1         | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-api-1         | OpenBLAS blas_thread_init: pthread_create failed for thread 5 of 6: Operation not permitted
llmstack-007-api-1         | OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
llmstack-007-api-1         | Traceback (most recent call last):
llmstack-007-api-1         |   File "/code/manage.py", line 22, in <module>
llmstack-007-api-1         |     main()
llmstack-007-api-1         |   File "/code/manage.py", line 18, in main
llmstack-007-api-1         |     execute_from_command_line(sys.argv)
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
llmstack-007-api-1         |     utility.execute()
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
llmstack-007-api-1         |     django.setup()
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
llmstack-007-api-1         |     apps.populate(settings.INSTALLED_APPS)
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/django/apps/registry.py", line 91, in populate
llmstack-007-api-1         |     app_config = AppConfig.create(entry)
llmstack-007-api-1         |                  ^^^^^^^^^^^^^^^^^^^^^^^
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/django/apps/config.py", line 111, in create
llmstack-007-api-1         |     app_module = import_module(entry)
llmstack-007-api-1         |                  ^^^^^^^^^^^^^^^^^^^^
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
llmstack-007-api-1         |     return _bootstrap._gcd_import(name[level:], package, level)
llmstack-007-api-1         |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
llmstack-007-api-1         |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
llmstack-007-api-1         |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
llmstack-007-api-1         |   File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
llmstack-007-api-1         |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
llmstack-007-api-1         |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
llmstack-007-api-1         |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
llmstack-007-api-1         |   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
llmstack-007-api-1         |   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
llmstack-007-api-1         |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
llmstack-007-api-1         |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
llmstack-007-api-1         |   File "/code/processors/apps.py", line 7, in <module>
llmstack-007-api-1         |     from .providers.api_processor_interface import ApiProcessorInterface
llmstack-007-api-1         |   File "/code/processors/providers/api_processor_interface.py", line 11, in <module>
llmstack-007-api-1         |     from common.utils.utils import hydrate_input
llmstack-007-api-1         |   File "/code/common/utils/utils.py", line 16, in <module>
llmstack-007-api-1         |     from common.utils.crawlers import run_sitemap_spider_in_process
llmstack-007-api-1         |   File "/code/common/utils/crawlers.py", line 13, in <module>
llmstack-007-api-1         |     from unstructured.partition.auto import partition_html
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/unstructured/partition/auto.py", line 16, in <module>
llmstack-007-api-1         |     from unstructured.partition.email import partition_email
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/unstructured/partition/email.py", line 54, in <module>
llmstack-007-api-1         |     from unstructured.partition.html import partition_html
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/unstructured/partition/html.py", line 6, in <module>
llmstack-007-api-1         |     from unstructured.documents.html import HTMLDocument
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/unstructured/documents/html.py", line 24, in <module>
llmstack-007-api-1         |     from unstructured.documents.xml import VALID_PARSERS, XMLDocument
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/unstructured/documents/xml.py", line 8, in <module>
llmstack-007-api-1         |     from unstructured.partition.text import (
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/unstructured/partition/text.py", line 20, in <module>
llmstack-007-api-1         |     from unstructured.nlp.tokenize import sent_tokenize
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/unstructured/nlp/tokenize.py", line 10, in <module>
llmstack-007-api-1         |     import nltk
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/nltk/__init__.py", line 133, in <module>
llmstack-007-api-1         |     from nltk.collocations import *
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/nltk/collocations.py", line 36, in <module>
llmstack-007-api-1         |     from nltk.metrics import (
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/nltk/metrics/__init__.py", line 17, in <module>
llmstack-007-api-1         |     from nltk.metrics.aline import align
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/nltk/metrics/aline.py", line 41, in <module>
llmstack-007-api-1         |     import numpy as np
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/numpy/__init__.py", line 139, in <module>
llmstack-007-api-1         |     from . import core
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/numpy/core/__init__.py", line 23, in <module>
llmstack-007-api-1         |     from . import multiarray
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/numpy/core/multiarray.py", line 10, in <module>
llmstack-007-api-1         |     from . import overrides
llmstack-007-api-1         |   File "/usr/local/lib/python3.11/site-packages/numpy/core/overrides.py", line 8, in <module>
llmstack-007-api-1         |     from numpy.core._multiarray_umath import (
llmstack-007-api-1         |   File "<frozen importlib._bootstrap>", line 216, in _lock_unlock_module
llmstack-007-api-1         | KeyboardInterrupt

@ajhai
Copy link
Contributor

ajhai commented Sep 6, 2023

Reading other similar issues around, it could be related to the docker version you are running. For example, some reported in DDMAL/Rodan#1032 that updating docker version fixed similar issue for them. Give it a shot maybe?

Edit: HumanSignal/label-studio#3070 (comment) error looks similar to yours

@ajhai
Copy link
Contributor

ajhai commented Sep 6, 2023

Other suggestion from the linked thread (HumanSignal/label-studio#3070 (comment)) is to add seccomp to docker-compose file. I think one of them should work.

@Moep90
Copy link
Author

Moep90 commented Sep 6, 2023

@ajhai good catch!

I can confirm to have it working by now on the Server VM.
Here are my working example, hope this helps for the future.
It also contains localAI

.env

 cat .env
# Change the secrets below before running LLMStack
SECRET_KEY='3!4^11rgx0-53)!n#18(1_^)&pj-3n^Afpc#mbm(+!fj4r$rp7ea!s'
CIPHER_KEY_SALT=salt
DATABASE_PASSWORD=llmstack

# Update the location of the persistent volumes to non-temporary locations
POSTGRES_VOLUME=./data/postgres_llmstack
REDIS_VOLUME=./data/redis_llmstack
WEAVIATE_VOLUME=./data/weaviate_llmstack

# LLMStack port
LLMSTACK_PORT=3000

# Platform default keys (optional)
DEFAULT_OPENAI_API_KEY=
DEFAULT_DREAMSTUDIO_API_KEY=
DEFAULT_AZURE_OPENAI_API_KEY=
DEFAULT_COHERE_API_KEY=
DEFAULT_FOREFRONTAI_API_KEY=
DEFAULT_ELEVENLABS_APiI_KEY=

OPENBLAS_NUM_THREADS=<number of cores>
ALLOWED_HOSTS="127.0.0.1,localhost,<server IP>"
PRELOAD_MODELS=[{"url": "github:go-skynet/model-gallery/gpt4all-j.yaml", "name": "gpt-3.5-turbo"}, { "url": "github:go-skynet/model-gallery/bert-embeddings.yaml", "name": "text-embedding-ada-002"}]

docker-compose.yml

version: "3.8"

services:
  api:
    image: ${REGISTRY:-ghcr.io/trypromptly/}llmstack-api:latest
    build:
      context: .
      cache_from:
        - llmstack-api:latest
    command: apiserver
    links:
      - postgres:postgres
    expose:
      - 9000
    env_file:
      - .env
    cap_add:
      - SYS_PTRACE
    security_opt:
      - seccomp:unconfined
  rqworker:
    image: ${REGISTRY:-ghcr.io/trypromptly/}llmstack-api:latest
    build:
      context: .
      cache_from:
        - llmstack-rqworker:latest
    command: rqworker
    depends_on:
      - redis
      - postgres
    links:
      - redis:redis
      - postgres:postgres
    env_file:
      - .env
    security_opt:
      - seccomp:unconfined
  nginx:
    image: ${REGISTRY:-ghcr.io/trypromptly/}llmstack-nginx:latest
    build:
      context: .
      dockerfile: Dockerfile.nginx
      cache_from:
        - llmstack-nginx:latest
      args:
        - REGISTRY=${REGISTRY:-ghcr.io/trypromptly/}
    ports:
      - ${LLMSTACK_PORT:-3000}:80
    env_file:
      - .env
    depends_on:
      - api
  playwright:
    image: ${REGISTRY:-ghcr.io/trypromptly/}llmstack-playwright:latest
    build:
      context: playwright
      dockerfile: Dockerfile
      cache_from:
        - llmstack-playwright:latest
    command: npx --yes playwright launch-server --browser chromium --config /config.json
    expose:
      - 30000
    ipc: host
    user: pwuser
    security_opt:
      - seccomp:playwright/seccomp_profile.json
  redis:
    image: redis:alpine
    command: redis-server
    restart: unless-stopped
    volumes:
      - ${REDIS_VOLUME}:/data
    env_file:
      - .env
  postgres:
    image: postgres:15.1-alpine
    command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
    restart: unless-stopped
    volumes:
      - ${POSTGRES_VOLUME}:/var/lib/postgresql/data/pgdata
    environment:
      POSTGRES_HOST_AUTH_METHOD: "password"
      PGDATA: /var/lib/postgresql/data/pgdata
      POSTGRES_USER: ${DATABASE_USERNAME:-llmstack}
      POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-llmstack}
    env_file:
      - .env
  weaviate:
    image: semitechnologies/weaviate:1.20.5
    volumes:
      - ${WEAVIATE_VOLUME}:/var/lib/weaviate
    environment:
      QUERY_DEFAULTS_LIMIT: 20
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: "true"
      PERSISTENCE_DATA_PATH: "/var/lib/weaviate"
      DEFAULT_VECTORIZER_MODULE: text2vec-openai
      ENABLE_MODULES: text2vec-openai
      CLUSTER_HOSTNAME: "weaviate-node"
    env_file:
      - .env
  local-api:
    image: quay.io/go-skynet/local-ai:v1.25.0
    container_name: local-ai.example.com
    ports:
      - 8080
    env_file:
      - .env
    environment:
      - DEBUG=true
      - MODELS_PATH=/models
      - THREADS=10
      - CONTEXT_SIZE=1024
    volumes:
      - ./models:/models:cached
    command: ["/usr/bin/local-ai"]

@Moep90 Moep90 closed this as completed Sep 6, 2023
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

No branches or pull requests

3 participants