|
|
@@ -11,7 +11,6 @@ import com.ruoyi.platform.mapper.ExperimentDao; |
|
|
import com.ruoyi.platform.mapper.ExperimentInsDao; |
|
|
import com.ruoyi.platform.mapper.ExperimentInsDao; |
|
|
import com.ruoyi.platform.mapper.ModelDependency1Dao; |
|
|
import com.ruoyi.platform.mapper.ModelDependency1Dao; |
|
|
import com.ruoyi.platform.service.ExperimentInsService; |
|
|
import com.ruoyi.platform.service.ExperimentInsService; |
|
|
import com.ruoyi.platform.service.WorkflowService; |
|
|
|
|
|
import com.ruoyi.platform.utils.*; |
|
|
import com.ruoyi.platform.utils.*; |
|
|
import com.ruoyi.platform.vo.LogRequestVo; |
|
|
import com.ruoyi.platform.vo.LogRequestVo; |
|
|
import com.ruoyi.platform.vo.PodLogVo; |
|
|
import com.ruoyi.platform.vo.PodLogVo; |
|
|
@@ -339,7 +338,7 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { |
|
|
* @return 是否成功 |
|
|
* @return 是否成功 |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public boolean terminateExperimentIns(Integer id) { |
|
|
|
|
|
|
|
|
public boolean terminateExperimentIns(Integer id) throws Exception { |
|
|
//先查出实验记录 |
|
|
//先查出实验记录 |
|
|
ExperimentIns experimentIns = this.experimentInsDao.queryById(id); |
|
|
ExperimentIns experimentIns = this.experimentInsDao.queryById(id); |
|
|
if (experimentIns == null) { |
|
|
if (experimentIns == null) { |
|
|
@@ -356,7 +355,7 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { |
|
|
|
|
|
|
|
|
// 只有状态是"Running"时才能终止实例 |
|
|
// 只有状态是"Running"时才能终止实例 |
|
|
if (!currentStatus.equalsIgnoreCase("Running")) { |
|
|
if (!currentStatus.equalsIgnoreCase("Running")) { |
|
|
return false; // 如果不是"Running"状态,则不执行终止操作 |
|
|
|
|
|
|
|
|
throw new Exception("终止错误,只有运行状态的实例才能终止"); // 如果不是"Running"状态,则不执行终止操作 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 创建请求数据map |
|
|
// 创建请求数据map |
|
|
@@ -412,7 +411,7 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { |
|
|
|
|
|
|
|
|
return true; |
|
|
return true; |
|
|
} else { |
|
|
} else { |
|
|
return false; |
|
|
|
|
|
|
|
|
throw new Exception("终止错误"); |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
throw new RuntimeException("终止实例错误: " + e.getMessage(), e); |
|
|
throw new RuntimeException("终止实例错误: " + e.getMessage(), e); |
|
|
@@ -436,8 +435,12 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { |
|
|
HashMap queryMap = new HashMap<String, Integer>(); |
|
|
HashMap queryMap = new HashMap<String, Integer>(); |
|
|
queryMap.put("insId", experimentIns.getId()); |
|
|
queryMap.put("insId", experimentIns.getId()); |
|
|
ModelDependency1 modelDependency1 = modelDependency1Dao.queryByInsId(JSON.toJSONString(queryMap)); |
|
|
ModelDependency1 modelDependency1 = modelDependency1Dao.queryByInsId(JSON.toJSONString(queryMap)); |
|
|
String relativePath = ci4sUsername + "/model/" + modelDependency1.getRepoId() + "/" + modelDependency1.getIdentifier() + "/" + modelDependency1.getVersion() + "/model"; |
|
|
|
|
|
modelsService.deleteVersion(modelDependency1.getRepoId(), modelDependency1.getIdentifier(), modelDependency1.getOwner(), modelDependency1.getVersion(), relativePath); |
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(modelDependency1.getVersion())) { |
|
|
|
|
|
String relativePath = ci4sUsername + "/model/" + modelDependency1.getRepoId() + "/" + modelDependency1.getIdentifier() + "/" + modelDependency1.getVersion() + "/model"; |
|
|
|
|
|
modelsService.deleteVersion(modelDependency1.getRepoId(), modelDependency1.getIdentifier(), modelDependency1.getOwner(), modelDependency1.getVersion(), relativePath); |
|
|
|
|
|
} else { |
|
|
|
|
|
modelDependency1Dao.deleteModelById(modelDependency1.getId()); |
|
|
|
|
|
} |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
//删除导出数据集版本 |
|
|
//删除导出数据集版本 |
|
|
|