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

OpenAPI Docs - Internal Server Error #1093

Closed
kata opened this issue Apr 13, 2023 · 1 comment · Fixed by #1095
Closed

OpenAPI Docs - Internal Server Error #1093

kata opened this issue Apr 13, 2023 · 1 comment · Fixed by #1095

Comments

@kata
Copy link

kata commented Apr 13, 2023

Hi,

in the latest mlserver version (1.3.0) I got a Internal Server Error /v2/docs/dataplane.json if I try to access the "/v2/docs" endpoint.

# create a new project to reproduce
eval {mkdir,cd}\ testproject\;
python -mvenv .venv
. .venv/bin/activate
pip install mlserver==1.3.0
mlserver start .

Apparently its trying to read the dataplane.json under .venv/lib/python3.9/site-packages/mlserver/../openapi/dataplane.json which is - i guess - neither the right place to look at nor is it there.

The openapi folder is not included in the whl package.

curl -O https://files.pythonhosted.org/packages/fa/ea/0496243742bdca1f2eb83fe709c1a7b8632073eca01be5c2a8e5a30c799e/mlserver-1.3.0-py3-none-any.whl
unzip -l mlserver-1.3.0-py3-none-any.whl
Archive:  mlserver-1.3.0-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
      299  04-12-2023 11:12   mlserver/__init__.py
    16113  04-12-2023 11:12   mlserver/batch_processing.py
     3323  04-12-2023 11:12   mlserver/cloudevents.py
     3814  04-12-2023 11:12   mlserver/env.py
     1494  04-12-2023 11:12   mlserver/errors.py
     1589  04-12-2023 11:12   mlserver/logging.py
     1478  04-12-2023 11:12   mlserver/middleware.py
     7749  04-12-2023 11:12   mlserver/model.py
     3146  04-12-2023 11:12   mlserver/raw.py
    10897  04-12-2023 11:12   mlserver/registry.py
     6534  04-12-2023 11:12   mlserver/server.py
    12403  04-12-2023 11:12   mlserver/settings.py
     3922  04-12-2023 11:12   mlserver/utils.py
       22  04-12-2023 11:12   mlserver/version.py
      176  04-12-2023 11:12   mlserver/batching/__init__.py
     5529  04-12-2023 11:12   mlserver/batching/adaptive.py
     1856  04-12-2023 11:12   mlserver/batching/hooks.py
    10847  04-12-2023 11:12   mlserver/batching/requests.py
      911  04-12-2023 11:12   mlserver/batching/shape.py
       43  04-12-2023 11:12   mlserver/cli/__init__.py
     1883  04-12-2023 11:12   mlserver/cli/build.py
     2371  04-12-2023 11:12   mlserver/cli/constants.py
      427  04-12-2023 11:12   mlserver/cli/init_project.py
     6813  04-12-2023 11:12   mlserver/cli/main.py
     1318  04-12-2023 11:12   mlserver/cli/serve.py
     1177  04-12-2023 11:12   mlserver/codecs/__init__.py
     9601  04-12-2023 11:12   mlserver/codecs/base.py
     2575  04-12-2023 11:12   mlserver/codecs/base64.py
     2455  04-12-2023 11:12   mlserver/codecs/datetime.py
     7306  04-12-2023 11:12   mlserver/codecs/decorator.py
     2056  04-12-2023 11:12   mlserver/codecs/errors.py
      749  04-12-2023 11:12   mlserver/codecs/lists.py
     4955  04-12-2023 11:12   mlserver/codecs/numpy.py
     3674  04-12-2023 11:12   mlserver/codecs/pandas.py
     2825  04-12-2023 11:12   mlserver/codecs/string.py
     7557  04-12-2023 11:12   mlserver/codecs/utils.py
       57  04-12-2023 11:12   mlserver/grpc/__init__.py
    16463  04-12-2023 11:12   mlserver/grpc/converters.py
    31033  04-12-2023 11:12   mlserver/grpc/dataplane_pb2.py
    15571  04-12-2023 11:12   mlserver/grpc/dataplane_pb2_grpc.py
     8624  04-12-2023 11:12   mlserver/grpc/interceptors.py
       92  04-12-2023 11:12   mlserver/grpc/logging.py
     2021  04-12-2023 11:12   mlserver/grpc/model_repository.py
     6507  04-12-2023 11:12   mlserver/grpc/model_repository_pb2.py
     6338  04-12-2023 11:12   mlserver/grpc/model_repository_pb2_grpc.py
     3398  04-12-2023 11:12   mlserver/grpc/server.py
     4044  04-12-2023 11:12   mlserver/grpc/servicers.py
     1679  04-12-2023 11:12   mlserver/grpc/utils.py
      255  04-12-2023 11:12   mlserver/handlers/__init__.py
     1038  04-12-2023 11:12   mlserver/handlers/custom.py
     3615  04-12-2023 11:12   mlserver/handlers/dataplane.py
     2906  04-12-2023 11:12   mlserver/handlers/model_repository.py
       59  04-12-2023 11:12   mlserver/kafka/__init__.py
      358  04-12-2023 11:12   mlserver/kafka/errors.py
     1624  04-12-2023 11:12   mlserver/kafka/handlers.py
       85  04-12-2023 11:12   mlserver/kafka/logging.py
     1694  04-12-2023 11:12   mlserver/kafka/message.py
     3547  04-12-2023 11:12   mlserver/kafka/server.py
      282  04-12-2023 11:12   mlserver/metrics/__init__.py
     2244  04-12-2023 11:12   mlserver/metrics/context.py
     1030  04-12-2023 11:12   mlserver/metrics/errors.py
       87  04-12-2023 11:12   mlserver/metrics/logging.py
     1961  04-12-2023 11:12   mlserver/metrics/prometheus.py
      975  04-12-2023 11:12   mlserver/metrics/registry.py
     2453  04-12-2023 11:12   mlserver/metrics/server.py
      190  04-12-2023 11:12   mlserver/parallel/__init__.py
     5632  04-12-2023 11:12   mlserver/parallel/dispatcher.py
     1234  04-12-2023 11:12   mlserver/parallel/errors.py
       96  04-12-2023 11:12   mlserver/parallel/logging.py
     1506  04-12-2023 11:12   mlserver/parallel/messages.py
     2607  04-12-2023 11:12   mlserver/parallel/model.py
     3838  04-12-2023 11:12   mlserver/parallel/pool.py
     7325  04-12-2023 11:12   mlserver/parallel/registry.py
     1113  04-12-2023 11:12   mlserver/parallel/utils.py
     6868  04-12-2023 11:12   mlserver/parallel/worker.py
      302  04-12-2023 11:12   mlserver/repository/__init__.py
      697  04-12-2023 11:12   mlserver/repository/factory.py
     1587  04-12-2023 11:12   mlserver/repository/load.py
     2560  04-12-2023 11:12   mlserver/repository/repository.py
       57  04-12-2023 11:12   mlserver/rest/__init__.py
     5268  04-12-2023 11:12   mlserver/rest/app.py
     4450  04-12-2023 11:12   mlserver/rest/endpoints.py
      492  04-12-2023 11:12   mlserver/rest/errors.py
      876  04-12-2023 11:12   mlserver/rest/logging.py
     3383  04-12-2023 11:12   mlserver/rest/openapi.py
      882  04-12-2023 11:12   mlserver/rest/requests.py
     1958  04-12-2023 11:12   mlserver/rest/responses.py
     3212  04-12-2023 11:12   mlserver/rest/server.py
      890  04-12-2023 11:12   mlserver/rest/utils.py
     1096  04-12-2023 11:12   mlserver/types/__init__.py
      655  04-12-2023 11:12   mlserver/types/base.py
     2115  04-12-2023 11:12   mlserver/types/dataplane.py
     1042  04-12-2023 11:12   mlserver/types/model_repository.py
    11354  04-12-2023 11:12   mlserver-1.3.0.dist-info/LICENSE
     6198  04-12-2023 11:12   mlserver-1.3.0.dist-info/METADATA
       92  04-12-2023 11:12   mlserver-1.3.0.dist-info/WHEEL
       48  04-12-2023 11:12   mlserver-1.3.0.dist-info/entry_points.txt
        9  04-12-2023 11:12   mlserver-1.3.0.dist-info/top_level.txt
     8149  04-12-2023 11:12   mlserver-1.3.0.dist-info/RECORD
---------                     -------
   357708                     99 files

Maybe its possible to move the openapi folder with the static files into the mlserver folder and change the MANIFEST.in (https://github.com/SeldonIO/MLServer/blob/1.3.0/MANIFEST.in) to
include mlserver/openapi/*.json

and change line 7 in mlserver/rest/openapi.py (https://github.com/SeldonIO/MLServer/blob/1.3.0/mlserver/rest/openapi.py#L7) to
OPENAPI_SCHEMA_RELATIVE_PATH = "openapi/dataplane.json"

I don't know if these changes would have other implications but it works.

@kata kata changed the title OpenAPI Docs #1073 OpenAPI Docs (#1073) Apr 13, 2023
@kata kata changed the title OpenAPI Docs (#1073) OpenAPI Docs - Internal Server Error (#1073) Apr 13, 2023
@kata kata changed the title OpenAPI Docs - Internal Server Error (#1073) OpenAPI Docs - Internal Server Error Apr 13, 2023
@adriangonz
Copy link
Contributor

Hey @kata ,

Good spot!

The 1.3.0 release hasn't been fully published yet, but you're 100% right that there seems to be an issue with how the dataplane.json file is getting packaged. We'll yank the release for now until we sort that one out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants