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

Backend: Fix issue 909 #910

Merged
merged 2 commits into from
Jan 17, 2025
Merged

Backend: Fix issue 909 #910

merged 2 commits into from
Jan 17, 2025

Conversation

ezawadski
Copy link
Collaborator

@ezawadski ezawadski commented Jan 16, 2025

Deployment refactor changed AVAILABLE_MODEL_DEPLOYMENTS to a list where it was previously a dictionary. Reverted it back to a dictionary.

AI Description

This pull request makes changes to the get_available_deployments function in src/backend/config/deployments.py, the deployment_prompt function in src/backend/scripts/cli/prompts.py, and the get_default_deployment, get_deployment_by_name, get_deployment_definition, and get_deployment_definitions functions in src/backend/services/deployment.py. It also updates the validate_deployment_model function in src/backend/services/request_validators.py.

The following changes are made:

  • The get_available_deployments function now returns a dictionary instead of a list, with the key being the deployment name and the value being the deployment object. This change is made to better handle the community deployments, which are now added to the installed_deployments dictionary using the update method instead of the extend method.
  • The deployment_prompt function now iterates over the env_vars method of the configs object instead of directly accessing the env_vars attribute.
  • The get_default_deployment, get_deployment_by_name, get_deployment_definition, and get_deployment_definitions functions now iterate over the values of the AVAILABLE_MODEL_DEPLOYMENTS dictionary instead of directly accessing the dictionary.
  • The validate_deployment_model function now iterates over the values of the AVAILABLE_MODEL_DEPLOYMENTS dictionary instead of directly accessing the dictionary.
  • The mock_available_model_deployments function in src/backend/tests/integration/conftest.py and src/backend/tests/unit/conftest.py now patches the AVAILABLE_MODEL_DEPLOYMENTS variable with the MOCKED_DEPLOYMENTS object instead of a list of its values.
  • The test_get_default_deployment_none_available function in src/backend/tests/unit/services/test_deployment.py now patches the AVAILABLE_MODEL_DEPLOYMENTS variable with an empty dictionary instead of an empty list.
  • The test_get_deployment_definitions_with_db_deployments function in src/backend/tests/unit/services/test_deployment.py now patches the AVAILABLE_MODEL_DEPLOYMENTS variable with a dictionary of deployment names and objects instead of a list of deployment objects.

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.

Project coverage is 76.75%. Comparing base (9ce3c5c) to head (fa1eda8).

Files with missing lines Patch % Lines
src/backend/config/deployments.py 75.00% 1 Missing ⚠️
src/backend/scripts/cli/prompts.py 0.00% 1 Missing ⚠️
src/backend/services/request_validators.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #910   +/-   ##
=======================================
  Coverage   76.75%   76.75%           
=======================================
  Files         272      272           
  Lines       10638    10638           
=======================================
  Hits         8165     8165           
  Misses       2473     2473           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ezawadski ezawadski linked an issue Jan 16, 2025 that may be closed by this pull request
Copy link
Collaborator

@tianjing-li tianjing-li left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@EugeneLightsOn EugeneLightsOn left a comment

Choose a reason for hiding this comment

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

Looks good to me

@ezawadski ezawadski merged commit 3b1c27f into main Jan 17, 2025
8 checks passed
@ezawadski ezawadski deleted the fix/issue-909 branch January 17, 2025 14:08
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.

Error in Model Deployment Choices
4 participants