harsh4870 / docker-ml-faq-rassa

Machine Learning FAQ model demo with rasa & Docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it still working?

zhanko73 opened this issue · comments

commented

Hi
I attempted to follow the instructions and it reported permission issues.
I checked rasa docker image and it appeared user 1001 is required for the /app directory as well as $(pwd).
Once I switched current directory to that other exceptions came up related to python.
I tried with the image you used and also the most recent one too.

Bellow is for the shell:
docker run -v $(pwd):/app :3.5.2 shell (extended with the right image name of course)

Example:

=================
FIRST I TRIED:
=================

opt/venv/lib/python3.10/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('ruamel.yaml').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
Warning: Input is not a terminal (fd=0).
2024-02-26 23:38:58 INFO root - copying /opt/venv/lib/python3.10/site-packages/rasa/cli/initial_project/actions/init.py -> ./actions
Welcome to Rasa! 🤖

To get started quickly, an initial project will be created.
If you need some help, check out the documentation at https://rasa.com/docs/rasa.

Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/setuptools/_distutils/file_util.py", line 33, in _copy_file_contents
os.unlink(dst)
PermissionError: [Errno 13] Permission denied: './actions/init.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/venv/bin/rasa", line 8, in
sys.exit(main())
File "/opt/venv/lib/python3.10/site-packages/rasa/main.py", line 127, in main
cmdline_arguments.func(cmdline_arguments)

===============
THEN LATER with most recent rasa:
===============

2024-02-27 00:09:55 ERROR asyncio - Task exception was never retrieved
future: <Task finished name='Task-6' coro=<SignalRouter._dispatch() done, defined at /opt/venv/lib/python3.10/site-packages/sanic/signals.py:121> exception=EOFError()>
Traceback (most recent call last):
File "uvloop/loop.pyx", line 775, in uvloop.loop.Loop._add_reader
KeyError: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/prompt_toolkit/input/vt100.py", line 173, in _attached_input
loop.add_reader(fd, callback_wrapper)
File "uvloop/loop.pyx", line 2441, in uvloop.loop.Loop.add_reader
File "uvloop/loop.pyx", line 777, in uvloop.loop.Loop._add_reader
File "uvloop/handles/poll.pyx", line 29, in uvloop.loop.UVPoll.new
File "uvloop/handles/poll.pyx", line 17, in uvloop.loop.UVPoll._init
PermissionError: [Errno 1] Operation not permitted

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/sanic/signals.py", line 161, in _dispatch
retval = await maybe_coroutine

@zhanko73 Hi there, thanks for reaching out.

i just tried cloning the repo as it is and ran it with Docker Compose it worked fine without any error. Opened localhost:8080 and got the output too.

Did you try with docker-compose ?

commented

At the end, yes I tried. Before I went through all commands but first road blocker is the access right of the direcotry where I'm. (I use linux.) My uid is not 1001, while inside the container the /app is owned by user 1001 and I saw a user in the image with uid 1001.
So what I run and works (at least it finish and I cannot see any error message except python warnings):
I entered the project directory where docker compose file etc. can be found. I changed access right to user 1001 and setup facl to my account just to be able get the same permission. I run docker without privileged option of course, so I use the following commands:
docker run -p 5005:5005 -v $(pwd):/app rasa/rasa:3.5.2 init --no-prompt
docker run -v $(pwd):/app rasa/rasa:3.5.2 train --domain domain.yml --data data --out models

From this point there is a problem as this command will never finish and in parallel the curl also will not work of course:
docker run -v $(pwd):/app rasa/rasa:3.5.2 shell

I get these:
_docker-ml-faq-rassa]$ docker run -v $(pwd):/app rasa/rasa:3.5.2 shell
/opt/venv/lib/python3.10/site-packages/rasa/core/tracker_store.py:1046: MovedIn20Warning: Deprecated API features detected! These feature(s) are not compatible with SQLAlchemy 2.0. To prevent incompatible upgrades prior to updating applications, ensure requirements files are pinned to "sqlalchemy<2.0". Set environment variable SQLALCHEMY_WARN_20=1 to show all deprecation warnings. Set environment variable SQLALCHEMY_SILENCE_UBER_WARNING=1 to silence this message. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
Base: DeclarativeMeta = declarative_base()
/opt/venv/lib/python3.10/site-packages/pkg_resources/init.py:121: DeprecationWarning: pkg_resources is deprecated as an API
warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
/opt/venv/lib/python3.10/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
/opt/venv/lib/python3.10/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
/opt/venv/lib/python3.10/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('ruamel').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
/opt/venv/lib/python3.10/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('ruamel.yaml').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
/opt/venv/lib/python3.10/site-packages/tensorflow/python/framework/dtypes.py:246: DeprecationWarning: np.bool8 is a deprecated alias for np.bool_. (Deprecated NumPy 1.24)
np.bool8: (False, True),
/opt/venv/lib/python3.10/site-packages/sanic_cors/extension.py:39: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
SANIC_VERSION = LooseVersion(sanic_version)
2024-02-27 19:51:53 INFO root - Connecting to channel 'cmdline' which was specified by the '--connector' argument. Any other channels will be ignored. To connect to all given channels, omit the '--connector' argument.
2024-02-27 19:51:53 INFO root - Starting Rasa server on http://0.0.0.0:5005
2024-02-27 19:51:54 INFO rasa.core.processor - Loading model models/20240227-195125-obvious-design.tar.gz...
2024-02-27 19:52:15 WARNING rasa.shared.utils.common - The UnexpecTED Intent Policy is currently experimental and might change or be removed in the future 🔬 Please share your feedback on it in the forum (https://forum.rasa.com) to help us make this feature ready for production.
2024-02-27 19:52:24 INFO root - Rasa server is up and running.
Warning: Input is not a terminal (fd=0).
Bot loaded. Type a message and press enter (use '/stop' to exit):
2024-02-27 19:52:26 ERROR asyncio - Task exception was never retrieved
future: <Task finished name='Task-6' coro=<SignalRouter._dispatch() done, defined at /opt/venv/lib/python3.10/site-packages/sanic/signals.py:121> exception=EOFError()>
Traceback (most recent call last):
File "uvloop/loop.pyx", line 775, in uvloop.loop.Loop._add_reader
KeyError: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/prompt_toolkit/input/vt100.py", line 173, in _attached_input
loop.add_reader(fd, callback_wrapper)
File "uvloop/loop.pyx", line 2441, in uvloop.loop.Loop.add_reader
File "uvloop/loop.pyx", line 777, in uvloop.loop.Loop._add_reader
File "uvloop/handles/poll.pyx", line 29, in uvloop.loop.UVPoll.new
File "uvloop/handles/poll.pyx", line 17, in uvloop.loop.UVPoll._init
PermissionError: [Errno 1] Operation not permitted

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/sanic/signals.py", line 161, in _dispatch
retval = await maybe_coroutine
File "/opt/venv/lib/python3.10/site-packages/sanic/app.py", line 1581, in run_delayed_task
await prepped
File "/opt/venv/lib/python3.10/site-packages/rasa/core/run.py", line 137, in run_cmdline_io
await console.record_messages(
File "/opt/venv/lib/python3.10/site-packages/rasa/core/channels/console.py", line 208, in record_messages
text = await _get_user_input(previous_response)
File "/opt/venv/lib/python3.10/site-packages/rasa/core/channels/console.py", line 133, in _get_user_input
response = await question.ask_async()
File "/opt/venv/lib/python3.10/site-packages/questionary/question.py", line 46, in ask_async
return await self.unsafe_ask_async(patch_stdout)
File "/opt/venv/lib/python3.10/site-packages/questionary/question.py", line 132, in unsafe_ask_async
return await r
File "/opt/venv/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 856, in run_async
return await _run_async2()
File "/opt/venv/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 826, in _run_async2
result = await _run_async()
File "/opt/venv/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 741, in _run_async
with self.input.raw_mode(), self.input.attach(
File "/usr/lib/python3.10/contextlib.py", line 135, in enter
return next(self.gen)
File "/opt/venv/lib/python3.10/site-packages/prompt_toolkit/input/vt100.py", line 182, in attached_input
raise EOFError
EOFError

commented

Then I interrupted with CTRL+C and got these:
^CExperienced exception while trying to serve
Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/sanic/app.py", line 1204, in run
serve_single(server_settings)
File "/opt/venv/lib/python3.10/site-packages/sanic/server/runners.py", line 206, in serve_single
serve(**server_settings)
File "/opt/venv/lib/python3.10/site-packages/sanic/server/runners.py", line 155, in serve
loop.run_forever()
File "uvloop/loop.pyx", line 1377, in uvloop.loop.Loop.run_forever
File "uvloop/loop.pyx", line 555, in uvloop.loop.Loop._run
File "uvloop/handles/poll.pyx", line 213, in uvloop.loop.__on_uvpoll_event
File "uvloop/cbhandles.pyx", line 83, in uvloop.loop.Handle._run
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "uvloop/loop.pyx", line 397, in uvloop.loop.Loop._read_from_self
File "uvloop/loop.pyx", line 402, in uvloop.loop.Loop._invoke_signals
File "uvloop/loop.pyx", line 377, in uvloop.loop.Loop._ceval_process_signals
KeyboardInterrupt
Traceback (most recent call last):
File "/opt/venv/bin/rasa", line 8, in
sys.exit(main())
File "/opt/venv/lib/python3.10/site-packages/rasa/main.py", line 127, in main
cmdline_arguments.func(cmdline_arguments)
File "/opt/venv/lib/python3.10/site-packages/rasa/cli/shell.py", line 141, in shell
rasa.cli.run.run(args)
File "/opt/venv/lib/python3.10/site-packages/rasa/cli/run.py", line 124, in run
rasa.run(**vars(args))
File "/opt/venv/lib/python3.10/site-packages/rasa/api.py", line 56, in run
rasa.core.run.serve_application(
File "/opt/venv/lib/python3.10/site-packages/rasa/core/run.py", line 229, in serve_application
app.run(
File "/opt/venv/lib/python3.10/site-packages/sanic/app.py", line 1204, in run
serve_single(server_settings)
File "/opt/venv/lib/python3.10/site-packages/sanic/server/runners.py", line 206, in serve_single
serve(**server_settings)
File "/opt/venv/lib/python3.10/site-packages/sanic/server/runners.py", line 155, in serve
loop.run_forever()
File "uvloop/loop.pyx", line 1377, in uvloop.loop.Loop.run_forever
File "uvloop/loop.pyx", line 555, in uvloop.loop.Loop._run
File "uvloop/handles/poll.pyx", line 213, in uvloop.loop.__on_uvpoll_event
File "uvloop/cbhandles.pyx", line 83, in uvloop.loop.Handle._run
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "uvloop/loop.pyx", line 397, in uvloop.loop.Loop._read_from_self
File "uvloop/loop.pyx", line 402, in uvloop.loop.Loop._invoke_signals
File "uvloop/loop.pyx", line 377, in uvloop.loop.Loop._ceval_process_signals
KeyboardInterrupt

commented

Also one more thing.
The content of docker compose file here: https://www.docker.com/blog/developing-using-rasa-and-docker/

This does not match with the compose file in the github.
Either using rasa/rasa:3.5.2 image for rasa, while other use another image (I haven't check what is the exact difference between them).

commented

Last but not least I think this is the key as it looks like the container is for another CPU architecture, I haven't noticed in the blog:
WARN[0144] current commit information was not captured by the build error="failed to read current commit information with git rev-parse --is-inside-work-tree"
[+] Running 3/3
✔ Container docker-ml-faq-rassa-rasa-1 Started 0.8s
✔ Container docker-ml-faq-rassa-webchat-1 Started 0.9s
! rasa The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested 0.0s

So the image harshmanvar/docker-ml-faq-rasa:3.5.2

@zhanko73 Tested Compose file in Github with both images mentioned working fine with the ** ARM Mac M1** version.

You are right, thanks a ton for sharing the details. i tested it on Linux and hit up on similar issues, will take a look further and debug.

commented

OK, thank you.