Skip to content

[AQUA] Integrate aqua to use model group #1214

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

Open
wants to merge 11 commits into
base: feature/model_group
Choose a base branch
from

Conversation

lu-ohai
Copy link
Member

@lu-ohai lu-ohai commented Jun 26, 2025

Integrate aqua to use model group

  • Integrated ModelDeployment module with model group.
  • Integrated AquaDeploymentApp and AquaModelApp modules with model group.
    -- Changed to create model group instead of model while deploying multi models
    -- Moved env var MULTI_MODEL_CONFIG from deployment env to model group custom metadata
    -- Stored multi_model_metadata as regular custom metadata

Unit test

tests/unitary/with_extras/aqua/test_deployment.py

======================================= test session starts ========================================
platform darwin -- Python 3.13.2, pytest-8.3.5, pluggy-1.5.0 -- /Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
cachedir: .pytest_cache
rootdir: /Users/Downloads/fix_logic/accelerated-data-science
configfile: pytest.ini
plugins: anyio-4.9.0, langsmith-0.3.15, mock-3.14.0, xdist-3.6.1
collected 84 items                                                                                 

tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_create_deployment_for_fine_tuned_model PASSED [  1%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_create_deployment_for_foundation_model PASSED [  2%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_create_deployment_for_gguf_model PASSED [  3%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_create_deployment_for_multi_model PASSED [  4%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_create_deployment_for_tei_byoc_embedding_model PASSED [  5%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_get_deployment PASSED [  7%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_get_deployment_config PASSED [  8%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_get_deployment_default_params_0_VLLM_PARAMS <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [  9%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_get_deployment_default_params_1_VLLM_PARAMS <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 10%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_get_deployment_default_params_2_TGI_PARAMS <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 11%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_get_deployment_default_params_3_CUSTOM_PARAMS <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 13%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_get_deployment_missing_tags PASSED [ 14%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_get_deployment_status PASSED [ 15%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_get_multi_model_deployment PASSED [ 16%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_get_multimodel_deployment_config_hybrid PASSED [ 17%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_get_multimodel_deployment_config_single PASSED [ 19%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_list_deployments PASSED [ 20%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_deployment_params_0_odsc_vllm_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 21%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_deployment_params_1_odsc_vllm_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 22%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_deployment_params_2_odsc_tgi_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 23%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_deployment_params_3_custom_container_key <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 25%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_deployment_params_4_odsc_vllm_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 26%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_deployment_params_5_odsc_tgi_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 27%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_deployment_params_for_unverified_models_0_odsc_vllm_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 28%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_deployment_params_for_unverified_models_1_odsc_tgi_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 29%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_deployment_params_for_unverified_models_2_ <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 30%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_negative_0 PASSED [ 32%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_negative_1 PASSED [ 33%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_negative_2 PASSED [ 34%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_negative_3 PASSED [ 35%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_negative_4 PASSED [ 36%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_negative_5 PASSED [ 38%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_negative_single_0 PASSED [ 39%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_negative_single_1 PASSED [ 40%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_positive_0 PASSED [ 41%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_positive_1 PASSED [ 42%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_positive_2 PASSED [ 44%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_positive_single_0 PASSED [ 45%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_validate_multimodel_deployment_feasibility_positive_single_1 PASSED [ 46%]
tests/unitary/with_extras/aqua/test_deployment.py::TestAquaDeployment::test_verify_compatibility PASSED [ 47%]
tests/unitary/with_extras/aqua/test_deployment.py::TestBaseModelSpec::test_invalid_from_aqua_multi_model_ref[oci://test_location_3-ft_weights0-True-False] PASSED [ 48%]
tests/unitary/with_extras/aqua/test_deployment.py::TestBaseModelSpec::test_invalid_from_aqua_multi_model_ref[oci://test_location_3-ft_weights1-False-False] PASSED [ 50%]
tests/unitary/with_extras/aqua/test_deployment.py::TestBaseModelSpec::test_invalid_from_aqua_multi_model_ref[not-a-valid-uri-ft_weights2-False-True] PASSED [ 51%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_create_deployment_for_fine_tuned_model PASSED [ 52%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_create_deployment_for_foundation_model PASSED [ 53%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_create_deployment_for_gguf_model PASSED [ 54%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_create_deployment_for_multi_model PASSED [ 55%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_create_deployment_for_tei_byoc_embedding_model PASSED [ 57%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_from_create_model_deployment_details PASSED [ 58%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_get_deployment PASSED [ 59%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_get_deployment_config PASSED [ 60%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_get_deployment_default_params_0_VLLM_PARAMS <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 61%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_get_deployment_default_params_1_VLLM_PARAMS <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 63%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_get_deployment_default_params_2_TGI_PARAMS <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 64%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_get_deployment_default_params_3_CUSTOM_PARAMS <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 65%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_get_deployment_missing_tags PASSED [ 66%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_get_deployment_status PASSED [ 67%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_get_multi_model_deployment PASSED [ 69%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_get_multimodel_deployment_config_hybrid PASSED [ 70%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_get_multimodel_deployment_config_single PASSED [ 71%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_list_deployments PASSED [ 72%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_deployment_params_0_odsc_vllm_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 73%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_deployment_params_1_odsc_vllm_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 75%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_deployment_params_2_odsc_tgi_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 76%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_deployment_params_3_custom_container_key <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 77%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_deployment_params_4_odsc_vllm_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 78%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_deployment_params_5_odsc_tgi_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 79%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_deployment_params_for_unverified_models_0_odsc_vllm_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 80%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_deployment_params_for_unverified_models_1_odsc_tgi_serving <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 82%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_deployment_params_for_unverified_models_2_ <- ../../../../../Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/mock.py PASSED [ 83%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_negative_0 PASSED [ 84%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_negative_1 PASSED [ 85%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_negative_2 PASSED [ 86%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_negative_3 PASSED [ 88%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_negative_4 PASSED [ 89%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_negative_5 PASSED [ 90%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_negative_single_0 PASSED [ 91%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_negative_single_1 PASSED [ 92%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_positive_0 PASSED [ 94%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_positive_1 PASSED [ 95%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_positive_2 PASSED [ 96%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_positive_single_0 PASSED [ 97%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_validate_multimodel_deployment_feasibility_positive_single_1 PASSED [ 98%]
tests/unitary/with_extras/aqua/test_deployment.py::TestModelGroupConfig::test_verify_compatibility PASSED [100%]

======================================= 84 passed in 35.08s ========================================

tests/unitary/with_extras/aqua/test_model.py

======================================= test session starts ========================================
platform darwin -- Python 3.13.2, pytest-8.3.5, pluggy-1.5.0 -- /Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
cachedir: .pytest_cache
rootdir: /Users/Downloads/fix_logic/accelerated-data-science
configfile: pytest.ini
plugins: anyio-4.9.0, langsmith-0.3.15, mock-3.14.0, xdist-3.6.1
collected 34 items                                                                                 

tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_create_model PASSED        [  2%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_create_multimodel PASSED   [  5%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_get_foundation_models[service] PASSED [  8%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_get_foundation_models[verified] PASSED [ 11%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_get_model_fine_tuned PASSED [ 14%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_verified_model[True-True-True] PASSED [ 17%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_verified_model[True-False-True] PASSED [ 20%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_verified_model[False-True-False] PASSED [ 23%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_verified_model[False-False-True] PASSED [ 26%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_any_model_no_containers_specified PASSED [ 29%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_model_with_project_compartment_override[True] PASSED [ 32%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_model_with_project_compartment_override[False] PASSED [ 35%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_model_with_missing_config[True-True] PASSED [ 38%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_model_with_missing_config[True-False] PASSED [ 41%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_model_with_missing_config[False-True] PASSED [ 44%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_model_with_missing_config[False-False] PASSED [ 47%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_model_with_missing_config[None-False] PASSED [ 50%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_model_with_missing_config[None-True] PASSED [ 52%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_any_model_smc_container PASSED [ 55%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_tei_model_byoc[True] PASSED [ 58%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_tei_model_byoc[False] PASSED [ 61%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_model_with_input_tags PASSED [ 64%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_cli[data0-ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache False --inference_container odsc-vllm-serving] PASSED [ 67%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_cli[data1-ads aqua model register --model ocid1.datasciencemodel.oc1.iad.<OCID> --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache False] PASSED [ 70%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_cli[data2-ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf False --cleanup_model_cache False] PASSED [ 73%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_cli[data3-ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache False --model_file test_model_file] PASSED [ 76%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_cli[data4-ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache False --inference_container odsc-tei-serving --inference_container_uri <region>.ocir.io/<your_tenancy>/<your_image>] PASSED [ 79%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_cli[data5-ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache False --inference_container odsc-vllm-serving --freeform_tags {"ftag1": "fvalue1", "ftag2": "fvalue2"} --defined_tags {"dtag1": "dvalue1", "dtag2": "dvalue2"}] PASSED [ 82%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_import_cli[data6-ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache True --inference_container odsc-vllm-serving --ignore_model_artifact_check True] PASSED [ 85%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_load_license PASSED        [ 88%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_list_service_models PASSED [ 91%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_list_custom_models PASSED  [ 94%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_build_search_text_0 PASSED [ 97%]
tests/unitary/with_extras/aqua/test_model.py::TestAquaModel::test_build_search_text_1_This_is_a_description_ PASSED [100%]

======================================= 34 passed in 23.42s ========================================

tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py

======================================= test session starts ========================================
platform darwin -- Python 3.13.2, pytest-8.3.5, pluggy-1.5.0 -- /Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
cachedir: .pytest_cache
rootdir: /Users/Downloads/fix_logic/accelerated-data-science
configfile: pytest.ini
plugins: anyio-4.9.0, langsmith-0.3.15, mock-3.14.0, xdist-3.6.1
collected 33 items                                                                                 

tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test__load_default_properties PASSED [  3%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_activate PASSED [  6%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_build_category_log_details PASSED [  9%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_build_model_deployment_configuration_details PASSED [ 12%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_check_and_print_status PASSED [ 15%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_deactivate PASSED [ 18%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_delete PASSED [ 21%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_deploy PASSED [ 24%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_extract_from_oci_model PASSED [ 27%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_extract_spec_kwargs PASSED [ 30%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_from_ocid PASSED [ 33%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_initialize_model_deployment PASSED [ 36%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_initialize_model_deployment_from_spec PASSED [ 39%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_initialize_model_deployment_triton_builder PASSED [ 42%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_initialize_model_deployment_triton_yaml PASSED [ 45%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_initialize_model_deployment_with_error PASSED [ 48%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_initialize_model_deployment_with_spec_kwargs PASSED [ 51%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_list PASSED [ 54%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_list_df PASSED [ 57%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_model_deployment_from_dict PASSED [ 60%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_model_deployment_from_yaml PASSED [ 63%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_model_deployment_status_text PASSED [ 66%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_model_deployment_to_dict PASSED [ 69%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_model_deployment_with_large_size_artifact PASSED [ 72%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_model_deployment_with_subnet_id PASSED [ 75%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_random_display_name PASSED [ 78%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_state PASSED [ 81%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_status PASSED [ 84%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_sync PASSED [ 87%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_update PASSED [ 90%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_update_from_oci_model PASSED [ 93%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_update_spec PASSED [ 96%]
tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py::ModelDeploymentBYOCTestCase::test_watch PASSED [100%]

======================================== 33 passed in 9.01s ========================================

tests/unitary/default_setup/model/test_model_group.py

======================================= test session starts ========================================
platform darwin -- Python 3.13.2, pytest-8.3.5, pluggy-1.5.0 -- /Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
cachedir: .pytest_cache
rootdir: /Users/Downloads/fix_logic/accelerated-data-science
configfile: pytest.ini
plugins: anyio-4.9.0, langsmith-0.3.15, mock-3.14.0, xdist-3.6.1
collected 7 items                                                                                  

tests/unitary/default_setup/model/test_model_group.py::TestModelGroup::test_initialize_model_group PASSED [ 14%]
tests/unitary/default_setup/model/test_model_group.py::TestModelGroup::test_create PASSED    [ 28%]
tests/unitary/default_setup/model/test_model_group.py::TestModelGroup::test_activate PASSED  [ 42%]
tests/unitary/default_setup/model/test_model_group.py::TestModelGroup::test_deactivate PASSED [ 57%]
tests/unitary/default_setup/model/test_model_group.py::TestModelGroup::test_delete PASSED    [ 71%]
tests/unitary/default_setup/model/test_model_group.py::TestModelGroup::test_update PASSED    [ 85%]
tests/unitary/default_setup/model/test_model_group.py::TestModelGroup::test_list PASSED      [100%]

======================================== 7 passed in 5.67s =========================================

tests/unitary/default_setup/model/test_oci_model_group.py

======================================= test session starts ========================================
platform darwin -- Python 3.13.2, pytest-8.3.5, pluggy-1.5.0 -- /Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
cachedir: .pytest_cache
rootdir: /Users/Downloads/fix_logic/accelerated-data-science
configfile: pytest.ini
plugins: anyio-4.9.0, langsmith-0.3.15, mock-3.14.0, xdist-3.6.1
collected 7 items                                                                                  

tests/unitary/default_setup/model/test_oci_model_group.py::TestOCIModelGroup::test_create PASSED [ 14%]
tests/unitary/default_setup/model/test_oci_model_group.py::TestOCIModelGroup::test_activate PASSED [ 28%]
tests/unitary/default_setup/model/test_oci_model_group.py::TestOCIModelGroup::test_deactivate PASSED [ 42%]
tests/unitary/default_setup/model/test_oci_model_group.py::TestOCIModelGroup::test_delete PASSED [ 57%]
tests/unitary/default_setup/model/test_oci_model_group.py::TestOCIModelGroup::test_update PASSED [ 71%]
tests/unitary/default_setup/model/test_oci_model_group.py::TestOCIModelGroup::test_from_id PASSED [ 85%]
tests/unitary/default_setup/model/test_oci_model_group.py::TestOCIModelGroup::test_list PASSED [100%]

======================================== 7 passed in 6.17s =========================================

Notebook

  • Multi model deployment and model group created during deployment
Screenshot 2025-07-01 at 1 01 20 PM Screenshot 2025-07-01 at 12 47 43 PM
  • Get aqua multi deployment created from model group
Screenshot 2025-07-01 at 12 45 52 PM
  • Get aqua single deployment created from model
Screenshot 2025-07-01 at 12 46 18 PM Screenshot 2025-07-01 at 1 11 31 PM

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 26, 2025
@mrDzurb mrDzurb changed the title Integrate aqua to use model group [AQUA] Integrate aqua to use model group Jun 29, 2025
@lu-ohai lu-ohai marked this pull request as ready for review July 1, 2025 17:04
.with_compartment_id(compartment_id)
.with_project_id(project_id)
.with_display_name(model_group_display_name)
.with_description(model_group_description)
.with_freeform_tags(**tags)
.with_defined_tags(**(defined_tags or {}))
.with_custom_metadata_list(model_custom_metadata)
.with_member_models(
[MemberModel(model_id=model.model_id).model_dump() for model in models]
Copy link
Member

Choose a reason for hiding this comment

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

where is the MemberModel(inference_key = ) assigned? Is the inference key optional? (would this be the model name?)

Copy link
Member

Choose a reason for hiding this comment

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

We should default to using the model name if user doesn't provide one explicitly. Even though it will not be used in multi-model case, it's still a good practice to include name.

Copy link
Member Author

Choose a reason for hiding this comment

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

The inference_key is supposed to be the model name, but the model group has a length restiction for it, making it impossible to set for all models. Leave it empty here for now and will address it back.


container_params = container_spec.cli_param if container_spec else UNKNOWN

from ads.aqua.modeldeployment.model_group_config import ModelGroupConfig
Copy link
Member

Choose a reason for hiding this comment

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

put this at the top of this file

Copy link
Member Author

Choose a reason for hiding this comment

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

This has been refactored.

.with_compartment_id(compartment_id)
.with_project_id(project_id)
.with_display_name(model_group_display_name)
.with_description(model_group_description)
.with_freeform_tags(**tags)
.with_defined_tags(**(defined_tags or {}))
.with_custom_metadata_list(model_custom_metadata)
.with_member_models(
[MemberModel(model_id=model.model_id).model_dump() for model in models]
Copy link
Member

Choose a reason for hiding this comment

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

We should default to using the model name if user doesn't provide one explicitly. Even though it will not be used in multi-model case, it's still a good practice to include name.

@@ -235,20 +237,27 @@ def create(
def create_multi(
self,
models: List[AquaMultiModelRef],
create_deployment_details,
Copy link
Member

Choose a reason for hiding this comment

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

Types?

**create_model_deployment_details
).to_oci_model(CreateModelDeploymentDetails)
return CreateModelDeploymentDetails(
**ads_utils.batch_convert_case(create_model_deployment_details, "snake")
Copy link
Member

Choose a reason for hiding this comment

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

Is it safe to use the batch converter? Why can't we use the old approach?

 return OCIDataScienceModelDeployment(
            **create_model_deployment_details
        ).to_oci_model(CreateModelDeploymentDetails)

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to original approach

@mrDzurb mrDzurb requested review from elizjo and mrDzurb July 7, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants