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

61 oserror unable to open seqrepo directory usrlocalshareseqrepolatest when using seqrepo #102

Conversation

reece
Copy link
Member

@reece reece commented Jul 26, 2022

This PR updates the docker-compose.yml to use new seqrepo docker images.

It would be helpful to have at least one person actually try the README instructions for bringing up a vrs-python environment. Also, please read the README as though you haven't seen it before -- does it answer questions new users are likely to have?

Copy link
Contributor

@korikuzma korikuzma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reece Awesome! Thanks so much for taking the time to fix this. 🙌

README.md Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved

seqrepo-rest-service:
# Test: curl http://localhost:5000/seqrepo/1/sequence/refseq:NM_000551.3
image: biocommons/seqrepo-rest-service:0.2.0
volumes:
- seqrepo_vol:/usr/local/share/seqrepo
network_mode: host
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reece , our lab uses Docker Desktop for Mac and network_mode: host is not supported as seen in the docs:

The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server

I'm able to get it to work when changing network_mode: host to:

    ports:
      - 5432:5432  # or 5000:5000 for seqrepo rest

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@korikuzma: I switched to bridge networking and tested on Linux. Would you please try?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that it works! The only endpoint that doesn't work is http://localhost:5000/seqrepo/1/ping. This is the traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2091, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2076, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1519, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1517, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1503, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.10/dist-packages/connexion/decorators/decorator.py", line 68, in wrapper
    response = function(request)
  File "/usr/local/lib/python3.10/dist-packages/connexion/decorators/uri_parsing.py", line 149, in wrapper
    response = function(request)
  File "/usr/local/lib/python3.10/dist-packages/connexion/decorators/response.py", line 113, in wrapper
    return _wrapper(request, response)
  File "/usr/local/lib/python3.10/dist-packages/connexion/decorators/response.py", line 90, in _wrapper
    self.operation.api.get_connexion_response(response, self.mimetype)
  File "/usr/local/lib/python3.10/dist-packages/connexion/apis/abstract.py", line 365, in get_connexion_response
    response = cls._response_from_handler(response, mimetype)
  File "/usr/local/lib/python3.10/dist-packages/connexion/apis/abstract.py", line 345, in _response_from_handler
    return cls._build_response(mimetype=mimetype, data=response, extra_context=extra_context)
  File "/usr/local/lib/python3.10/dist-packages/connexion/apis/flask_api.py", line 188, in _build_response
    data, status_code, serialized_mimetype = cls._prepare_body_and_status_code(data=data, mimetype=mimetype, status_code=status_code, extra_context=extra_context)
  File "/usr/local/lib/python3.10/dist-packages/connexion/apis/abstract.py", line 417, in _prepare_body_and_status_code
    body, mimetype = cls._serialize_data(data, mimetype)
  File "/usr/local/lib/python3.10/dist-packages/connexion/apis/flask_api.py", line 205, in _serialize_data
    body = cls.jsonifier.dumps(data)
  File "/usr/local/lib/python3.10/dist-packages/connexion/jsonifier.py", line 57, in dumps
    return self.json.dumps(data, **kwargs) + '\n'
  File "/usr/local/lib/python3.10/dist-packages/flask/json/__init__.py", line 132, in dumps
    return _json.dumps(obj, **kwargs)
  File "/usr/lib/python3.10/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/usr/lib/python3.10/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/usr/lib/python3.10/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.10/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/usr/local/lib/python3.10/dist-packages/connexion/apps/flask_app.py", line 168, in default
    return json.JSONEncoder.default(self, o)
  File "/usr/local/lib/python3.10/dist-packages/flask/json/__init__.py", line 51, in default
    return super().default(o)
  File "/usr/lib/python3.10/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type PosixPath is not JSON serializable

reece and others added 2 commits July 26, 2022 22:03
Co-authored-by: Kori Kuzma <42851808+korikuzma@users.noreply.github.com>
Copy link
Contributor

@larrybabb larrybabb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not in the weeds on this so only a comment.
I reviewed the text changes and eyeballed the config changes and it definitely seems like an improvement. I defer to @korikuzma 's review as she is in the weeds and is actually using this service regularly.

Copy link
Contributor

@korikuzma korikuzma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reece Awesome!! Thanks so much for taking the time to fix this. Everything seems to work. 🚀

@reece
Copy link
Member Author

reece commented Sep 11, 2022

@korikuzma : I made one more commit to make the quoting style consistent. Someone made changes in normalize.py that used single quotes, whereas the rest of the code uses double quotes by default. Pylint didn't like it. Oddly, the score in Python 3.7 was above the score threshold (8.9), and the 3.8 and 3.9 tests were below. Anyway, that's why the change to normalize. Please approve.

@ahwagner @larrybabb : Once approved, please merge. I'm not a code maintainer any more. :-)

@korikuzma
Copy link
Contributor

korikuzma commented Sep 12, 2022

@reece I had to do that in #108 too. Looks good to me 👍 Single quote was me (🤦‍♀️). I’ll probably add a pre-commit hook so these things don’t happen in the future.

@korikuzma korikuzma merged commit b0d9a15 into ga4gh:main Sep 13, 2022
@reece reece deleted the 61-oserror-unable-to-open-seqrepo-directory-usrlocalshareseqrepolatest-when-using-seqrepo branch December 6, 2022 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OSError: Unable to open SeqRepo directory /usr/local/share/seqrepo/latest when using seqrepo
4 participants