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

Asynchronous Pyxis GQL module #219

Merged

Conversation

FernandesMF
Copy link
Contributor

@FernandesMF FernandesMF commented May 22, 2023

(This is the continuation or PR #218)

This commit introduces the asynchronous Pyxis GQL module. It will hopefully allow for a better performance when interfacing with the Pyxis GQL endpoint.

The changes include:

  • the pyxis gql async module itself
  • unit tests of the module
  • a documentation page with usage examples
  • updates to the dependencies

Most of the code is reused from the synchronous Pyxis GQL module.

Caching (dogpile)

While trying to use dogpile (which is used by the sync module for caching), I kept running into this error: RuntimeError: cannot reuse already awaited coroutine.
It seems that, unfortunately, dogpile still does not support async functions:
sqlalchemy/dogpile.cache#200
sqlalchemy/dogpile.cache#199

I guess we can try another module for caching the async functions in the future, for example https://github.com/aio-libs/aiocache. I didn't implement caching for now.

Testing

I believe tox is failing due to things ouside the scope of this PR. But all tests passed in my local machine, I swear! xD

I made manual tests for the new module to make sure things are working fine. I didn't include them in the final contribution, though.

Documentation

And here is the zippe documentation again, in case you want to check it out:
docs.zip

Question

  • I found that the docstring of PyxisGQL.find_images_by_name_version, in the sync module, is outdated. I fixed it in the async version, do you want me to update the sync version as well?

Thanks again for your time, and sorry for the big PR! 😁
JIRA: [CWFHEALTH-2039]

This commit introduces the asynchronous Pyxis GQL module. It will
hopefully allow for a better performance when interfacing with the
Pyxis GQL endpoint.

The changes include:
- the pyxis gql async module itself
- unit tests of the module
- a documentation page with usage examples
- updates to the dependencies
@qixiang
Copy link
Contributor

qixiang commented May 24, 2023

I guess we can try another module for caching the async functions in the future, for example https://github.com/aio-libs/aiocache. I didn't implement caching for now.

It's fine without caching at this moment, please file a jira card for tracking that.

I found that the docstring of PyxisGQL.find_images_by_name_version, in the sync module, is outdated. I fixed it in the async version, do you want me to update the sync version as well?

yes, please open a new PR to fix that.

I believe tox is failing due to things ouside the scope of this PR.

yes, the pyxis branch is having the old tox.ini which uses the deprecated runner, it has been fixed in main branch and we will merge this pyxis branch to main very soon.

@qixiang
Copy link
Contributor

qixiang commented May 29, 2023

I found that the docstring of PyxisGQL.find_images_by_name_version, in the sync module, is outdated. I fixed it in the async version, do you want me to update the sync version as well?

yes, please open a new PR to fix that.

This is fixed in #220

@FernandesMF FernandesMF merged commit 89ee85d into redhat-exd-rebuilds:pyxis May 29, 2023
@FernandesMF FernandesMF deleted the pyxis_gql_async2_squash branch June 30, 2023 17:55
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.

2 participants