-
Notifications
You must be signed in to change notification settings - Fork 56
Custom model telemetry #1239
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
Custom model telemetry #1239
Changes from 5 commits
e86c870
82893a8
2b7120d
6793873
8dd84ac
bfc9873
d01a33e
a5d46fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,6 +214,7 @@ def create( | |
) | ||
aqua_model = model_app.create( | ||
model_id=create_deployment_details.model_id, | ||
display_name=create_deployment_details.model_name, | ||
|
||
compartment_id=compartment_id, | ||
project_id=project_id, | ||
freeform_tags=freeform_tags, | ||
|
@@ -446,6 +447,7 @@ def _create( | |
cmd_var_string = aqua_model.custom_metadata_list.get( | ||
AQUA_DEPLOYMENT_CONTAINER_CMD_VAR_METADATA_NAME | ||
).value | ||
|
||
default_cmd_var = shlex.split(cmd_var_string) | ||
if default_cmd_var: | ||
cmd_var = validate_cmd_var(default_cmd_var, cmd_var) | ||
|
@@ -538,7 +540,6 @@ def _create( | |
) | ||
|
||
deployment_params = get_combined_params(config_params, user_params) | ||
|
||
params = f"{params} {deployment_params}".strip() | ||
if params: | ||
env_var.update({"PARAMS": params}) | ||
|
@@ -560,6 +561,8 @@ def _create( | |
AQUA_MODEL_TYPE_CUSTOM if is_fine_tuned_model else AQUA_MODEL_TYPE_SERVICE | ||
) | ||
|
||
is_custom_base_model = Tags.BASE_MODEL_CUSTOM in aqua_model.freeform_tags | ||
|
||
return self._create_deployment( | ||
create_deployment_details=create_deployment_details, | ||
aqua_model_id=aqua_model.id, | ||
|
@@ -571,6 +574,7 @@ def _create( | |
env_var=env_var, | ||
tags=tags, | ||
cmd_var=cmd_var, | ||
is_custom_base_model=is_custom_base_model, | ||
) | ||
|
||
def _create_multi( | ||
|
@@ -647,6 +651,7 @@ def _create_multi( | |
} | ||
|
||
model_name = f"{MODEL_NAME_DELIMITER} ".join(model_name_list) | ||
is_custom_base_model = Tags.BASE_MODEL_CUSTOM in aqua_model.freeform_tags | ||
agrimk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
aqua_deployment = self._create_deployment( | ||
create_deployment_details=create_deployment_details, | ||
|
@@ -658,6 +663,7 @@ def _create_multi( | |
health_check_port=health_check_port, | ||
env_var=env_var, | ||
tags=tags, | ||
is_custom_base_model=is_custom_base_model, | ||
) | ||
aqua_deployment.models = create_deployment_details.models | ||
return aqua_deployment | ||
|
@@ -673,6 +679,7 @@ def _create_deployment( | |
health_check_port: str, | ||
env_var: dict, | ||
tags: dict, | ||
is_custom_base_model: bool = False, | ||
cmd_var: Optional[dict] = None, | ||
): | ||
"""Creates data science model deployment. | ||
|
@@ -698,6 +705,8 @@ def _create_deployment( | |
The environment variables input for the deployment. | ||
tags: dict | ||
The tags input for the deployment. | ||
is_custom_base_model: bool, optional | ||
The flag set true for custom model. | ||
cmd_var: dict, optional | ||
The cmd arguments input for the deployment. | ||
|
||
|
@@ -785,8 +794,8 @@ 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)} | ||
|
||
if Tags.BASE_MODEL_CUSTOM in tags: | ||
telemetry_kwargs["custom_base_model"] = True | ||
if is_custom_base_model: | ||
|
||
telemetry_kwargs["custom_base_model"] = "True" | ||
|
||
# tracks unique deployments that were created in the user compartment | ||
self.telemetry.record_event_async( | ||
|
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.
Why this change is here?