self.logger.error(str(err))
self.logger.debug("run_kf_pipeline Exited")
- return run
\ No newline at end of file
+ return run
+
+
+ def terminate_kf_pipeline(self, run_id):
+ print("Terminating Run: run_id: ", run_id)
+ try:
+ out = self.kfp_client.terminate_run(run_id)
+ print("Terminate Run O/p :: ", out)
+ except Exception as err:
+ self.logger.error("Terminate Run Error :: ", str(err))
+ raise err
\ No newline at end of file
run_dict = {}
try:
if request.method == 'DELETE':
- LOGGER.error("Method not supported yet")
- raise BadRequest("Method not supported yet", status.HTTP_501_NOT_IMPLEMENTED,\
- {'ext': 1})
+ LOGGER.debug("Deleting Run_id : " + run_id)
+ KFCONNECT_KF_OBJ.terminate_kf_pipeline(run_id)
+ with kfadapter_conf.LOCK:
+ # Deleting from global-var so that wait_status_thread should not keep checking this run_id
+ del kfadapter_conf.TRAINING_DICT[run_id]
+ return {}, status.HTTP_200_OK
run_info = KFCONNECT_KF_OBJ.get_kf_run(run_id)
run_dict['run_id'] = run_info.run_id