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

[API] Fix model monitoring endpoints sync/async separation #885

Merged
merged 2 commits into from Apr 25, 2021

Conversation

Michaelliv
Copy link
Contributor

…threadpool

Comment on lines 34 to 37
await run_in_threadpool(
ModelEndpoints.create_or_patch,
access_key=access_key,
model_endpoint=model_endpoint,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this endpoint can be changed to be sync as well

@@ -47,8 +50,11 @@ async def delete_endpoint_record(
Clears endpoint record from KV by endpoint_id
"""
access_key = get_access_key(request.headers)
await ModelEndpoints.delete_endpoint_record(
access_key=access_key, project=project, endpoint_id=endpoint_id
await run_in_threadpool(
Copy link
Contributor

Choose a reason for hiding this comment

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

same

@@ -79,7 +85,8 @@ async def list_endpoints(
api/projects/{project}/model-endpoints/?label=mylabel=1,myotherlabel=2
"""
access_key = get_access_key(request.headers)
endpoints = await ModelEndpoints.list_endpoints(
endpoints = await run_in_threadpool(
Copy link
Contributor

Choose a reason for hiding this comment

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

same

@@ -105,7 +112,8 @@ async def get_endpoint(
feature_analysis: bool = Query(default=False),
) -> ModelEndpoint:
access_key = get_access_key(request.headers)
endpoint = await ModelEndpoints.get_endpoint(
endpoint = await run_in_threadpool(
Copy link
Contributor

Choose a reason for hiding this comment

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

same

@Hedingber Hedingber changed the title [Model Monitoring] Async behavior of individual functions fix [API] Fix model monitoring endpoints sync/async separation Apr 25, 2021
@Hedingber Hedingber merged commit 46e3288 into mlrun:development Apr 25, 2021
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.

None yet

2 participants