epam / Indigo

Universal cheminformatics toolkit, utilities and database search tools
http://lifescience.opensource.epam.com
Apache License 2.0
315 stars 105 forks source link

Bug Report | When building `api/http` container, it cannot run due to mismatch in `pydantic` version #1891

Closed T1t4m1un closed 6 months ago

T1t4m1un commented 6 months ago

Steps to Reproduce

  1. Clone the repository from github.
  2. Change directory into ./api/http
  3. Execute docker-compose up --build

Actual behavior

Attaching to indigo-1
indigo-1  | /usr/local/lib/python3.9/site-packages/pydantic/_migration.py:283: UserWarning: `pydantic.generics:GenericModel` has been moved to `pydantic.BaseModel`.
indigo-1  |   warnings.warn(f'`{import_path}` has been moved to `{new_location}`.')
indigo-1  | Traceback (most recent call last):
indigo-1  |   File "/usr/local/bin/indigo_service", line 5, in <module>
indigo-1  |     from indigo_service.indigo_http import run_debug
indigo-1  |   File "/usr/local/lib/python3.9/site-packages/indigo_service/indigo_http.py", line 26, in <module>
indigo-1  |     from indigo_service import jsonapi, service
indigo-1  |   File "/usr/local/lib/python3.9/site-packages/indigo_service/jsonapi.py", line 50, in <module>
indigo-1  |     class PrimitiveFormat(BaseModel):
indigo-1  |   File "/usr/local/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 92, in __new__
indigo-1  |     private_attributes = inspect_namespace(
indigo-1  |   File "/usr/local/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 328, in inspect_namespace
indigo-1  |     raise TypeError("To define root models, use `pydantic.RootModel` rather than a field called '__root__'")
indigo-1  | TypeError: To define root models, use `pydantic.RootModel` rather than a field called '__root__'

Expected behavior

Attaching to indigo-1
indigo-1  | INFO:     Will watch for changes in these directories: ['/opt/indigo']
indigo-1  | INFO:     Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
indigo-1  | INFO:     Started reloader process [7] using WatchFiles
indigo-1  | INFO:     Started server process [9]
indigo-1  | INFO:     Waiting for application startup.
indigo-1  | INFO:     Application startup complete.

Environment details:

There's no more modifications.

Additional context

There's a ticket for the same problem before: #1233

I found a possible solution: https://github.com/epam/Indigo/issues/1233#issuecomment-2028989690_

AlexeyGirin commented 5 months ago

Proposed solution implemented