2828from ads .aqua .constants import *
2929from ads .aqua .data import AquaResourceIdentifier
3030from ads .common .auth import default_signer
31+ from ads .common .decorator import threaded
3132from ads .common .extended_enum import ExtendedEnumMeta
3233from ads .common .object_storage_details import ObjectStorageDetails
3334from ads .common .oci_resource import SEARCH_TYPE , OCIResource
34- from ads .common .utils import get_console_link , upload_to_os , copy_file
35+ from ads .common .utils import copy_file , get_console_link , upload_to_os
3536from ads .config import AQUA_SERVICE_MODELS_BUCKET , CONDA_BUCKET_NS , TENANCY_OCID
3637from ads .model import DataScienceModel , ModelVersionSet
3738
@@ -195,6 +196,7 @@ def read_file(file_path: str, **kwargs) -> str:
195196 return UNKNOWN
196197
197198
199+ @threaded (timeout = 5 )
198200def load_config (file_path : str , config_file_name : str , ** kwargs ) -> dict :
199201 artifact_path = f"{ file_path .rstrip ('/' )} /{ config_file_name } "
200202 if artifact_path .startswith ("oci://" ):
@@ -540,8 +542,10 @@ def get_container_image(
540542
541543
542544def fetch_service_compartment () -> Union [str , None ]:
543- """Loads the compartment mapping json from service bucket. This json file has a service-model-compartment key which
544- contains a dictionary of namespaces and the compartment OCID of the service models in that namespace.
545+ """
546+ Loads the compartment mapping json from service bucket.
547+ This json file has a service-model-compartment key which contains a dictionary of namespaces
548+ and the compartment OCID of the service models in that namespace.
545549 """
546550 config_file_name = (
547551 f"oci://{ AQUA_SERVICE_MODELS_BUCKET } @{ CONDA_BUCKET_NS } /service_models/config"
@@ -554,8 +558,8 @@ def fetch_service_compartment() -> Union[str, None]:
554558 )
555559 except Exception as e :
556560 logger .debug (
557- f"Config file { config_file_name } /{ CONTAINER_INDEX } to fetch service compartment OCID could not be found. "
558- f"\n { str (e )} ."
561+ f"Config file { config_file_name } /{ CONTAINER_INDEX } to fetch service compartment OCID "
562+ f"could not be found. \n { str (e )} ."
559563 )
560564 return
561565 compartment_mapping = config .get (COMPARTMENT_MAPPING_KEY )
0 commit comments