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

[Docs: Install from Package Guide] have to modify webserver redis local configuration #2071

Open
studioego opened this issue Apr 25, 2024 · 0 comments · May be fixed by #2664
Open

[Docs: Install from Package Guide] have to modify webserver redis local configuration #2071

studioego opened this issue Apr 25, 2024 · 0 comments · May be fixed by #2664
Assignees
Labels
area:docs Documentations

Comments

@studioego
Copy link
Contributor

studioego commented Apr 25, 2024

Main idea

In the Installation Guides > Install from Packages > Install Backend.AI Webserver > Local configuration, I found wrong redis configurations.

The redis configurations in the halfstack.conf of "main" repo and the webserver.conf in the Install from Package Guide example are different.

Redis configurations in the halfstack.conf of the main repo

[session]

[session.redis]
addr = "localhost:8111"
# password = "mysecret"
# service_name = "mymaster"
# sentinel = "127.0.0.1:9503,127.0.0.1:9504,127.0.0.1:9505"

[session.redis.redis_helper_config]
# socket_timeout = 5
# socket_connect_timeout = 2
# reconnect_poll_timeout = 0.3

max_age = 604800  # 1 week
flush_on_startup = false
login_block_time = 1200  # 20 min (in sec)
login_allowed_fail_count = 10
max_count_for_preopen_ports = 10

Redis configurations in the webserver.conf of the Install from Package Guide

[session]
redis.host = "bai-m1"
redis.port = 8110
redis.db = 5
redis.password = "develove"
max_age = 604800  # 1 week
flush_on_startup = false
login_block_time = 1200  # 20 min (in sec)
login_allowed_fail_count = 10
max_count_for_preopen_ports = 10

If you run the following Redis configurations in the webserver.conf of Install from Package Guide, you get some error messages.

(.venv) bai@dhsung:~/webserver$ python -m ai.backend.web.server -f ${HOME}/.config/backend.ai/webserver.conf

Traceback (most recent call last):
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/ai/backend/common/config.py", line 212, in check
    config = iv.check(table)
             ^^^^^^^^^^^^^^^
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/trafaret/base.py", line 110, in check
    return self.transform(value, context=context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/trafaret/base.py", line 1178, in transform
    self._failure(error=errors, code=codes.SOME_ELEMENTS_DID_NOT_MATCH)
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/trafaret/base.py", line 140, in _failure
    raise DataError(error=error, value=value, trafaret=self, code=code)
trafaret.dataerror.DataError: {'session': DataError('{\'redis\': DataError("{\'host\': DataError(\'host is not allowed key\'), \'port\': DataError(\'port is not allowed key\')}")}')}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/ai/backend/web/server.py", line 798, in <module>
    main()
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/ai/backend/web/server.py", line 750, in main
    cfg = config.check(raw_cfg, config_iv)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bai/webserver/.venv/lib/python3.12/site-packages/ai/backend/common/config.py", line 214, in check
    raise ConfigurationError(e.as_dict())
ai.backend.common.exception.ConfigurationError: {'session': {'redis': {'host': 'host is not allowed key', 'port': 'port is not allowed key'}}}

As a result, you have to apply the redis configuration of the halfstack.conf of the main repo to run the webserver.

(.venv) bai@dhsung:~/webserver$ python -m ai.backend.web.server -f ${HOME}/.config/backend.ai/webserver.conf
2024-04-25 14:05:33.346 INFO ai.backend.web.server [3030201] started.
2024-04-25 14:05:33.352 INFO ai.backend.web.server [3030201] started.
2024-04-25 14:05:33.355 INFO ai.backend.web.server [3030201] started.
2024-04-25 14:05:33.364 INFO ai.backend.web.server [3030201] started.
2024-04-25 14:05:33.464 INFO ai.backend.web.server [3030201] Backend.AI Web Server 24.03.2
2024-04-25 14:05:33.465 INFO ai.backend.web.server [3030201] runtime: /home/bai/webserver/.venv
2024-04-25 14:05:33.466 INFO ai.backend.web.server [3030201] serving at 0.0.0.0:8080
2024-04-25 14:05:33.467 INFO ai.backend.web.server [3030201] Using uvloop as the event loop backend

Alternative ideas

No response

Anything else?

No response

@studioego studioego added type:feature Add new features area:docs Documentations labels Apr 25, 2024
@studioego studioego self-assigned this Apr 25, 2024
@achimnol achimnol removed the type:feature Add new features label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:docs Documentations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants