allegroai / clearml-helm-charts

Helm chart repository for the new unified way to deploy ClearML on Kubernetes. ClearML - Auto-Magical CI/CD to streamline your AI workload. Experiment Management, Data Management, Pipeline, Orchestration, Scheduling & Serving in one MLOps/LLMOps solution
https://clear.ml/docs
36 stars 50 forks source link

[clearml-server] How to configure external mongodb with username and password #291

Closed surya9teja closed 5 months ago

surya9teja commented 5 months ago

Describe the bug a clear and concise description of what the bug is.

I have created an external mongo database when I am passing the values of database as follows using helm charts

mongodb:
    enabled: false
externalServices:
    mongodbConnectionStringAuth: mongodb://user:password@hostname:27017/boaml?authsource=admin
    mongodbConnectionStringBackend: mongodb://user:password@hostname:27017/boaml?authsource=admin

It is throwing the following error

│ Traceback (most recent call last):                                                                                                                                                                   │
│   File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main                                                                                                                         │
│     return _run_code(code, main_globals, None,                                                                                                                                                       │
│   File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code                                                                                                                                    │
│     exec(code, run_globals)                                                                                                                                                                          │
│   File "/opt/clearml/apiserver/server.py", line 5, in <module>                                                                                                                                       │
│     from apiserver.config_repo import config                                                                                                                                                         │
│   File "/opt/clearml/apiserver/config_repo.py", line 3, in <module>                                                                                                                                  │
│     config = BasicConfig()                                                                                                                                                                           │
│   File "/opt/clearml/apiserver/config/basic.py", line 66, in __init__                                                                                                                                │
│     self._config = self._reload()                                                                                                                                                                    │
│   File "/opt/clearml/apiserver/config/basic.py", line 132, in _reload                                                                                                                                │
│     extra_config_values = self._read_extra_env_config_values()                                                                                                                                       │
│   File "/opt/clearml/apiserver/config/basic.py", line 106, in _read_extra_env_config_values                                                                                                          │
│     result, ConfigFactory.parse_string(f"{path}: {os.environ[key]}")                                                                                                                                 │
│   File "/usr/local/lib/python3.9/site-packages/pyhocon/config_parser.py", line 192, in parse_string                                                                                                  │
│     return ConfigParser().parse(content, basedir, resolve, unresolved_value)                                                                                                                         │
│   File "/usr/local/lib/python3.9/site-packages/pyhocon/config_parser.py", line 455, in parse                                                                                                         │
│     config = config_expr.parseString(content, parseAll=True)[0]                                                                                                                                      │
│   File "/usr/local/lib/python3.9/site-packages/pyparsing/util.py", line 256, in _inner                                                                                                               │
│     return fn(self, *args, **kwargs)                                                                                                                                                                 │
│   File "/usr/local/lib/python3.9/site-packages/pyparsing/core.py", line 1200, in parse_string                                                                                                        │
│     raise exc.with_traceback(None)                                                                                                                                                                   │
│ pyparsing.exceptions.ParseException: Expected end of text, found '@'  (at char 57), (line:1, col:58)

Any help or suggestions?

What's your helm version?

3.14.3

What's your kubectl version?

1.29.3

What's the chart version?

7.8.2

Enter the changed values of values.yaml?

No response

surya9teja commented 5 months ago

Solved by passing the values in a string format and used +srv for mongodb

mongodbConnectionStringAuth: '"mongodb+srv://user:passworf@hostname.mongodb.net/"'
mongodbConnectionStringBackend: '"mongodb+srv://user:passworf@hostname.mongodb.net/"'