jina-ai / jina

☁️ Build multimodal AI applications with cloud-native stack
https://docs.jina.ai
Apache License 2.0
20.63k stars 2.21k forks source link

feat(sagemaker): support batch-transform #6055

Closed deepankarm closed 9 months ago

deepankarm commented 10 months ago

Goals

PR in continuation to https://github.com/jina-ai/jina/pull/6046.

Sagemaker still calls the POST /invocations route during batch-transform but with different content-type & body. To enable both application/json (for inference) and text/csv (for batch-transform, I removed the pydantic model from the path signature, rather use fastapi's Request class and evaluate the body according to the content-type.

For batch-transform,

Gotchas

End-to-end tests

I've manually tested the Executor after pushing a model to S3, the Executor image to ECR & running batch-transform jobs for both SingleLine and MultiLine records.


codecov[bot] commented 10 months ago

Codecov Report

Attention: 46 lines in your changes are missing coverage. Please review.

Comparison is base (4ea8bb5) 76.93% compared to head (9ff2d57) 76.85%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6055 +/- ## ========================================== - Coverage 76.93% 76.85% -0.09% ========================================== Files 145 145 Lines 13889 13916 +27 ========================================== + Hits 10686 10695 +9 - Misses 3203 3221 +18 ``` | [Flag](https://app.codecov.io/gh/jina-ai/jina/pull/6055/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai) | Coverage Δ | | |---|---|---| | [jina](https://app.codecov.io/gh/jina-ai/jina/pull/6055/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai) | `76.85% <11.53%> (-0.09%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/jina-ai/jina/pull/6055?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai) | Coverage Δ | | |---|---|---| | [jina/orchestrate/deployments/\_\_init\_\_.py](https://app.codecov.io/gh/jina-ai/jina/pull/6055?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai#diff-amluYS9vcmNoZXN0cmF0ZS9kZXBsb3ltZW50cy9fX2luaXRfXy5weQ==) | `81.67% <37.50%> (-0.05%)` | :arrow_down: | | [jina/serve/runtimes/worker/http\_sagemaker\_app.py](https://app.codecov.io/gh/jina-ai/jina/pull/6055?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai#diff-amluYS9zZXJ2ZS9ydW50aW1lcy93b3JrZXIvaHR0cF9zYWdlbWFrZXJfYXBwLnB5) | `0.00% <0.00%> (ø)` | | ... and [7 files with indirect coverage changes](https://app.codecov.io/gh/jina-ai/jina/pull/6055/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

deepankarm commented 9 months ago

can u add tests with docker?

Added - https://github.com/jina-ai/jina/pull/6055/commits/a7faa6f412742605ee9af43232c66db9b2175dd5