-
Notifications
You must be signed in to change notification settings - Fork 8
[DRAFT] Added initial skeleton code for the remote vector index builder #5
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
[DRAFT] Added initial skeleton code for the remote vector index builder #5
Conversation
Signed-off-by: Rohan Chitale <[email protected]>
Hi Rohan! |
|
||
import logging | ||
|
||
router = APIRouter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little rusty on python, but I think this stuff can happen in __init__.py
?
raise HTTPException(status_code=429, detail=str(e)) | ||
except CapacityError as e: | ||
raise HTTPException(status_code=507, detail=str(e)) | ||
return CreateJobResponse(job_id=job_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to explicitly specify 200 here?
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
class BuildServiceError(Exception): | ||
"""Base exception for build service errors""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably use this as the place to codify the status codes -> exceptions mappings then
def can_allocate(self, gpu_memory: float, cpu_memory: float) -> bool: | ||
with self._lock: | ||
return (self._available_gpu_memory >= gpu_memory and | ||
self._available_cpu_memory >= cpu_memory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just keep this as a TODO, but I think we will want to separately track rejections due to GPU vs CPU
fastapi[standard]>=0.113.0,<0.114.0 | ||
pydantic>=2.7.0,<3.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're vending an image here I think strict fixed versions is probably preferable. If this were a library then I would say the opposite though.
Signed-off-by: Rohan Chitale <[email protected]>
Signed-off-by: Rohan Chitale <[email protected]>
@Rajrahane is this PR still a draft PR? |
@navneet1v im going to close this and re-open as a PR to main, once I have unit tests written. Will also make the modifications suggested by @jed326 |
Description
Initial skeleton for the remote vector index builder service. Contains the API routes, workflow execution logic, and more. Does not have the code for the object store client and faiss client yet.
This is a draft PR; I'm looking for feedback on the general structure/ideas in the code. If it looks good, i'll add comments to all the relevant functions and add unit tests, and raise a separate PR to main.
Issue Resolved
Related Issue: opensearch-project/k-NN#2545. TODO: Transfer issue to this repo.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.