| @@ -5,7 +5,6 @@ import com.alibaba.fastjson2.JSONArray; | |||||
| import com.alibaba.fastjson2.JSONObject; | import com.alibaba.fastjson2.JSONObject; | ||||
| import com.ruoyi.common.security.utils.SecurityUtils; | import com.ruoyi.common.security.utils.SecurityUtils; | ||||
| import com.ruoyi.platform.annotations.CheckDuplicate; | import com.ruoyi.platform.annotations.CheckDuplicate; | ||||
| import com.ruoyi.system.api.constant.Constant; | |||||
| import com.ruoyi.platform.domain.*; | import com.ruoyi.platform.domain.*; | ||||
| import com.ruoyi.platform.domain.dependencydomain.ProjectDepency; | import com.ruoyi.platform.domain.dependencydomain.ProjectDepency; | ||||
| import com.ruoyi.platform.domain.dependencydomain.TrainTaskDepency; | import com.ruoyi.platform.domain.dependencydomain.TrainTaskDepency; | ||||
| @@ -18,6 +17,7 @@ import com.ruoyi.platform.utils.JsonUtils; | |||||
| import com.ruoyi.platform.utils.YamlUtils; | import com.ruoyi.platform.utils.YamlUtils; | ||||
| import com.ruoyi.platform.vo.ModelsVo; | import com.ruoyi.platform.vo.ModelsVo; | ||||
| import com.ruoyi.platform.vo.NewDatasetVo; | import com.ruoyi.platform.vo.NewDatasetVo; | ||||
| import com.ruoyi.system.api.constant.Constant; | |||||
| import com.ruoyi.system.api.model.LoginUser; | import com.ruoyi.system.api.model.LoginUser; | ||||
| import org.apache.commons.collections4.MapUtils; | import org.apache.commons.collections4.MapUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| @@ -231,12 +231,15 @@ public class ExperimentServiceImpl implements ExperimentService { | |||||
| try { | try { | ||||
| String convertRes = HttpUtils.sendPost(argoUrl + argoConvert, dag); | String convertRes = HttpUtils.sendPost(argoUrl + argoConvert, dag); | ||||
| if (convertRes == null || StringUtils.isEmpty(convertRes)) { | if (convertRes == null || StringUtils.isEmpty(convertRes)) { | ||||
| throw new RuntimeException("转换流水线失败"); | |||||
| throw new Exception("转换流水线失败"); | |||||
| } | } | ||||
| Map<String, Object> converMap = JsonUtils.jsonToMap(convertRes); | Map<String, Object> converMap = JsonUtils.jsonToMap(convertRes); | ||||
| // 判断积分和资源是否足够 | // 判断积分和资源是否足够 | ||||
| Map<String, Map<String, Object>> resourceInfo = (Map<String, Map<String, Object>>) converMap.get("resource_info"); | Map<String, Map<String, Object>> resourceInfo = (Map<String, Map<String, Object>>) converMap.get("resource_info"); | ||||
| if (resourceInfo == null) { | |||||
| throw new Exception("未配置运行所需资源"); | |||||
| } | |||||
| for (Map.Entry<String, Map<String, Object>> entry : resourceInfo.entrySet()) { | for (Map.Entry<String, Map<String, Object>> entry : resourceInfo.entrySet()) { | ||||
| Map<String, Object> node = entry.getValue(); | Map<String, Object> node = entry.getValue(); | ||||
| resourceOccupyService.haveResource((Integer) node.get("computing_resource_id"), 1); | resourceOccupyService.haveResource((Integer) node.get("computing_resource_id"), 1); | ||||
| @@ -276,7 +279,7 @@ public class ExperimentServiceImpl implements ExperimentService { | |||||
| experimentIns.setExperimentId(experiment.getId()); | experimentIns.setExperimentId(experiment.getId()); | ||||
| experimentIns.setArgoInsNs((String) metadata.get("namespace")); | experimentIns.setArgoInsNs((String) metadata.get("namespace")); | ||||
| experimentIns.setArgoInsName((String) metadata.get("name")); | experimentIns.setArgoInsName((String) metadata.get("name")); | ||||
| experimentIns.setStatus("Pending"); | |||||
| experimentIns.setStatus(Constant.Pending); | |||||
| //传入实验全局参数 | //传入实验全局参数 | ||||
| experimentIns.setGlobalParam(experiment.getGlobalParam()); | experimentIns.setGlobalParam(experiment.getGlobalParam()); | ||||
| @@ -314,9 +317,8 @@ public class ExperimentServiceImpl implements ExperimentService { | |||||
| Map<String, Object> node = entry.getValue(); | Map<String, Object> node = entry.getValue(); | ||||
| resourceOccupyService.startDeduce((Integer) node.get("computing_resource_id"), 1, Constant.TaskType_Workflow, Long.valueOf(id), Long.valueOf(insert.getId()), experiment.getWorkflowId(), experiment.getName(), entry.getKey(), Constant.State_building); | resourceOccupyService.startDeduce((Integer) node.get("computing_resource_id"), 1, Constant.TaskType_Workflow, Long.valueOf(id), Long.valueOf(insert.getId()), experiment.getWorkflowId(), experiment.getName(), entry.getKey(), Constant.State_building); | ||||
| } | } | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| throw new RuntimeException(e); | |||||
| throw new Exception(e); | |||||
| } | } | ||||
| List<ExperimentIns> updatedExperimentInsList = experimentInsService.getByExperimentId(id); | List<ExperimentIns> updatedExperimentInsList = experimentInsService.getByExperimentId(id); | ||||
| experiment.setExperimentInsList(updatedExperimentInsList); | experiment.setExperimentInsList(updatedExperimentInsList); | ||||
| @@ -523,7 +525,6 @@ public class ExperimentServiceImpl implements ExperimentService { | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| private void insertModelDependencyNew(Map<String, Object> dependendcy, Map<String, Object> trainInfo, Map<String, Object> output, String metricRecord, Integer experimentInsId, Long workflowId, Integer experimentId, String experimentName, String globalParam) { | private void insertModelDependencyNew(Map<String, Object> dependendcy, Map<String, Object> trainInfo, Map<String, Object> output, String metricRecord, Integer experimentInsId, Long workflowId, Integer experimentId, String experimentName, String globalParam) { | ||||