Pipeline updates artifact version before uploading 98/15098/1
authorSwaraj Kumar <swaraj.kumar@samsung.com>
Tue, 30 Sep 2025 11:12:58 +0000 (16:42 +0530)
committerSwaraj Kumar <swaraj.kumar@samsung.com>
Tue, 30 Sep 2025 11:12:58 +0000 (16:42 +0530)
Training job fails to restart after initial upload failure in the qoe_Pipeline.
Artifact updation moved after the uploading of the models in 'qoe-pipeline.ipynb' and 'qoe-pipeline-retrain.ipynb'

Issue-ID: AIMLFW-272
Change-Id: Id612aedcd85074b731bdcb2d248bdec14159298f
Signed-off-by: Swaraj Kumar <swaraj.kumar@samsung.com>
kf-pipelines/qoe-pipeline-retrain.ipynb
kf-pipelines/qoe-pipeline.ipynb

index f9a2d3a..de8ce78 100644 (file)
     "    data['metrics'] = []\n",
     "    data['metrics'].append({'Accuracy': str(np.mean(np.absolute(np.asarray(xx)-np.asarray(yy))<5))})\n",
     "\n",
-    "# update artifact version\n",
+    "    # update artifact version\n",
     "    new_artifactversion =\"\"\n",
     "    if modelinfo[\"modelLocation\"] != \"\":\n",
     "        new_artifactversion = \"1.1.0\"\n",
     "        minor+=1\n",
     "        new_artifactversion = f\"{major}.{minor}.{patch}\"\n",
     "    \n",
-    "    # update the new artifact version in mme\n",
-    "    url = f\"http://modelmgmtservice.traininghost:8082/ai-ml-model-registration/v1/model-registrations/updateArtifact/{modelname}/{modelversion}/{new_artifactversion}\"\n",
-    "    updated_model_info= requests.post(url).json()\n",
-    "    print(updated_model_info)\n",
-    "    \n",
     "    print(\"uploading keras model to MME\")\n",
     "    mm_sdk.upload_model(\"./retrain/keras_model\", modelname + \"_keras\", modelversion, new_artifactversion)\n",
     "    print(\"Saved keras format\")\n",
     "    mm_sdk.upload_model(\"./retrain/saved_model\", modelname, modelversion, new_artifactversion)\n",
-    "    print(\"Saved savedmodel format\")"
+    "    print(\"Saved savedmodel format\")\n",
+    "    \n",
+    "    # update the new artifact version in mme\n",
+    "    url = f\"http://modelmgmtservice.traininghost:8082/ai-ml-model-registration/v1/model-registrations/updateArtifact/{modelname}/{modelversion}/{new_artifactversion}\"\n",
+    "    updated_model_info= requests.post(url).json()\n",
+    "    print(updated_model_info)"
    ]
   },
   {
     "pipeline_file = file_name+'.yaml'\n",
     "requests.post(\"http://tm.traininghost:32002/pipelines/{}/upload\".format(pipeline_name), files={'file':open(pipeline_file,'rb')})"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {
index 36af090..c2ebcca 100644 (file)
     "    data['metrics'] = []\n",
     "    data['metrics'].append({'Accuracy': str(np.mean(np.absolute(np.asarray(xx)-np.asarray(yy))<5))})\n",
     "    \n",
-    "#     as new artifact after training will always be 1.0.0\n",
+    "    # new artifact after training will always be 1.0.0\n",
     "    artifactversion=\"1.0.0\"\n",
-    "    url = f\"http://modelmgmtservice.traininghost:8082/ai-ml-model-registration/v1/model-registrations/updateArtifact/{modelname}/{modelversion}/{artifactversion}\"\n",
-    "    updated_model_info= requests.post(url).json()\n",
-    "    print(updated_model_info)\n",
     "    \n",
     "    #featurepath is a combination of <feature_group>_<trainingjob_Id>\n",
     "    trainingjob_id = featurepath.split('_')[-1]\n",
     "    mm_sdk.upload_model(\"./keras_model\", modelname + \"_keras\", modelversion, artifactversion)\n",
     "    print(\"Saved keras format\")\n",
     "    mm_sdk.upload_model(\"./saved_model\", modelname, modelversion, artifactversion)\n",
-    "    print(\"Saved savedmodel format\")"
+    "    print(\"Saved savedmodel format\")\n",
+    "    \n",
+    "    # update the new artifact version in mme\n",
+    "    url = f\"http://modelmgmtservice.traininghost:8082/ai-ml-model-registration/v1/model-registrations/updateArtifact/{modelname}/{modelversion}/{artifactversion}\"\n",
+    "    updated_model_info= requests.post(url).json()\n",
+    "    print(updated_model_info)"
    ]
   },
   {
     "pipeline_file = file_name+'.yaml'\n",
     "requests.post(\"http://tm.traininghost:32002/pipelines/{}/upload\".format(pipeline_name), files={'file':open(pipeline_file,'rb')})"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {