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

Running server for the first time takes too long to start for some (complex) ontologies #123

Open
dgarijo opened this issue Jul 28, 2020 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@dgarijo
Copy link
Contributor

dgarijo commented Jul 28, 2020

The implementation server we have right now takes too much time to start the API (around 10 min).

It's true that this has to be done only once when generating the server, but testing custom queries and detecting errors takes too long to debug.

Instead, we should figure out what is taking so long in the openapi generator, probably some circular references that are being validated.

Can we figure out how to reduce this time?

@dgarijo dgarijo added the enhancement New feature or request label Jul 28, 2020
@mosoriob
Copy link
Contributor

mosoriob commented Jul 28, 2020

The implementation server we have right now takes too much time to start the API (around 10 min).

This happens with the model catalog ontologies.
So, hey new user, please don't run away from this project. For simple ontologies works fine.

@dgarijo dgarijo changed the title Running server for the first time takes too long to start Running server for the first time takes too long to start for some (complex) ontologies Jul 28, 2020
@mosoriob
Copy link
Contributor

This problem has been caused by the package https://github.com/p1c2u/openapi-spec-validator. I'm going to fix it.

@mosoriob
Copy link
Contributor

Workaround:

  1. Open the file lib/python3.8/site-packages/connexion/spec.py
  2. Comment the line self._validate_spec(raw_spec)
class Specification(collections_abc.Mapping):

    def __init__(self, raw_spec):
        self._raw_spec = copy.deepcopy(raw_spec)
        self._set_defaults(raw_spec)
        #self._validate_spec(raw_spec)
        self._spec = resolve_refs(raw_spec)

@dgarijo
Copy link
Contributor Author

dgarijo commented Oct 29, 2020

Thanks. It's not a pretty solution, but we'll use it for now. We'll add an option in OBA that will comment out the line in the Dockerfile when installing the server.

@hvarg
Copy link
Collaborator

hvarg commented Nov 2, 2020

To disable validation on the API: https://github.com/mintproject/model-catalog-api/pull/132

@dgarijo dgarijo modified the milestones: OBA 3.6.0, OBA 3.7.0 Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants