Skip to content

Commit

Permalink
Regression master branch (#203)
Browse files Browse the repository at this point in the history
* bug fix in update_global_exe_ids

* bug update_global_art_ids updates doesn't modifies

* adding changes

* Added logging dir before current script

---------

Co-authored-by: Abhinav Chobey <[email protected]>
Co-authored-by: AyeshaSanadi <[email protected]>
  • Loading branch information
3 people authored Aug 29, 2024
1 parent e25f18b commit a5c56fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
9 changes: 4 additions & 5 deletions cmflib/cmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ def create_execution(
Returns:
Execution object from ML Metadata library associated with the new execution for this stage.
"""
logging_dir = change_dir(self.cmf_init_path)
# Assigning current file name as stage and execution name
current_script = sys.argv[0]
file_name = os.path.basename(current_script)
Expand All @@ -368,7 +369,6 @@ def create_execution(

# Initializing the execution related fields

logging_dir = change_dir(self.cmf_init_path)
self.metrics = {}
self.input_artifacts = []
self.execution_label_props = {}
Expand Down Expand Up @@ -647,6 +647,7 @@ def log_dataset(
Returns:
Artifact object from ML Metadata library associated with the new dataset artifact.
"""
logging_dir = change_dir(self.cmf_init_path)
# Assigning current file name as stage and execution name
current_script = sys.argv[0]
file_name = os.path.basename(current_script)
Expand All @@ -665,7 +666,6 @@ def log_dataset(
# If the dataset already exist , then we just link the existing dataset to the execution
# We do not update the dataset properties .
# We need to append the new properties to the existing dataset properties
logging_dir = change_dir(self.cmf_init_path)
custom_props = {} if custom_properties is None else custom_properties
git_repo = git_get_repo()
name = re.split("/", url)[-1]
Expand Down Expand Up @@ -999,6 +999,7 @@ def log_model(
Artifact object from ML Metadata library associated with the new model artifact.
"""

logging_dir = change_dir(self.cmf_init_path)
# Assigning current file name as stage and execution name
current_script = sys.argv[0]
file_name = os.path.basename(current_script)
Expand All @@ -1018,7 +1019,6 @@ def log_model(
# If the model already exist , then we just link the existing model to the execution
# We do not update the model properties .
# We need to append the new properties to the existing model properties
logging_dir = change_dir(self.cmf_init_path)
if custom_properties is None:
custom_properties = {}
custom_props = {} if custom_properties is None else custom_properties
Expand Down Expand Up @@ -1379,6 +1379,7 @@ def log_execution_metrics(
Returns:
Artifact object from ML Metadata library associated with the new coarse-grained metrics artifact.
"""
logging_dir = change_dir(self.cmf_init_path)
# Assigning current file name as stage and execution name
current_script = sys.argv[0]
file_name = os.path.basename(current_script)
Expand All @@ -1393,8 +1394,6 @@ def log_execution_metrics(
self.create_execution(execution_type=name_without_extension)
assert self.execution is not None, f"Failed to create execution for {self.pipeline_name}!!"


logging_dir = change_dir(self.cmf_init_path)
custom_props = {} if custom_properties is None else custom_properties
uri = str(uuid.uuid1())
metrics_name = metrics_name + ":" + uri + ":" + str(self.execution.id)
Expand Down
12 changes: 4 additions & 8 deletions server/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,18 +373,14 @@ async def model_card(request:Request, modelId: int, response_model=List[Dict[str
async def update_global_art_dict(pipeline_name):
global dict_of_art_ids
output_dict = await get_all_artifact_ids(server_store_path, dict_of_exe_ids, pipeline_name)
if pipeline_name in dict_of_art_ids:
dict_of_art_ids[pipeline_name].update(output_dict[pipeline_name])
else:
dict_of_art_ids[pipeline_name] = output_dict[pipeline_name]
# type(dict_of_exe_ids[pipeline_name]) = Dict[ <class 'pandas.core.frame.DataFrame'> ]
dict_of_art_ids[pipeline_name]=output_dict[pipeline_name]
return


async def update_global_exe_dict(pipeline_name):
global dict_of_exe_ids
output_dict = await get_all_exe_ids(server_store_path, pipeline_name)
if pipeline_name in dict_of_exe_ids:
dict_of_exe_ids[pipeline_name].update(output_dict[pipeline_name])
else:
dict_of_exe_ids[pipeline_name] = output_dict[pipeline_name]
# type(dict_of_exe_ids[pipeline_name]) = <class 'pandas.core.frame.DataFrame'>
dict_of_exe_ids[pipeline_name] = output_dict[pipeline_name]
return

0 comments on commit a5c56fe

Please sign in to comment.