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

test: crud api #2104

Merged
merged 12 commits into from Mar 9, 2021
Merged

test: crud api #2104

merged 12 commits into from Mar 9, 2021

Conversation

florian-hoenicke
Copy link
Member

@florian-hoenicke florian-hoenicke commented Mar 2, 2021

Besides the tests, this pr contains fixes for the REST API as well.

  • changed from starlette.responses import StreamingResponse to from fastapi.responses import StreamingResponse
  • added 'text', 'embedding' and 'buffer' to the pydantic model.
  • remove none values from the requests

@jina-bot jina-bot added size/M area/testing This issue/PR affects testing labels Mar 2, 2021
@codecov
Copy link

codecov bot commented Mar 2, 2021

Codecov Report

Merging #2104 (7d6f6d0) into master (f0b6a44) will increase coverage by 0.42%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2104      +/-   ##
==========================================
+ Coverage   89.90%   90.33%   +0.42%     
==========================================
  Files         211      211              
  Lines       11209    11223      +14     
==========================================
+ Hits        10078    10138      +60     
+ Misses       1131     1085      -46     
Flag Coverage Δ
daemon 50.41% <25.92%> (-0.05%) ⬇️
jina 90.82% <88.88%> (+0.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
jina/clients/sugary_io.py 92.10% <76.92%> (ø)
jina/peapods/runtimes/asyncio/rest/app.py 94.07% <100.00%> (+16.38%) ⬆️
jina/peapods/runtimes/asyncio/rest/models.py 100.00% <100.00%> (ø)
jina/executors/encoders/frameworks.py 63.33% <0.00%> (+8.33%) ⬆️
jina/executors/encoders/numeric/__init__.py 100.00% <0.00%> (+57.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0b6a44...90e750b. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Mar 2, 2021

Latency summary

Current PR yields:

  • 😶 index QPS at 1125, delta to last 3 avg.: -3%
  • 😶 query QPS at 19, delta to last 3 avg.: +0%

Breakdown

Version Index QPS Query QPS
current 1125 19
1.0.8 1202 19
1.0.7 1117 18

Backed by latency-tracking. Further commits will update this comment.

@jina-bot jina-bot added area/core This issue/PR affects the core codebase area/network This issue/PR affects network functionality component/peapod labels Mar 4, 2021
@florian-hoenicke florian-hoenicke linked an issue Mar 5, 2021 that may be closed by this pull request
@florian-hoenicke florian-hoenicke marked this pull request as ready for review March 5, 2021 09:08
@florian-hoenicke florian-hoenicke requested a review from a team as a code owner March 5, 2021 09:08
tests/integration/crud/rest/test_rest.py Outdated Show resolved Hide resolved
@nan-wang
Copy link
Member

nan-wang commented Mar 5, 2021

BTW, I just found executors.requests.CompoundIndexer.yml is out-dated. The UpdateRequest part is wrong.

@JoanFM
Copy link
Member

JoanFM commented Mar 5, 2021

Hey @florian-hoenicke,

would you provide some information and context related to the changes, since according to the title it seems to be just a test, but some changes are seen

@florian-hoenicke florian-hoenicke requested review from JoanFM, nan-wang and a team March 5, 2021 11:29
@florian-hoenicke
Copy link
Member Author

Hey @florian-hoenicke,

would you provide some information and context related to the changes, since according to the title it seems to be just a test, but some changes are seen

Yes, you are right. I added the required information to the description

@florian-hoenicke
Copy link
Member Author

BTW, I just found executors.requests.CompoundIndexer.yml is out-dated. The UpdateRequest part is wrong.

I had a look and could not find what would be the issue with the UpdateRequest.
We use the VectorIndexDriver for updates when setting mothod: update. Is that what you mean? In that case it is as expected.

on:
UpdateRequest:
- !VectorIndexDriver
with:
method: update
executor: vecidx
traversal_paths: [ 'r' ]
- !KVIndexDriver
with:
method: update
executor: docidx
traversal_paths: [ 'r' ]

jina/peapods/runtimes/asyncio/rest/app.py Outdated Show resolved Hide resolved
jina/peapods/runtimes/asyncio/rest/app.py Outdated Show resolved Hide resolved
jina/peapods/runtimes/asyncio/rest/models.py Outdated Show resolved Hide resolved
@nan-wang
Copy link
Member

nan-wang commented Mar 6, 2021

BTW, I just found executors.requests.CompoundIndexer.yml is out-dated. The UpdateRequest part is wrong.

I had a look and could not find what would be the issue with the UpdateRequest.
We use the VectorIndexDriver for updates when setting mothod: update. Is that what you mean? In that case it is as expected.

on:
UpdateRequest:

  • !VectorIndexDriver
    with:
    method: update
    executor: vecidx
    traversal_paths: [ 'r' ]
  • !KVIndexDriver
    with:
    method: update
    executor: docidx
    traversal_paths: [ 'r' ]

Yes, this is what I mean

@deepankarm
Copy link
Member

@florian-hoenicke I have fixed the issues with the response and the pydantic models in #2121. We can focus only on tests in this PR.

@florian-hoenicke
Copy link
Member Author

@deepankarm really cool. Let's merge your pr first.

nan-wang
nan-wang previously approved these changes Mar 9, 2021
Copy link
Member

@nan-wang nan-wang left a comment

Choose a reason for hiding this comment

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

LGTM👍

@florian-hoenicke
Copy link
Member Author

I fixed an issue with the oneof type in the protobuf definition.
The problem was that always all optional fields were initialized in the pydantic model.
Providing more than one of the optional fields in the document creation makes it fail.
As discussed with @deepankarm, there are feature requests to add the support for a more elegant solution.
pydantic/pydantic#656
pydantic/pydantic#619

Validating the request to check that the client obeys the oneof rules should be done in a separate ticket.
#2132

@florian-hoenicke florian-hoenicke merged commit 23d77e2 into master Mar 9, 2021
@florian-hoenicke florian-hoenicke deleted the test-crud-api branch March 9, 2021 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core This issue/PR affects the core codebase area/network This issue/PR affects network functionality area/testing This issue/PR affects testing component/peapod size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test API crud
6 participants