From 3901004bca24c2eb9f93da5b040e12f31154b4c6 Mon Sep 17 00:00:00 2001 From: Agrim Khanna Date: Sun, 11 May 2025 15:26:52 +0530 Subject: [PATCH 1/3] ODSC-70761 Update telemetry model classifications --- ads/aqua/modeldeployment/deployment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ads/aqua/modeldeployment/deployment.py b/ads/aqua/modeldeployment/deployment.py index 90f211af3..c774072bc 100644 --- a/ads/aqua/modeldeployment/deployment.py +++ b/ads/aqua/modeldeployment/deployment.py @@ -803,7 +803,7 @@ def _create_deployment( ) # we arbitrarily choose last 8 characters of OCID to identify MD in telemetry - telemetry_kwargs = {"ocid": get_ocid_substring(deployment_id, key_len=8)} + telemetry_kwargs = {"ocid": get_ocid_substring(deployment_id, key_len=8), "custom_base_model": True} # tracks unique deployments that were created in the user compartment self.telemetry.record_event_async( From fc757f6a42b838a485f2f9d097c72e7529124473 Mon Sep 17 00:00:00 2001 From: Agrim Khanna Date: Thu, 15 May 2025 20:55:34 +0530 Subject: [PATCH 2/3] PR review comments --- ads/aqua/modeldeployment/deployment.py | 27 ++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/ads/aqua/modeldeployment/deployment.py b/ads/aqua/modeldeployment/deployment.py index c774072bc..5c11183f5 100644 --- a/ads/aqua/modeldeployment/deployment.py +++ b/ads/aqua/modeldeployment/deployment.py @@ -48,7 +48,7 @@ from ads.aqua.data import AquaResourceIdentifier from ads.aqua.finetuning.finetuning import FineTuneCustomMetadata from ads.aqua.model import AquaModelApp -from ads.aqua.model.constants import AquaModelMetadataKeys, ModelCustomMetadataFields +from ads.aqua.model.constants import AquaModelMetadataKeys, ModelCustomMetadataFields, ModelType from ads.aqua.modeldeployment.entities import ( AquaDeployment, AquaDeploymentConfig, @@ -803,7 +803,10 @@ def _create_deployment( ) # we arbitrarily choose last 8 characters of OCID to identify MD in telemetry - telemetry_kwargs = {"ocid": get_ocid_substring(deployment_id, key_len=8), "custom_base_model": True} + telemetry_kwargs = {"ocid": get_ocid_substring(deployment_id, key_len=8)} + + if Tags.BASE_MODEL_CUSTOM in tags: + telemetry_kwargs[ "custom_base_model"] = True # tracks unique deployments that were created in the user compartment self.telemetry.record_event_async( @@ -1324,3 +1327,23 @@ def list_shapes(self, **kwargs) -> List[ComputeShapeSummary]: ) for oci_shape in oci_shapes ] + + def get_deployment_status(self,model_deployment_id: str, work_request_id : str) : + # category= "aqua/{model_type}/deployment/status", action= "FAILED/SUCCEEDED", detail="Error message from Work request", value= {"ocid": md_ocid[:8]} + # # tracks unique evaluation that were created for the given evaluation source + # self.telemetry.record_event_async( + # category="aqua/evaluation", + # action="create", + # detail=self._get_service_model_name(evaluation_source), + # ) + + + return + + def get_deployment_status_async(self,model_deployment_id: str, work_request_id : str) : + # tracks unique evaluation that were created for the given evaluation source + self.telemetry.record_event_async( + category="aqua/evaluation", + action="create", + detail=self._get_service_model_name(evaluation_source), + ) From 93f539da483c302e3a0c67ed3b65597b0da8b492 Mon Sep 17 00:00:00 2001 From: Agrim Khanna Date: Thu, 15 May 2025 21:01:54 +0530 Subject: [PATCH 3/3] removed unused code --- ads/aqua/modeldeployment/deployment.py | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/ads/aqua/modeldeployment/deployment.py b/ads/aqua/modeldeployment/deployment.py index db74212ca..9394dfe3d 100644 --- a/ads/aqua/modeldeployment/deployment.py +++ b/ads/aqua/modeldeployment/deployment.py @@ -1309,24 +1309,4 @@ def list_shapes(self, **kwargs) -> List[ComputeShapeSummary]: or gpu_specs.shapes.get(oci_shape.name.upper()), ) for oci_shape in oci_shapes - ] - - def get_deployment_status(self,model_deployment_id: str, work_request_id : str) : - # category= "aqua/{model_type}/deployment/status", action= "FAILED/SUCCEEDED", detail="Error message from Work request", value= {"ocid": md_ocid[:8]} - # # tracks unique evaluation that were created for the given evaluation source - # self.telemetry.record_event_async( - # category="aqua/evaluation", - # action="create", - # detail=self._get_service_model_name(evaluation_source), - # ) - - - return - - def get_deployment_status_async(self,model_deployment_id: str, work_request_id : str) : - # tracks unique evaluation that were created for the given evaluation source - self.telemetry.record_event_async( - category="aqua/evaluation", - action="create", - detail=self._get_service_model_name(evaluation_source), - ) + ] \ No newline at end of file