Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ads/aqua/verify_policies/entities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from dataclasses import dataclass
from typing import Optional

from ads.common.extended_enum import ExtendedEnum
from ads.common.serializer import DataClassSerializable

Expand All @@ -20,6 +22,7 @@ class OperationResultFailure(DataClassSerializable):
operation: str
error: str
policy_hint: str
cleanup_hint: Optional[str] = None
status: PolicyStatus = PolicyStatus.FAILURE


Expand Down
33 changes: 29 additions & 4 deletions ads/aqua/verify_policies/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@
utils.aqua_model.delete_model.__name__: {
"name": "Delete Model",
"error": "Could not delete model. Please confirm you have delete permissions for Model Catalog resources in the compartment.",
"policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-models in compartment <your-compartment-name>"
"policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-models in compartment <your-compartment-name>",
"cleanup_hint": (
f'Automatic cleanup of resources failed due to missing policies. '
f'A model with the name "{TEST_MODEL_NAME}" and a test file with the name "{OBS_MANAGE_TEST_FILE}" '
f'have been created in the Object Storage bucket you specified. '
f'Please manually delete the resources to prevent incurring charges.'
)

},
utils.create_job.__name__: {
"name": "Create Job",
Expand All @@ -75,7 +82,13 @@
"delete_job": {
"name": "Delete Job",
"error": "Job could not be deleted. Please check if you have permissions to delete Data Science jobs.",
"policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-jobs in compartment <your-compartment-name>"
"policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-jobs in compartment <your-compartment-name>",
"cleanup_hint": (
f'Automatic cleanup of resources failed due to missing policies. '
f'A job with the name "{TEST_JOB_NAME}" and a test file with the name "{OBS_MANAGE_TEST_FILE}" '
f'have been created in the Object Storage bucket you specified. '
f'Please manually delete the resources to prevent incurring charges.'
)
},
utils.aqua_model.create_model_version_set.__name__: {
"name": "Create Model Version Set",
Expand All @@ -85,7 +98,13 @@
utils.aqua_model.ds_client.delete_model_version_set.__name__: {
"name": "Delete Model Version Set",
"error": "Unable to delete a model version. Ensure that required Model Catalog permissions are set.",
"policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-modelversionsets in compartment <your-compartment-name>"
"policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-modelversionsets in compartment <your-compartment-name>",
"cleanup_hint": (
f'Automatic cleanup of resources failed due to missing policies. '
f'A model version set with the name "{TEST_MVS_NAME}" and a test file with the name "{OBS_MANAGE_TEST_FILE}" '
f'have been created in the Object Storage bucket you specified. '
f'Please manually delete the resources to prevent incurring charges.'
)
},
utils.create_model_deployment.__name__: {
"name": "Create Model Deployment",
Expand All @@ -95,7 +114,13 @@
utils.aqua_model.ds_client.delete_model_deployment.__name__: {
"name": "Delete Model Deployment",
"error": "Unable to delete the model deployment. Please check if you have appropriate permissions to manage deployments.",
"policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-model-deployments in compartment <your-compartment-name>"
"policy_hint": "Allow dynamic-group aqua-dynamic-group to manage data-science-model-deployments in compartment <your-compartment-name>",
"cleanup_hint": (
f'Automatic cleanup of resources failed due to missing policies. '
f'A model deployment with the name "{TEST_MD_NAME}" and a test file with the name "{OBS_MANAGE_TEST_FILE}" '
f'have been created in the Object Storage bucket you specified. '
f'Please manually delete the resources to prevent incurring charges.'
)
}

}
Loading
Loading