Pipeline samples artifact version before uploading 21/15121/1
authorSwaraj Kumar <swaraj.kumar@samsung.com>
Tue, 7 Oct 2025 05:01:51 +0000 (10:31 +0530)
committerSwaraj Kumar <swaraj.kumar@samsung.com>
Tue, 7 Oct 2025 05:01:51 +0000 (10:31 +0530)
Training job fails to restart after initial upload failure in the qoe_Pipeline sample.
Artifact updation moved after the uploading of the models in 'qoe-pipeline.py' and 'qoe-pipeline-retrain.py'

Issue-ID: AIMLFW-272
Change-Id: I68a431b4c0863590fbbcf6c0286131b2d691bc8d
Signed-off-by: Swaraj Kumar <swaraj.kumar@samsung.com>
samples/qoe/qoe_pipeline.py
samples/qoe/qoe_pipeline_retrain.py

index 4ac22d4..e1092de 100644 (file)
@@ -113,9 +113,6 @@ def train_export_model(featurepath: str, epochs: str, modelname: str, modelversi
     
 #     as new artifact after training will always be 1.0.0
     artifactversion="1.0.0"
-    url = f"http://modelmgmtservice.traininghost:8082/ai-ml-model-registration/v1/model-registrations/updateArtifact/{modelname}/{modelversion}/{artifactversion}"
-    updated_model_info= requests.post(url).json()
-    print(updated_model_info)
     
     #featurepath is a combination of <feature_group>_<trainingjob_Id>
     trainingjob_id = featurepath.split('_')[-1]
@@ -126,6 +123,10 @@ def train_export_model(featurepath: str, epochs: str, modelname: str, modelversi
     print("Saved keras format")
     mm_sdk.upload_model("./saved_model", modelname, modelversion, artifactversion)
     print("Saved savedmodel format")
+    
+    url = f"http://modelmgmtservice.traininghost:8082/ai-ml-model-registration/v1/model-registrations/updateArtifact/{modelname}/{modelversion}/{artifactversion}"
+    updated_model_info= requests.post(url).json()
+    print(updated_model_info)
 
 @dsl.pipeline(
     name="qoe Pipeline",
index 1cd2450..dca5ee4 100644 (file)
@@ -191,17 +191,17 @@ def train_export_model(featurepath: str, epochs: str, modelname: str, modelversi
         minor+=1
         new_artifactversion = f"{major}.{minor}.{patch}"
     
-    # update the new artifact version in mme
-    url = f"http://modelmgmtservice.traininghost:8082/ai-ml-model-registration/v1/model-registrations/updateArtifact/{modelname}/{modelversion}/{new_artifactversion}"
-    updated_model_info= requests.post(url).json()
-    print(updated_model_info)
-    
     print("uploading keras model to MME")
     mm_sdk.upload_model("./retrain/keras_model", modelname + "_keras", modelversion, new_artifactversion)
     print("Saved keras format")
     mm_sdk.upload_model("./retrain/saved_model", modelname, modelversion, new_artifactversion)
     print("Saved savedmodel format")
 
+    # update the new artifact version in mme
+    url = f"http://modelmgmtservice.traininghost:8082/ai-ml-model-registration/v1/model-registrations/updateArtifact/{modelname}/{modelversion}/{new_artifactversion}"
+    updated_model_info= requests.post(url).json()
+    print(updated_model_info)
+
 @dsl.pipeline(
     name="qoe Pipeline",
     description="qoe",